Skip to content

Commit 001e9cb

Browse files
yeyingregkh
authored andcommitted
netfilter/ipvs: clear ipvs_property flag when SKB net namespace changed
[ Upstream commit 2b5ec1a5f9738ee7bf8f5ec0526e75e00362c48f ] When run ipvs in two different network namespace at the same host, and one ipvs transport network traffic to the other network namespace ipvs. 'ipvs_property' flag will make the second ipvs take no effect. So we should clear 'ipvs_property' when SKB network namespace changed. Fixes: 621e84d ("dev: introduce skb_scrub_packet()") Signed-off-by: Ye Yin <hustcat@gmail.com> Signed-off-by: Wei Zhou <chouryzhou@gmail.com> Signed-off-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 0c1282c commit 001e9cb

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

include/linux/skbuff.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3400,6 +3400,13 @@ static inline void nf_reset_trace(struct sk_buff *skb)
34003400
#endif
34013401
}
34023402

3403+
static inline void ipvs_reset(struct sk_buff *skb)
3404+
{
3405+
#if IS_ENABLED(CONFIG_IP_VS)
3406+
skb->ipvs_property = 0;
3407+
#endif
3408+
}
3409+
34033410
/* Note: This doesn't put any conntrack and bridge info in dst. */
34043411
static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src,
34053412
bool copy)

net/core/skbuff.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4229,6 +4229,7 @@ void skb_scrub_packet(struct sk_buff *skb, bool xnet)
42294229
if (!xnet)
42304230
return;
42314231

4232+
ipvs_reset(skb);
42324233
skb_orphan(skb);
42334234
skb->mark = 0;
42344235
}

0 commit comments

Comments
 (0)