netdev
[Top] [All Lists]

Re: IPv6 oops on ifup in latest BK

To: davem@xxxxxxxxxx (David S. Miller)
Subject: Re: IPv6 oops on ifup in latest BK
From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 24 Aug 2004 17:33:54 +1000
Cc: jgarzik@xxxxxxxxx, yoshfuji@xxxxxxxxxxxxxx, netdev@xxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
In-reply-to: <20040823235123.71f18c04.davem@redhat.com>
Organization: Core
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: tin/1.7.4-20040225 ("Benbecula") (UNIX) (Linux/2.4.26-1-686-smp (i686))
David S. Miller <davem@xxxxxxxxxx> wrote:
> 
> Maybe new code should be something like:
> 
>                if (dev && dev != &loopback_dev) {

You want
                 if (dev) {
here.

>                        dev_put(dev);
>                        in6_dev_put(idev);
>                }
>                dev = &loopback_dev;
>                dev_hold(dev);
>                idev = in6_dev_get(dev);
>                if (!idev) {
>                        err = -ENODEV;
>                        goto out;
>                }
> 
> What do you think?

Yes this would work.  But I think Yoshifuji-san is trying to avoid the
unnecessary put/get in the case where dev is already loopback_dev.
So something like this might work:

                if (dev != &loopback_dev) {
                        if (dev) {
                                dev_put(dev);
                                in6_dev_put(idev);
                        }
                        ...
                }
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

<Prev in Thread] Current Thread [Next in Thread>