Re: 2.6.7-rc3: unregister_netdevice: waiting for tun0 to become free. Usage count = 1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David S. Miller <davem@redhat.com> wrote:
>
> diff -Nru a/net/core/dst.c b/net/core/dst.c
> --- a/net/core/dst.c    2004-06-13 06:04:49 -07:00
> +++ b/net/core/dst.c    2004-06-13 06:04:49 -07:00
> @@ -230,8 +230,8 @@
>                                if (event!=NETDEV_DOWN &&
>                                    dst->output == dst_discard_out) {

This is a historical question.  What's the dst->output check for?

>                                        dst->dev = &loopback_dev;
> -                                       dev_put(dev);
>                                        dev_hold(&loopback_dev);
> +                                       dev_put(dev);
>                                        dst->output = dst_discard_out;
>                                        if (dst->neighbour && dst->neighbour->dev == dev) {
>                                                dst->neighbour->dev = &loopback_dev;
> @@ -242,6 +242,8 @@
>                                        dst->input = dst_discard_in;
>                                        dst->output = dst_discard_out;
>                                }

The loopback_dev stuff takes care of the case when someone is still
holding onto the dst.  How come we don't have similar code in ifdown?

> +                               if (dst->ops->ifdown)
> +                                       dst->ops->ifdown(dst, event != NETDEV_DOWN);

What's the rationale for doing this for both UNREGISTER and DOWN?

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux