Author: melifaro
Date: Wed Sep 16 11:06:07 2015
New Revision: 287857
URL: https://svnweb.freebsd.org/changeset/base/287857

Log:
  Constantify lookup key in several nd6_* functions.

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

Modified: head/sys/netinet6/nd6.c
==============================================================================
--- head/sys/netinet6/nd6.c     Wed Sep 16 10:07:45 2015        (r287856)
+++ head/sys/netinet6/nd6.c     Wed Sep 16 11:06:07 2015        (r287857)
@@ -126,7 +126,7 @@ VNET_DEFINE(int, nd6_recalc_reachtm_inte
 
 int    (*send_sendso_input_hook)(struct mbuf *, struct ifnet *, int, int);
 
-static int nd6_is_new_addr_neighbor(struct sockaddr_in6 *,
+static int nd6_is_new_addr_neighbor(const struct sockaddr_in6 *,
        struct ifnet *);
 static void nd6_setmtu0(struct ifnet *, struct nd_ifinfo *);
 static void nd6_slowtimo(void *);
@@ -953,7 +953,7 @@ nd6_purge(struct ifnet *ifp)
  * Returns the llentry locked
  */
 struct llentry *
-nd6_lookup(struct in6_addr *addr6, int flags, struct ifnet *ifp)
+nd6_lookup(const struct in6_addr *addr6, int flags, struct ifnet *ifp)
 {
        struct sockaddr_in6 sin6;
        struct llentry *ln;
@@ -973,7 +973,7 @@ nd6_lookup(struct in6_addr *addr6, int f
 }
 
 struct llentry *
-nd6_alloc(struct in6_addr *addr6, int flags, struct ifnet *ifp)
+nd6_alloc(const struct in6_addr *addr6, int flags, struct ifnet *ifp)
 {
        struct sockaddr_in6 sin6;
        struct llentry *ln;
@@ -996,7 +996,7 @@ nd6_alloc(struct in6_addr *addr6, int fl
  * to not reenter the routing code from within itself.
  */
 static int
-nd6_is_new_addr_neighbor(struct sockaddr_in6 *addr, struct ifnet *ifp)
+nd6_is_new_addr_neighbor(const struct sockaddr_in6 *addr, struct ifnet *ifp)
 {
        struct nd_prefix *pr;
        struct ifaddr *dstaddr;
@@ -1069,7 +1069,7 @@ nd6_is_new_addr_neighbor(struct sockaddr
         * If the address is assigned on the node of the other side of
         * a p2p interface, the address should be a neighbor.
         */
-       dstaddr = ifa_ifwithdstaddr((struct sockaddr *)addr, RT_ALL_FIBS);
+       dstaddr = ifa_ifwithdstaddr((const struct sockaddr *)addr, RT_ALL_FIBS);
        if (dstaddr != NULL) {
                if (dstaddr->ifa_ifp == ifp) {
                        ifa_free(dstaddr);
@@ -1097,7 +1097,7 @@ nd6_is_new_addr_neighbor(struct sockaddr
  * XXX: should take care of the destination of a p2p link?
  */
 int
-nd6_is_addr_neighbor(struct sockaddr_in6 *addr, struct ifnet *ifp)
+nd6_is_addr_neighbor(const struct sockaddr_in6 *addr, struct ifnet *ifp)
 {
        struct llentry *lle;
        int rc = 0;

Modified: head/sys/netinet6/nd6.h
==============================================================================
--- head/sys/netinet6/nd6.h     Wed Sep 16 10:07:45 2015        (r287856)
+++ head/sys/netinet6/nd6.h     Wed Sep 16 11:06:07 2015        (r287857)
@@ -402,12 +402,12 @@ void nd6_destroy(void);
 #endif
 struct nd_ifinfo *nd6_ifattach(struct ifnet *);
 void nd6_ifdetach(struct nd_ifinfo *);
-int nd6_is_addr_neighbor(struct sockaddr_in6 *, struct ifnet *);
+int nd6_is_addr_neighbor(const struct sockaddr_in6 *, struct ifnet *);
 void nd6_option_init(void *, int, union nd_opts *);
 struct nd_opt_hdr *nd6_option(union nd_opts *);
 int nd6_options(union nd_opts *);
-struct llentry *nd6_lookup(struct in6_addr *, int, struct ifnet *);
-struct llentry *nd6_alloc(struct in6_addr *, int, struct ifnet *);
+struct llentry *nd6_lookup(const struct in6_addr *, int, struct ifnet *);
+struct llentry *nd6_alloc(const struct in6_addr *, int, struct ifnet *);
 void nd6_setmtu(struct ifnet *);
 void nd6_llinfo_settimer(struct llentry *, long);
 void nd6_llinfo_settimer_locked(struct llentry *, long);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to