MCPcopy Create free account
hub / github.com/F-Stack/f-stack / nd6_setdefaultiface

Function nd6_setdefaultiface

freebsd/netinet6/nd6_rtr.c:2424–2450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2422}
2423
2424int
2425nd6_setdefaultiface(int ifindex)
2426{
2427 int error = 0;
2428
2429 if (ifindex < 0 || V_if_index < ifindex)
2430 return (EINVAL);
2431 if (ifindex != 0 && !ifnet_byindex(ifindex))
2432 return (EINVAL);
2433
2434 if (V_nd6_defifindex != ifindex) {
2435 V_nd6_defifindex = ifindex;
2436 if (V_nd6_defifindex > 0)
2437 V_nd6_defifp = ifnet_byindex(V_nd6_defifindex);
2438 else
2439 V_nd6_defifp = NULL;
2440
2441 /*
2442 * Our current implementation assumes one-to-one maping between
2443 * interfaces and links, so it would be natural to use the
2444 * default interface as the default link.
2445 */
2446 scope6_setdefault(V_nd6_defifp);
2447 }
2448
2449 return (error);
2450}
2451
2452bool
2453nd6_defrouter_list_empty(void)

Callers 2

nd6_purgeFunction · 0.85
nd6_ioctlFunction · 0.85

Calls 2

ifnet_byindexFunction · 0.85
scope6_setdefaultFunction · 0.85

Tested by

no test coverage detected