From: "YOSHIFUJI Hideaki / 吉藤英明" <yoshfuji@linux-ipv6.org>
To: davem@redhat.com, jgarzik@pobox.com
Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org,
yoshfuji@linux-ipv6.org
Subject: Re: IPv6 oops on ifup in latest BK
Date: Tue, 24 Aug 2004 17:22:07 +0900 (JST) [thread overview]
Message-ID: <20040824.172207.109934952.yoshfuji@linux-ipv6.org> (raw)
In-Reply-To: <20040823235123.71f18c04.davem@redhat.com>
In article <20040823235123.71f18c04.davem@redhat.com> (at Mon, 23 Aug 2004 23:51:23 -0700), "David S. Miller" <davem@redhat.com> says:
> > Attached minicom.cap.txt gives the ksymoops output and dmesg output.
> > Appears to die in ipv6_get_hoplimit.
>
> Yoshifuji-san, it is rt6i_dev changes. The problem is that
> ipv6_get_hoplimit() gets called with NULL dev.
:
> It is this piece of code in ip6_route_add():
>
> if (dev && dev != &loopback_dev) {
>
> It does not handle the case where dev == NULL correctly.
> Original code did do the right thing:
>
> if (dev)
> dev_put(dev);
> dev = &loopback_dev;
> dev_hold(dev);
Good catch and spotting. Please try this patch.
Thank you.
===== net/ipv6/route.c 1.88 vs edited =====
--- 1.88/net/ipv6/route.c 2004-08-17 11:25:06 +09:00
+++ edited/net/ipv6/route.c 2004-08-24 17:09:10 +09:00
@@ -820,9 +820,12 @@
*/
if ((rtmsg->rtmsg_flags&RTF_REJECT) ||
(dev && (dev->flags&IFF_LOOPBACK) && !(addr_type&IPV6_ADDR_LOOPBACK))) {
- if (dev && dev != &loopback_dev) {
- dev_put(dev);
- in6_dev_put(idev);
+ /* hold loopback dev/idev if we haven't done so. */
+ if (dev != &loopback_dev) {
+ if (dev) {
+ dev_put(dev);
+ in6_dev_put(idev);
+ }
dev = &loopback_dev;
dev_hold(dev);
idev = in6_dev_get(dev);
--
Hideaki YOSHIFUJI @ USAGI Project <yoshfuji@linux-ipv6.org>
GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA
next prev parent reply other threads:[~2004-08-24 8:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-24 6:07 Jeff Garzik
2004-08-24 6:51 ` David S. Miller
2004-08-24 7:33 ` Herbert Xu
2004-08-24 8:22 ` YOSHIFUJI Hideaki / 吉藤英明 [this message]
2004-08-24 18:36 ` David S. Miller
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=20040824.172207.109934952.yoshfuji@linux-ipv6.org \
--to=yoshfuji@linux-ipv6.org \
--cc=davem@redhat.com \
--cc=jgarzik@pobox.com \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®