jhujhiti_adjectivism.org added inline comments.

INLINE COMMENTS

> asomers wrote in nd6.c:1295
> Yep, it's true.  One way is to do it with static routes.  Another way 
> involves changing the interfaces's fib.  For example, like this:
> 
>   ifconfig tap0 create
>   ifconfig tap0 10.1.0.1/24 fib 2
>   ifconfig tap0 10.1.1.1/24 fib 3 alias

That's... counter-intuitive. But given that behavior, we absolutely should 
check other other FIBs here. The function is already looping over all prefixes 
on the interface so I inserted a check of all FIBs (if necessary) inside of it.

> asomers wrote in nd6.c:1353
> The original code seems too complicated.  I think it should go a little like 
> this (locks elided):
> 
>   if (ifp->if_flags & IFF_POINTOPOINT) {
>           TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
>                       if (ifa->ifa_addr->sa_family != addr->sa_family)
>                               continue;
>                       if (ifa->ifa_dstaddr != NULL &&
>                           sa_equal(addr, ifa->ifa_dstaddr)) {
>                               return (1);
>                       }
>               }
>   }
> 
> No unnecessary looping over either fibs or interfaces.

This seems like a good idea. Is this new code what you had in mind?

> nd6_rtr.c:574
>           (struct sockaddr *)&gate,
> -         (struct sockaddr *)&mask, RTF_GATEWAY, &oldrt, RT_DEFAULT_FIB);
> +         (struct sockaddr *)&mask, RTF_GATEWAY, &oldrt, dr->ifp->if_fib);
>       if (oldrt) {

I'm now wondering if this is incorrect. If the interface's FIB changes after 
the router has been added to the list, we would fail to remove it here.

Should the default router (and maybe prefix) structs include a new field to 
store the FIB in which the router(/prefix) was originally learned?

REPOSITORY
  rS FreeBSD src repository

REVISION DETAIL
  https://reviews.freebsd.org/D9451

EMAIL PREFERENCES
  https://reviews.freebsd.org/settings/panel/emailpreferences/

To: jhujhiti_adjectivism.org, #network, bz, asomers
Cc: jch, bz, imp, ae, freebsd-net-list
_______________________________________________
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"

Reply via email to