Kernel sends ICMP unreachable for GRE packets even if there is a listening socket
Subsystems (3)
[Resent from Bugzilla]
Hi,
I have a userspace GRE listener, which opens a raw socket (error handling removed):
int gresock = socket(AF_INET6, SOCK_RAW, IPPROTO_GRE);
bind(gresock, (sockaddr *)&my_addr, sizeof(my_addr));and then select()s and recvfrom()s on it, as well as sendto().
This works great. I can send and receive GRE packets. However, Linux _also_ sends ICMPv6 unreachables when the other end sends to me. I assume this is because I don't have a corresponding kernel GRE tunnel interface. (I don't use the kernel GRE because I want, among others, stronger reordering functionality and possibly error correction, which is not in any standard.)
Can this be suppressed when I have such a socket giong? ip6tables -A OUTPUT can stop them, but it seems very hacky and kludgy.
/* Steinar */
Signature · 1 line
Homepage: http://www.sesse.net/
Quoted 11 lines · Steinar H. Gunderson
[Resent from Bugzilla]
Hi,
I have a userspace GRE listener, which opens a raw socket (error handling removed):
int gresock = socket(AF_INET6, SOCK_RAW, IPPROTO_GRE); bind(gresock, (sockaddr *)&my_addr, sizeof(my_addr));and then select()s and recvfrom()s on it, as well as
sendto().
Quoted 8 lines
This works great. I can send and receive GRE packets. However, Linux _also_ sends ICMPv6 unreachables when the other end sends to me. I assume this is because I don't have a corresponding kernel GRE tunnel interface. (I don't use the kernel GRE because I want, among others, stronger reordering functionality and possibly error correction, which is not in any standard.)
Can this be suppressed when I have such a socket giong? ip6tables -A OUTPUT can stop them, but it seems very hacky and kludgy.
Thats because you loaded ip6_gre maybe ?
Quoted 3 lines · Eric Dumazet
Quoted 2 lines
Can this be suppressed when I have such a socket giong? ip6tables -A OUTPUT can stop them, but it seems very hacky and kludgy.
Thats because you loaded
ip6_gremaybe ?
I have loaded ip6_gre, yes. But I might need the kernel variant for other tunnels, so unloading it is a suboptimal workaround.
/* Steinar */
Signature · 1 line
Homepage: http://www.sesse.net/
Quoted 18 lines · Eric Dumazet
Quoted 17 lines · Steinar H. Gunderson
[Resent from Bugzilla]
Hi,
I have a userspace GRE listener, which opens a raw socket (error handling removed):
int gresock = socket(AF_INET6, SOCK_RAW, IPPROTO_GRE); bind(gresock, (sockaddr *)&my_addr, sizeof(my_addr));and then select()s and recvfrom()s on it, as well as
sendto().This works great. I can send and receive GRE packets. However, Linux _also_ sends ICMPv6 unreachables when the other end sends to me. I assume this is because I don't have a corresponding kernel GRE tunnel interface. (I don't use the kernel GRE because I want, among others, stronger reordering functionality and possibly error correction, which is not in any standard.)
Quoted 4 lines
Quoted 2 lines
Can this be suppressed when I have such a socket giong? ip6tables -A OUTPUT can stop them, but it seems very hacky and kludgy.
Thats because you loaded
ip6_gremaybe ?
Not clear why we even bother sending ICMP in ipv6, while we do nothing in ipv4 similar case
net/ipv6/ip6_gre.c +0 -1
@@ -572,7 +572,6 @@ static int ip6gre_rcv(struct sk_buff *skb)return 0 ; } -icmpv6_send (skb,ICMPV6_DEST_UNREACH ,ICMPV6_PORT_UNREACH ,0 ); drop:kfree_skb (skb);