ipv6: Initialize ip6_tnl.hlen in gre tunnel even if no route is found
Subsystems (3)
PATCH 1/1 ipv6: Initialize ip6_tnl.hlen in gre tunnel even if no route is found
The ip6_tnl.hlen (gre and ipv6 headers length) is independent from the outgoing interface, so it would be better to initialize it even when no route is found, otherwise its value will be zero.
While I'm not sure if this could happen in real life, but doing that will avoid to call the skb_push function with a zero in ip6gre_header function.
--- net/ipv6/ip6_gre.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
net/ipv6/ip6_gre.c +1 -2
@@ -978,6 +978,7 @@ static void ip6gre_tnl_link_config(struct ip6_tnl *t, int set_mtu)if (t->parms.o_flags&GRE_SEQ ) addend +=4 ; } + t->hlen = addend;if (p->flags &IP6_TNL_F_CAP_XMIT ) { int strict = (ipv6_addr_type(&p->raddr) &
@@ -1004,8 +1005,6 @@ static void ip6gre_tnl_link_config(struct ip6_tnl *t, int set_mtu) }ip6_rt_put (rt); } - - t->hlen = addend; } static int ip6gre_tnl_change(struct ip6_tnl *t,
Signature · 1 line
1.7.9.5
Quoted 9 lines · Oussama Ghorbel
The ip6_tnl.hlen (gre and ipv6 headers length) is independent from the outgoing interface, so it would be better to initialize it even when no route is found, otherwise its value will be zero.
While I'm not sure if this could happen in real life, but doing that will avoid to call theskb_pushfunction with a zero inip6gre_headerfunction.Suggested-by Hannes Frederic Sowa <[email protected]>Signed-off-by Oussama Ghorbel <[email protected]>
Thanks,
Hannes
From: Hannes Frederic Sowa <[email protected]>
Date: Fri, 11 Oct 2013 17:02:17 +0200
Quoted 8 lines · Oussama Ghorbel
Quoted 7 lines
The ip6_tnl.hlen (gre and ipv6 headers length) is independent from the outgoing interface, so it would be better to initialize it even when no route is found, otherwise its value will be zero.
While I'm not sure if this could happen in real life, but doing that will avoid to call theskb_pushfunction with a zero inip6gre_headerfunction.
Quoted 4 lines
Quoted 2 lines
Suggested-by Hannes Frederic Sowa <[email protected]>Signed-off-by Oussama Ghorbel <[email protected]>
Applied.