Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gre: better support for ICMP messages for gre+ipv6

ipgre_err() can call ip6_err_gen_icmpv6_unreach() for proper
support of ipv4+gre+icmp+ipv6+... frames, used for example
by traceroute/mtr.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Eric Dumazet and committed by
David S. Miller
9b8c6d7b 2d7a3b27

+8
+1
include/net/ip_tunnels.h
··· 157 157 __be16 proto; 158 158 __be32 key; 159 159 __be32 seq; 160 + int hdr_len; 160 161 }; 161 162 162 163 #define PACKET_RCVD 0
+1
net/ipv4/gre_demux.c
··· 117 117 if ((*(u8 *)options & 0xF0) != 0x40) 118 118 hdr_len += 4; 119 119 } 120 + tpi->hdr_len = hdr_len; 120 121 return hdr_len; 121 122 } 122 123 EXPORT_SYMBOL(gre_parse_header);
+6
net/ipv4/ip_gre.c
··· 187 187 if (!t) 188 188 return; 189 189 190 + #if IS_ENABLED(CONFIG_IPV6) 191 + if (tpi->proto == htons(ETH_P_IPV6) && 192 + !ip6_err_gen_icmpv6_unreach(skb, iph->ihl * 4 + tpi->hdr_len, type)) 193 + return; 194 + #endif 195 + 190 196 if (t->parms.iph.daddr == 0 || 191 197 ipv4_is_multicast(t->parms.iph.daddr)) 192 198 return;