netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@redhat.com>
To: "David S. Miller" <davem@redhat.com>
Cc: dwmw2@redhat.com, netdev@oss.sgi.com
Subject: Re: Missing routes cause BUG() in icmpv6_xmit_lock().
Date: Mon, 1 Sep 2003 01:30:20 -0700	[thread overview]
Message-ID: <20030901013020.189fe564.davem@redhat.com> (raw)
In-Reply-To: <20030831224454.349a6a53.davem@redhat.com>

On Sun, 31 Aug 2003 22:44:54 -0700
"David S. Miller" <davem@redhat.com> wrote:

> I'll see what I can do about this one.

Ok, here is the fix I'm going to use.  I actually inadvertantly
added this problem when I converted net/ipv6/icmp.c over to
per-cpu sockets.

There is nothing we could do with such ICMP destination unreachable
packets anyways, so dropping them is the right thing to do.

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1614  -> 1.1615 
#	     net/ipv6/icmp.c	1.26    -> 1.27   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/09/01	davem@nuts.ninka.net	1.1615
# [IPV6]: Do not BUG() on icmp6 socket contention, just drop.
# --------------------------------------------
#
diff -Nru a/net/ipv6/icmp.c b/net/ipv6/icmp.c
--- a/net/ipv6/icmp.c	Mon Sep  1 01:36:39 2003
+++ b/net/ipv6/icmp.c	Mon Sep  1 01:36:39 2003
@@ -95,8 +95,15 @@
 static void icmpv6_xmit_lock(void)
 {
 	local_bh_disable();
-	if (unlikely(!spin_trylock(&icmpv6_socket->sk->lock.slock)))
-		BUG();
+	if (unlikely(!spin_trylock(&icmpv6_socket->sk->lock.slock))) {
+		/* This can happen if the output path (f.e. SIT or
+		 * ip6ip6 tunnel) signals dst_link_failure() for an
+		 * outgoing ICMP6 packet.
+		 */
+		local_bh_enable();
+		return 1;
+	}
+	return 0;
 }
 
 static void icmpv6_xmit_unlock(void)
@@ -340,7 +347,8 @@
 	fl.fl_icmp_type = type;
 	fl.fl_icmp_code = code;
 
-	icmpv6_xmit_lock();
+	if (icmpv6_xmit_lock())
+		return;
 
 	if (!icmpv6_xrlim_allow(sk, type, &fl))
 		goto out;
@@ -423,7 +431,8 @@
 	fl.oif = skb->dev->ifindex;
 	fl.fl_icmp_type = ICMPV6_ECHO_REPLY;
 
-	icmpv6_xmit_lock();
+	if (icmpv6_xmit_lock())
+		return;
 
 	if (!fl.oif && ipv6_addr_is_multicast(&fl.fl6_dst))
 		fl.oif = np->mcast_oif;

  reply	other threads:[~2003-09-01  8:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-31 14:56 Missing routes cause BUG() in icmpv6_xmit_lock() David Woodhouse
2003-09-01  5:44 ` David S. Miller
2003-09-01  8:30   ` David S. Miller [this message]
2003-09-01  9:58     ` David Woodhouse

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=20030901013020.189fe564.davem@redhat.com \
    --to=davem@redhat.com \
    --cc=dwmw2@redhat.com \
    --cc=netdev@oss.sgi.com \
    /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;
as well as URLs for NNTP newsgroup(s).