Author: melifaro
Date: Tue Sep 22 20:45:04 2015
New Revision: 288129
URL: https://svnweb.freebsd.org/changeset/base/288129

Log:
  Use standard lle LLE_EXCLUSIVE request flags instead of
    its redefined version.

Modified:
  head/sys/netinet6/nd6.c
  head/sys/netinet6/nd6.h

Modified: head/sys/netinet6/nd6.c
==============================================================================
--- head/sys/netinet6/nd6.c     Tue Sep 22 20:42:14 2015        (r288128)
+++ head/sys/netinet6/nd6.c     Tue Sep 22 20:45:04 2015        (r288129)
@@ -991,7 +991,6 @@ nd6_lookup(const struct in6_addr *addr6,
 {
        struct sockaddr_in6 sin6;
        struct llentry *ln;
-       int llflags;
        
        bzero(&sin6, sizeof(sin6));
        sin6.sin6_len = sizeof(struct sockaddr_in6);
@@ -1000,8 +999,7 @@ nd6_lookup(const struct in6_addr *addr6,
 
        IF_AFDATA_LOCK_ASSERT(ifp);
 
-       llflags = (flags & ND6_EXCLUSIVE) ? LLE_EXCLUSIVE : 0;
-       ln = lla_lookup(LLTABLE6(ifp), llflags, (struct sockaddr *)&sin6);
+       ln = lla_lookup(LLTABLE6(ifp), flags, (struct sockaddr *)&sin6);
 
        return (ln);
 }
@@ -1331,7 +1329,7 @@ nd6_nud_hint(struct rtentry *rt, struct 
 
        ifp = rt->rt_ifp;
        IF_AFDATA_RLOCK(ifp);
-       ln = nd6_lookup(dst6, ND6_EXCLUSIVE, NULL);
+       ln = nd6_lookup(dst6, LLE_EXCLUSIVE, NULL);
        IF_AFDATA_RUNLOCK(ifp);
        if (ln == NULL)
                return;
@@ -1741,13 +1739,13 @@ nd6_cache_lladdr(struct ifnet *ifp, stru
         * Spec says nothing in sections for RA, RS and NA.  There's small
         * description on it in NS section (RFC 2461 7.2.3).
         */
-       flags = lladdr ? ND6_EXCLUSIVE : 0;
+       flags = lladdr ? LLE_EXCLUSIVE : 0;
        IF_AFDATA_RLOCK(ifp);
        ln = nd6_lookup(from, flags, ifp);
        IF_AFDATA_RUNLOCK(ifp);
        is_newentry = 0;
        if (ln == NULL) {
-               flags |= ND6_EXCLUSIVE;
+               flags |= LLE_EXCLUSIVE;
                ln = nd6_alloc(from, 0, ifp);
                if (ln == NULL)
                        return;
@@ -1763,7 +1761,7 @@ nd6_cache_lladdr(struct ifnet *ifp, stru
                IF_AFDATA_WLOCK(ifp);
                LLE_WLOCK(ln);
                /* Prefer any existing lle over newly-created one */
-               ln_tmp = nd6_lookup(from, ND6_EXCLUSIVE, ifp);
+               ln_tmp = nd6_lookup(from, LLE_EXCLUSIVE, ifp);
                if (ln_tmp == NULL)
                        lltable_link_entry(LLTABLE6(ifp), ln);
                IF_AFDATA_WUNLOCK(ifp);
@@ -1779,7 +1777,7 @@ nd6_cache_lladdr(struct ifnet *ifp, stru
        } 
        /* do nothing if static ndp is set */
        if ((ln->la_flags & LLE_STATIC)) {
-               if (flags & ND6_EXCLUSIVE)
+               if (flags & LLE_EXCLUSIVE)
                        LLE_WUNLOCK(ln);
                else
                        LLE_RUNLOCK(ln);
@@ -1836,7 +1834,7 @@ nd6_cache_lladdr(struct ifnet *ifp, stru
        if ((type & 0xFF) == ND_REDIRECT && code != ND_REDIRECT_ROUTER)
                ln->la_flags |= LLE_REDIRECT;
 
-       if (flags & ND6_EXCLUSIVE)
+       if (flags & LLE_EXCLUSIVE)
                LLE_WUNLOCK(ln);
        else
                LLE_RUNLOCK(ln);
@@ -2053,7 +2051,7 @@ nd6_resolve(struct ifnet *ifp, int is_gw
  *
  * Heavy version.
  * Function assume that destination LLE does not exist,
- * is invalid or stale, so ND6_EXCLUSIVE lock needs to be acquired.
+ * is invalid or stale, so LLE_EXCLUSIVE lock needs to be acquired.
  */
 static int
 nd6_resolve_slow(struct ifnet *ifp, struct mbuf *m,
@@ -2071,7 +2069,7 @@ nd6_resolve_slow(struct ifnet *ifp, stru
         */
        if (lle == NULL) {
                IF_AFDATA_RLOCK(ifp);
-               lle = nd6_lookup(&dst->sin6_addr, ND6_EXCLUSIVE, ifp);
+               lle = nd6_lookup(&dst->sin6_addr, LLE_EXCLUSIVE, ifp);
                IF_AFDATA_RUNLOCK(ifp);
                if ((lle == NULL) && nd6_is_addr_neighbor(dst, ifp))  {
                        /*
@@ -2093,7 +2091,7 @@ nd6_resolve_slow(struct ifnet *ifp, stru
                        IF_AFDATA_WLOCK(ifp);
                        LLE_WLOCK(lle);
                        /* Prefer any existing entry over newly-created one */
-                       lle_tmp = nd6_lookup(&dst->sin6_addr, ND6_EXCLUSIVE, 
ifp);
+                       lle_tmp = nd6_lookup(&dst->sin6_addr, LLE_EXCLUSIVE, 
ifp);
                        if (lle_tmp == NULL)
                                lltable_link_entry(LLTABLE6(ifp), lle);
                        IF_AFDATA_WUNLOCK(ifp);

Modified: head/sys/netinet6/nd6.h
==============================================================================
--- head/sys/netinet6/nd6.h     Tue Sep 22 20:42:14 2015        (r288128)
+++ head/sys/netinet6/nd6.h     Tue Sep 22 20:45:04 2015        (r288129)
@@ -89,8 +89,6 @@ struct nd_ifinfo {
 #define ND6_IFF_NO_PREFER_IFACE        0x80 /* XXX: not related to ND. */
 #define ND6_IFF_NO_DAD         0x100
 
-#define        ND6_EXCLUSIVE           LLE_EXCLUSIVE
-
 #ifdef _KERNEL
 #define ND_IFINFO(ifp) \
        (((struct in6_ifextra *)(ifp)->if_afdata[AF_INET6])->nd_ifinfo)
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to