[Top] [All Lists]

Re: fib/netdev cleanup

To: "James R. Leu" <jleu@xxxxxxxxxxxxxx>
Subject: Re: fib/netdev cleanup
From: Julian Anastasov <ja@xxxxxx>
Date: Wed, 19 Dec 2001 13:22:08 +0200 (EET)
Cc: <kuznet@xxxxxxxxxxxxx>, <netdev@xxxxxxxxxxx>, <davem@xxxxxxxxxx>
In-reply-to: <20011218180525.D26734@xxxxxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx

On Tue, 18 Dec 2001, James R. Leu wrote:

> I think there needs to be a way for an IP interface to remember
> that it has an "addressless" address attached to it.  To me if I do:

        route without prefsrc from this device ...

> ifconfig eth1 up
> ip addr add brd + dev eth1
> Then I should have to do:
> ip addr del brd + dev eth1
> ip addr del dev eth1

        Hm, good idea. I forgot about inet_del_ifa and its flag
destroy. I see that inet_insert_ifa has check for Can
we add similar check in the deletion path, i.e. only del to
call inetdev_destroy. All other inet_del_ifa should not call
inetdev_destroy. The del event should be propagated
somehow. ifconfig dev will not work (only enable) but
ip addr del works in this scheme. It will delete all present
addresses and routes. We will have symmetry when enabling and
disabling IP for interface.

        What I don't know is who really relies on the fact that
the last address stops IP. In fact, the no_addr check in
fib_validate_source is enough to stop any incoming IP traffic
from device without addresses and routes. So, may be we have to
check the sending path, whether we break some expectations.

        Another thing: may be we can teach fib_sync_down to
release ifa_local, i.e. all routes without prefsrc
when the last address is deleted, instead of disabling IP
but it is not very good. If the above way to stop IP
for interface works then fib_inetaddr_event simply will
call the evil 'fib_disable_ip(ifa->ifa_dev->dev, 1);' only
when someone deletes (we will have to check
ifa->ifa_dev->dev->ip_ptr to know when IP is deleted or to
do it for ifa_local And of course, on NETDEV_UNREGISTER.

        So, may be we can find a way to officially enable and
disable IP? If such idea sounds good I can go further and to try it.

> (or some equivalent)
> Before IP is completly removed from the interface.
> I'll go back to lurking now.
> Jim


Julian Anastasov <ja@xxxxxx>

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