Re: [PATCH] ipv6: gre: correct calculation of max_headroom
From: Eric Dumazet <hidden>
Date: 2013-09-29 08:05:03
From: Eric Dumazet <hidden>
Date: 2013-09-29 08:05:03
On Sun, 2013-09-29 at 05:40 +0200, Hannes Frederic Sowa wrote:
gre_hlen already accounts for sizeof(struct ipv6_hdr) + gre header,
so initialize max_headroom to zero. Otherwise the
if (encap_limit >= 0) {
max_headroom += 8;
mtu -= 8;
}
increments an uninitialized variable before max_headroom was reset.
Found with coverity: 728539
Cc: Dmitry Kozlov <redacted>
Signed-off-by: Hannes Frederic Sowa <redacted>
---Acked-by: Eric Dumazet <edumazet@google.com>