Skip to content

Commit 239fb79

Browse files
tgrafdavem330
authored andcommitted
vxlan: Correctly set flow*i_mark and flow4i_proto in route lookups
VXLAN must provide the skb mark and specifiy IPPROTO_UDP when doing the FIB lookup for the remote ip. Otherwise an invalid route might be returned. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent b0d081c commit 239fb79

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎drivers/net/vxlan.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,6 +1921,8 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
19211921
memset(&fl4, 0, sizeof(fl4));
19221922
fl4.flowi4_oif = rdst->remote_ifindex;
19231923
fl4.flowi4_tos = RT_TOS(tos);
1924+
fl4.flowi4_mark = skb->mark;
1925+
fl4.flowi4_proto = IPPROTO_UDP;
19241926
fl4.daddr = dst->sin.sin_addr.s_addr;
19251927
fl4.saddr = vxlan->saddr.sin.sin_addr.s_addr;
19261928

@@ -1981,6 +1983,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
19811983
fl6.flowi6_oif = rdst->remote_ifindex;
19821984
fl6.daddr = dst->sin6.sin6_addr;
19831985
fl6.saddr = vxlan->saddr.sin6.sin6_addr;
1986+
fl6.flowi6_mark = skb->mark;
19841987
fl6.flowi6_proto = IPPROTO_UDP;
19851988

19861989
if (ipv6_stub->ipv6_dst_lookup(sk, &ndst, &fl6)) {

0 commit comments

Comments
 (0)