public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: "Steinar H. Gunderson" <sgunderson@bigfoot.com>
To: netdev@vger.kernel.org
Subject: Kernel sends ICMP unreachable for GRE packets even if there is a listening socket
Date: Tue, 10 Feb 2015 16:24:10 +0100	[thread overview]
Message-ID: <20150210152410.GA9225@sesse.net> (raw)

[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 */
-- 
Homepage: http://www.sesse.net/

             reply	other threads:[~2015-02-10 15:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-10 15:24 Steinar H. Gunderson [this message]
2015-02-10 16:09 ` Kernel sends ICMP unreachable for GRE packets even if there is a listening socket Eric Dumazet
2015-02-10 16:16   ` Steinar H. Gunderson
2015-02-10 16:18   ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150210152410.GA9225@sesse.net \
    --to=sgunderson@bigfoot.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox