Skip to content

Commit 2b5ec1a

Browse files
yeyindavem330
authored andcommitted
netfilter/ipvs: clear ipvs_property flag when SKB net namespace changed
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 <[email protected]> Signed-off-by: Wei Zhou <[email protected]> Signed-off-by: Julian Anastasov <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 24de79e commit 2b5ec1a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

include/linux/skbuff.h

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

3773+
static inline void ipvs_reset(struct sk_buff *skb)
3774+
{
3775+
#if IS_ENABLED(CONFIG_IP_VS)
3776+
skb->ipvs_property = 0;
3777+
#endif
3778+
}
3779+
37733780
/* Note: This doesn't put any conntrack and bridge info in dst. */
37743781
static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src,
37753782
bool copy)

net/core/skbuff.c

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

4867+
ipvs_reset(skb);
48674868
skb_orphan(skb);
48684869
skb->mark = 0;
48694870
}

0 commit comments

Comments
 (0)