On Tue, 2005-22-11 at 10:29 -0800, Brian Pomerantz wrote: > On Tue, Nov 22, 2005 at 08:01:07AM -0500, jamal wrote: > > > > Ok, here it is with the change to check the sysctl once. > > > > Brian, can you retest on your side - my basic tests pass. > > If it passes, just respond with an acked-by comment. > > > > Dave, if (ACK from Brian && no further comments) please apply > > Also, same comment applies as before; this is a bug fix and you may > > wanna consider it as 2.6.15 material. > > > > cheers, > > jamal > > > > > > Okay, looks good for me. It passes the battery of tests I've been > throwing at it. > > > BAPper > > > ---------------------------------------------------------- > > This patch fixes the problem with promoting aliases when: > a) a single primary and > 1 secondary addresses > b) multiple primary addresses each with at least one secondary address > > Based on earlier efforts from Brian Pomerantz <[EMAIL PROTECTED]>, > Patrick McHardy <[EMAIL PROTECTED]> and Thomas Graf <[EMAIL PROTECTED]> > > Signed-off-by: Jamal Hadi Salim <[EMAIL PROTECTED]> > Signed-off-by: Brian Pomerantz <[EMAIL PROTECTED]> > --- > > include/net/route.h | 3 +++ > net/ipv4/devinet.c | 40 ++++++++++++++++++++++++++++++---------- > net/ipv4/fib_frontend.c | 2 +- > 3 files changed, 34 insertions(+), 11 deletions(-) > > diff --git a/include/net/route.h b/include/net/route.h > index dbe79ca..e3e5436 100644 > --- a/include/net/route.h > +++ b/include/net/route.h > @@ -126,6 +126,9 @@ extern int ip_rt_ioctl(unsigned int cmd > extern void ip_rt_get_source(u8 *src, struct rtable *rt); > extern int ip_rt_dump(struct sk_buff *skb, struct > netlink_callback *cb); > > +struct in_ifaddr; > +extern void fib_add_ifaddr(struct in_ifaddr *); > + > static inline void ip_rt_put(struct rtable * rt) > { > if (rt) > diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c > index 4ec4b2c..04a6fe3 100644 > --- a/net/ipv4/devinet.c > +++ b/net/ipv4/devinet.c > @@ -234,7 +234,10 @@ static void inet_del_ifa(struct in_devic > int destroy) > { > struct in_ifaddr *promote = NULL; > - struct in_ifaddr *ifa1 = *ifap; > + struct in_ifaddr *ifa, *ifa1 = *ifap; > + struct in_ifaddr *last_prim = in_dev->ifa_list; > + struct in_ifaddr *prev_prom = NULL; > + int do_promote = IN_DEV_PROMOTE_SECONDARIES(in_dev); > > ASSERT_RTNL(); > > @@ -243,18 +246,22 @@ static void inet_del_ifa(struct in_devic > **/ > > if (!(ifa1->ifa_flags & IFA_F_SECONDARY)) { > - struct in_ifaddr *ifa; > struct in_ifaddr **ifap1 = &ifa1->ifa_next; > > while ((ifa = *ifap1) != NULL) { > + if (!do_promote && > + ifa1->ifa_scope <= ifa->ifa_scope) > + last_prim = ifa; > +
Hrm - this was not in the patch i posted. Are you sure this passed the test? What the above does is say we are going to record the last primary only if we are _not_ doing promotion. The reverse of what i would expect. cheers, jamal - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html