diff options
author | suz <suz@FreeBSD.org> | 2005-10-19 17:18:49 +0000 |
---|---|---|
committer | suz <suz@FreeBSD.org> | 2005-10-19 17:18:49 +0000 |
commit | 69d53f996712bcf25b15d22d498614a1d971b355 (patch) | |
tree | a679457015bf75c1caaf0c1d01ab3aef5adb65fb /sys/netinet6 | |
parent | 412574c368a6010d6db88d9a3d0275ae74a2047e (diff) | |
download | FreeBSD-src-69d53f996712bcf25b15d22d498614a1d971b355.zip FreeBSD-src-69d53f996712bcf25b15d22d498614a1d971b355.tar.gz |
sync with KAME (nuked unused code, use NULL to denote a NULL pointer)
Obtained from: KAME
Reviewed by: ume, gnn
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/nd6.c | 15 | ||||
-rw-r--r-- | sys/netinet6/nd6_nbr.c | 14 | ||||
-rw-r--r-- | sys/netinet6/nd6_rtr.c | 43 |
3 files changed, 7 insertions, 65 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 93186a5..eaa3319 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1182,15 +1182,6 @@ nd6_rtrequest(req, rt, info) * (or should we allow proxy ND configuration only for * routers? there's no mention about proxy ND from hosts) */ -#if 0 - /* XXX it does not work */ - if (rt->rt_flags & RTF_ANNOUNCE) - nd6_na_output(ifp, - &SIN6(rt_key(rt))->sin6_addr, - &SIN6(rt_key(rt))->sin6_addr, - ip6_forwarding ? ND_NA_FLAG_ROUTER : 0, - 1, NULL); -#endif /* FALLTHROUGH */ case RTM_RESOLVE: if ((ifp->if_flags & (IFF_POINTOPOINT | IFF_LOOPBACK)) == 0) { @@ -1609,12 +1600,6 @@ nd6_cache_lladdr(ifp, from, lladdr, lladdrlen, type, code) rt = nd6_lookup(from, 0, ifp); if (rt == NULL) { -#if 0 - /* nothing must be done if there's no lladdr */ - if (!lladdr || !lladdrlen) - return NULL; -#endif - rt = nd6_lookup(from, 1, ifp); is_newentry = 1; } else { diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c index 8a97f6e..dc1de4e 100644 --- a/sys/netinet6/nd6_nbr.c +++ b/sys/netinet6/nd6_nbr.c @@ -183,12 +183,6 @@ nd6_ns_input(m, off, icmp6len) * In implementation, we add target link-layer address by default. * We do not add one in MUST NOT cases. */ -#if 0 /* too much! */ - ifa = (struct ifaddr *)in6ifa_ifpwithaddr(ifp, &daddr6); - if (ifa && (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_ANYCAST)) - tlladdr = 0; - else -#endif if (!IN6_IS_ADDR_MULTICAST(&daddr6)) tlladdr = 0; else @@ -238,7 +232,7 @@ nd6_ns_input(m, off, icmp6len) } } } - if (!ifa) { + if (ifa == NULL) { /* * We've got an NS packet, and we don't have that adddress * assigned for us. We MUST silently ignore it. @@ -1383,15 +1377,9 @@ nd6_dad_ns_output(dp, ifa) dp->dad_ns_tcount++; if ((ifp->if_flags & IFF_UP) == 0) { -#if 0 - printf("%s: interface down?\n", if_name(ifp)); -#endif return; } if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { -#if 0 - printf("%s: interface not running?\n", if_name(ifp)); -#endif return; } diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index ccdbf29..d9efa71 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -116,12 +116,6 @@ nd6_rs_input(m, off, icmp6len) struct in6_addr saddr6 = ip6->ip6_src; char *lladdr = NULL; int lladdrlen = 0; -#if 0 - struct sockaddr_dl *sdl = (struct sockaddr_dl *)NULL; - struct llinfo_nd6 *ln = (struct llinfo_nd6 *)NULL; - struct rtentry *rt = NULL; - int is_newentry; -#endif union nd_opts ndopts; /* If I'm not a router, ignore it. */ @@ -206,12 +200,6 @@ nd6_ra_input(m, off, icmp6len) struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); struct nd_router_advert *nd_ra; struct in6_addr saddr6 = ip6->ip6_src; -#if 0 - struct in6_addr daddr6 = ip6->ip6_dst; - int flags; /* = nd_ra->nd_ra_flags_reserved; */ - int is_managed = ((flags & ND_RA_FLAG_MANAGED) != 0); - int is_other = ((flags & ND_RA_FLAG_OTHER) != 0); -#endif union nd_opts ndopts; struct nd_defrouter *dr; @@ -863,14 +851,12 @@ prelist_remove(pr) /* make sure to invalidate the prefix until it is really freed. */ pr->ndpr_vltime = 0; pr->ndpr_pltime = 0; -#if 0 /* * Though these flags are now meaningless, we'd rather keep the value - * not to confuse users when executing "ndp -p". + * of pr->ndpr_raf_onlink and pr->ndpr_raf_auto not to confuse users + * when executing "ndp -p". */ - pr->ndpr_raf_onlink = 0; - pr->ndpr_raf_auto = 0; -#endif + if ((pr->ndpr_stateflags & NDPRF_ONLINK) != 0 && (e = nd6_prefix_offlink(pr)) != 0) { nd6log((LOG_ERR, "prelist_remove: failed to make %s/%d offlink " @@ -1084,16 +1070,7 @@ prelist_update(new, dr, m) if (TWOHOUR < new->ndpr_vltime || storedlifetime < new->ndpr_vltime) { lt6_tmp.ia6t_vltime = new->ndpr_vltime; - } else if (storedlifetime <= TWOHOUR -#if 0 - /* - * This condition is logically redundant, so we just - * omit it. - * See IPng 6712, 6717, and 6721. - */ - && new->ndpr_vltime <= storedlifetime -#endif - ) { + } else if (storedlifetime <= TWOHOUR) { if (auth) { lt6_tmp.ia6t_vltime = new->ndpr_vltime; } @@ -1300,7 +1277,7 @@ pfxlist_onlink_check() if ((e = nd6_prefix_offlink(pr)) != 0) { nd6log((LOG_ERR, "pfxlist_onlink_check: failed to " - "make %s/%d onlink, errno=%d\n", + "make %s/%d offlink, errno=%d\n", ip6_sprintf(&pr->ndpr_prefix.sin6_addr), pr->ndpr_plen, e)); } @@ -1311,7 +1288,7 @@ pfxlist_onlink_check() if ((e = nd6_prefix_onlink(pr)) != 0) { nd6log((LOG_ERR, "pfxlist_onlink_check: failed to " - "make %s/%d offlink, errno=%d\n", + "make %s/%d onlink, errno=%d\n", ip6_sprintf(&pr->ndpr_prefix.sin6_addr), pr->ndpr_plen, e)); } @@ -1607,14 +1584,6 @@ in6_ifadd(pr, ifid) else return NULL; -#if 0 /* don't care link local addr state, and always do DAD */ - /* if link-local address is not eligible, do not autoconfigure. */ - if (((struct in6_ifaddr *)ifa)->ia6_flags & IN6_IFF_NOTREADY) { - printf("in6_ifadd: link-local address not ready\n"); - return NULL; - } -#endif - /* prefixlen + ifidlen must be equal to 128 */ plen0 = in6_mask2len(&ib->ia_prefixmask.sin6_addr, NULL); if (prefixlen != plen0) { |