Skip to content

Commit 81e659a

Browse files
Philo LuNipaLocal
authored andcommitted
ipvs: Always clear ipvs_property flag in skb_scrub_packet()
We found an issue when using bpf_redirect with ipvs NAT mode after commit ff70202 ("dev_forward_skb: do not scrub skb mark within the same name space"). Particularly, we use bpf_redirect to return the skb directly back to the netif it comes from, i.e., xnet is false in skb_scrub_packet(), and then ipvs_property is preserved and SNAT is skipped in the rx path. ipvs_property has been already cleared when netns is changed in commit 2b5ec1a ("netfilter/ipvs: clear ipvs_property flag when SKB net namespace changed"). This patch just clears it in spite of netns. Fixes: 2b5ec1a ("netfilter/ipvs: clear ipvs_property flag when SKB net namespace changed") Signed-off-by: Philo Lu <[email protected]> Acked-by: Julian Anastasov <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent 0b0a071 commit 81e659a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/core/skbuff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6087,11 +6087,11 @@ void skb_scrub_packet(struct sk_buff *skb, bool xnet)
60876087
skb->offload_fwd_mark = 0;
60886088
skb->offload_l3_fwd_mark = 0;
60896089
#endif
6090+
ipvs_reset(skb);
60906091

60916092
if (!xnet)
60926093
return;
60936094

6094-
ipvs_reset(skb);
60956095
skb->mark = 0;
60966096
skb_clear_tstamp(skb);
60976097
}

0 commit comments

Comments
 (0)