ipv6: pointer math error in ip6_tnl_parse_tlv_enc_lim()
Subsystems (4)
PATCH 1/1 ipv6: pointer math error in ip6_tnl_parse_tlv_enc_lim()
Casting is a high precedence operation but "off" and "i" are in terms of bytes so we need to have some parenthesis here.
Fixes fbfa743a9d2a ("ipv6: fix ip6_tnl_parse_tlv_enc_lim()")
Signed-off-by Dan Carpenter <[email protected]>
net/ipv6/ip6_tunnel.c +1 -1
@@ -441,7 +441,7 @@ __u16 ip6_tnl_parse_tlv_enc_lim(struct sk_buff *skb, __u8 *raw)if (i +sizeof (*tel) > optlen)break ; - tel = (struct ipv6_tlv_tnl_enc_lim *) skb->data + off + i; + tel = (struct ipv6_tlv_tnl_enc_lim *)(skb->data + off + i);/* return index of option if found and valid */ if (tel->type =IPV6_TLV_TNL_ENCAP_LIMIT && tel->length =1 )
Quoted 5 lines · Dan Carpenter
Casting is a high precedence operation but "off" and "i" are in terms of bytes so we need to have some parenthesis here.
Fixes fbfa743a9d2a ("ipv6: fix ip6_tnl_parse_tlv_enc_lim()")Signed-off-by Dan Carpenter <[email protected]>
Silly me. Thanks Dan !
Acked-by Eric Dumazet <[email protected]>
From: Dan Carpenter <[email protected]>
Date: Wed, 1 Feb 2017 11:46:32 +0300
Quoted 5 lines
Casting is a high precedence operation but "off" and "i" are in terms of bytes so we need to have some parenthesis here.
Fixes fbfa743a9d2a ("ipv6: fix ip6_tnl_parse_tlv_enc_lim()")Signed-off-by Dan Carpenter <[email protected]>
Applied, thanks Dan.