Incorrect ipv6 prefix detaching behavior?

Shekhar Chandrashekhar gcshekhar at sbcglobal.net
Fri Jul 4 03:27:18 UTC 2008


I'm running into an issue where nd6_rtr.c:pfxlist_onlink_check() is possibly not doing the right thing by marking a prefix as not ONLINK - I've noticed this behavior in both FreeBSD 6 and 7.

I have an interface (say fxp0) which has an router-advertised address for access outside the local subnet (fc00:10:1:2::/64 prefix) and a static address (fc00:10:1:1::/64) for connecting to servers on the same subnet.

The def router only advertises the fc00:10:1:2:: prefix.

However, as you see from the "flags=LD" below, freebsd seems to mark the fc00:10:1:1::/64 prefix as detached and always forwards to the def router even for a dest in the fc00:10:1:1:: subnet.

# ndp -p   ;# abbreviated for interesting prefixes
fc00:10:1:2::/64 if=fxp0
flags=LAO vltime=2592000, pltime-604800, expire=29d23h59m50s, ref=1
  advertised by
     fe80::214:f604:65f0:93f0%fxp0 (reachable)
fc00:10:1:1::/64 if=fxp0
flags=LD vltime=0, pltime=0, expired, ref=1
  No advertising router

The code in question (around line 1396 of n6_rtr.c) seems to mark any non-advertised prefix as detached - the comment in front of this segment (around line 1376) indicates this is done to take care of a move to a different network:

                        if ((pr->ndpr_stateflags & NDPRF_DETACHED) == 0 &&
                            find_pfxlist_reachable_router(pr) == NULL)
--->                            pr->ndpr_stateflags |= NDPRF_DETACHED;

If this is still the current thinking, it looks like my usage scenario is incorrect and I would like to understand why that is so. And what is the workaround? If not and this is a bug, then would suggest a addition to the code to allow only "non-static" prefixes to be detached...

                        if ((pr->ndpr_stateflags & NDPRF_DETACHED) == 0 &&
                            find_pfxlist_reachable_router(pr) == NULL && pr->ndpr_pltime != ND6_INFINITE_LIFETIME)
                                pr->ndpr_stateflags |= NDPRF_DETACHED;


Thanks in advance for your help,
--shekhar 
-------------------------------------------------------------------------------------------------
(gcshekhar AT sbc NOSPACE global DOT net)
Confidence is the feeling you have before you understand the situation



More information about the freebsd-net mailing list