Skip to content

Commit 2ae2904

Browse files
Fabian Frederickdavem330
authored andcommitted
vxlan: don't collect metadata if remote checksum is wrong
call vxlan_remcsum() before md filling in vxlan_rcv() Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 7470558 commit 2ae2904

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/net/vxlan.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,6 +1875,10 @@ static int vxlan_rcv(struct sock *sk, struct sk_buff *skb)
18751875
!net_eq(vxlan->net, dev_net(vxlan->dev))))
18761876
goto drop;
18771877

1878+
if (vs->flags & VXLAN_F_REMCSUM_RX)
1879+
if (!vxlan_remcsum(&unparsed, skb, vs->flags))
1880+
goto drop;
1881+
18781882
if (vxlan_collect_metadata(vs)) {
18791883
struct metadata_dst *tun_dst;
18801884

@@ -1891,9 +1895,6 @@ static int vxlan_rcv(struct sock *sk, struct sk_buff *skb)
18911895
memset(md, 0, sizeof(*md));
18921896
}
18931897

1894-
if (vs->flags & VXLAN_F_REMCSUM_RX)
1895-
if (!vxlan_remcsum(&unparsed, skb, vs->flags))
1896-
goto drop;
18971898
if (vs->flags & VXLAN_F_GBP)
18981899
vxlan_parse_gbp_hdr(&unparsed, skb, vs->flags, md);
18991900
/* Note that GBP and GPE can never be active together. This is

0 commit comments

Comments
 (0)