From patchwork Tue Feb 10 16:18:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 438453 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 18D2B140082 for ; Wed, 11 Feb 2015 03:18:14 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751654AbbBJQSI (ORCPT ); Tue, 10 Feb 2015 11:18:08 -0500 Received: from mail-pa0-f41.google.com ([209.85.220.41]:61716 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750738AbbBJQSH (ORCPT ); Tue, 10 Feb 2015 11:18:07 -0500 Received: by mail-pa0-f41.google.com with SMTP id kx10so17973099pab.0 for ; Tue, 10 Feb 2015 08:18:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :content-type:mime-version:content-transfer-encoding; bh=lj0L9gxmu54ydBvDMrRRu9UyqRvAqaxQ9IacyCj1tf8=; b=wZsMtKMtkBh/LpuH+S17GFyDt9n3t0EdHAqjnbfHN1HqrCXNiJmeDV0qknnaJJWnZo NjJi4X+tRAhVvIkE+yR6F59+Ykt64RPqeVPRd9JUsxxGSenwcbifMYjMe6cA7Vw4Jv4f RhLLMpQK1I615zXpHyF6b35LZWUDeVCXofI/xK9eXz/1Y6/8Py1AAaJUpvMOs5hcP+X9 UwHltz19gBe85d48Zd+u3SPXTfADKGiFo7hXuCEILyyLXtQkYnugn1N/F9peTn7Yg3Og DWWMnWbbMFGLERFGnAm9bw6yIGCBRy1qj7Hj0OKfqFArlJKwz6oohZYmnMsvEfbQYB7L C7Ew== X-Received: by 10.68.191.2 with SMTP id gu2mr5234913pbc.149.1423585087029; Tue, 10 Feb 2015 08:18:07 -0800 (PST) Received: from [172.19.250.194] ([172.19.250.194]) by mx.google.com with ESMTPSA id pm2sm19745154pbb.81.2015.02.10.08.18.05 (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Tue, 10 Feb 2015 08:18:06 -0800 (PST) Message-ID: <1423585083.28434.31.camel@edumazet-glaptop2.roam.corp.google.com> Subject: Re: Kernel sends ICMP unreachable for GRE packets even if there is a listening socket From: Eric Dumazet To: "Steinar H. Gunderson" Cc: netdev@vger.kernel.org Date: Tue, 10 Feb 2015 08:18:03 -0800 In-Reply-To: <1423584596.28434.30.camel@edumazet-glaptop2.roam.corp.google.com> References: <20150210152410.GA9225@sesse.net> <1423584596.28434.30.camel@edumazet-glaptop2.roam.corp.google.com> X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, 2015-02-10 at 08:09 -0800, Eric Dumazet wrote: > On Tue, 2015-02-10 at 16:24 +0100, Steinar H. Gunderson wrote: > > [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. > > Thats because you loaded ip6_gre maybe ? Not clear why we even bother sending ICMP in ipv6, while we do nothing in ipv4 similar case --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index bc28b7d42a6dab05abee80d4fa84c102d92ca91f..8ff364b93bc2909253a6a0ef7268fc2dfb92c77c 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c @@ -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);