Skip to content

Commit 39f57f6

Browse files
williamtudavem330
authored andcommitted
net: erspan: fix erspan config overwrite
When an erspan tunnel device receives an erpsan packet with different tunnel metadata (ex: version, index, hwid, direction), existing code overwrites the tunnel device's erspan configuration with the received packet's metadata. The patch fixes it. Fixes: 1a66a83 ("gre: add collect_md mode to ERSPAN tunnel") Fixes: f551c91 ("net: erspan: introduce erspan v2 for ip_gre") Fixes: ef7baf5 ("ip6_gre: add ip6 erspan collect_md mode") Fixes: 94d7d8f ("ip6_gre: add erspan v2 support") Signed-off-by: William Tu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3df1928 commit 39f57f6

File tree

2 files changed

+0
-18
lines changed

2 files changed

+0
-18
lines changed

net/ipv4/ip_gre.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -322,15 +322,6 @@ static int erspan_rcv(struct sk_buff *skb, struct tnl_ptk_info *tpi,
322322
info = &tun_dst->u.tun_info;
323323
info->key.tun_flags |= TUNNEL_ERSPAN_OPT;
324324
info->options_len = sizeof(*md);
325-
} else {
326-
tunnel->erspan_ver = ver;
327-
if (ver == 1) {
328-
tunnel->index = ntohl(pkt_md->u.index);
329-
} else {
330-
tunnel->dir = pkt_md->u.md2.dir;
331-
tunnel->hwid = get_hwid(&pkt_md->u.md2);
332-
}
333-
334325
}
335326

336327
skb_reset_mac_header(skb);

net/ipv6/ip6_gre.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -562,15 +562,6 @@ static int ip6erspan_rcv(struct sk_buff *skb, int gre_hdr_len,
562562
ip6_tnl_rcv(tunnel, skb, tpi, tun_dst, log_ecn_error);
563563

564564
} else {
565-
tunnel->parms.erspan_ver = ver;
566-
567-
if (ver == 1) {
568-
tunnel->parms.index = ntohl(pkt_md->u.index);
569-
} else {
570-
tunnel->parms.dir = pkt_md->u.md2.dir;
571-
tunnel->parms.hwid = get_hwid(&pkt_md->u.md2);
572-
}
573-
574565
ip6_tnl_rcv(tunnel, skb, tpi, NULL, log_ecn_error);
575566
}
576567

0 commit comments

Comments
 (0)