Skip to content

Commit f40c064

Browse files
peilin-yedavem330
authored andcommitted
ip6_gre: Avoid updating tunnel->tun_hlen in __gre6_xmit()
Do not update tunnel->tun_hlen in data plane code. Use a local variable instead, just like "tunnel_hlen" in net/ipv4/ip_gre.c:gre_fb_xmit(). Co-developed-by: Cong Wang <[email protected]> Signed-off-by: Cong Wang <[email protected]> Signed-off-by: Peilin Ye <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 226c602 commit f40c064

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

net/ipv6/ip6_gre.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,7 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb,
743743
struct ip_tunnel_info *tun_info;
744744
const struct ip_tunnel_key *key;
745745
__be16 flags;
746+
int tun_hlen;
746747

747748
tun_info = skb_tunnel_info_txcheck(skb);
748749
if (IS_ERR(tun_info) ||
@@ -760,9 +761,9 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb,
760761
dsfield = key->tos;
761762
flags = key->tun_flags &
762763
(TUNNEL_CSUM | TUNNEL_KEY | TUNNEL_SEQ);
763-
tunnel->tun_hlen = gre_calc_hlen(flags);
764+
tun_hlen = gre_calc_hlen(flags);
764765

765-
gre_build_header(skb, tunnel->tun_hlen,
766+
gre_build_header(skb, tun_hlen,
766767
flags, protocol,
767768
tunnel_id_to_key32(tun_info->key.tun_id),
768769
(flags & TUNNEL_SEQ) ? htonl(tunnel->o_seqno++)

0 commit comments

Comments
 (0)