Author: bz
Date: Thu Aug 27 15:27:41 2015
New Revision: 287211
URL: https://svnweb.freebsd.org/changeset/base/287211

Log:
  get_inpcbinfo() and get_pcblist() are UDP local functions and
  do not do what one would expect by name. Prefix them with "udp_"
  to at least obviously limit the scope.
  
  This is a non-functional change.
  
  Reviewed by:          gnn, rwatson
  MFC after:            2 weeks
  Differential Revision:        https://reviews.freebsd.org/D3505

Modified:
  head/sys/netinet/udp_usrreq.c
  head/sys/netinet/udp_var.h
  head/sys/netinet6/udp6_usrreq.c

Modified: head/sys/netinet/udp_usrreq.c
==============================================================================
--- head/sys/netinet/udp_usrreq.c       Thu Aug 27 15:21:58 2015        
(r287210)
+++ head/sys/netinet/udp_usrreq.c       Thu Aug 27 15:27:41 2015        
(r287211)
@@ -520,7 +520,7 @@ udp_input(struct mbuf **mp, int *offp, i
                }
        }
 
-       pcbinfo = get_inpcbinfo(proto);
+       pcbinfo = udp_get_inpcbinfo(proto);
        if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) ||
            in_broadcast(ip->ip_dst, ifp)) {
                struct inpcb *last;
@@ -528,7 +528,7 @@ udp_input(struct mbuf **mp, int *offp, i
                struct ip_moptions *imo;
 
                INP_INFO_RLOCK(pcbinfo);
-               pcblist = get_pcblist(proto);
+               pcblist = udp_get_pcblist(proto);
                last = NULL;
                LIST_FOREACH(inp, pcblist, inp_list) {
                        if (inp->inp_lport != uh->uh_dport)
@@ -1243,7 +1243,7 @@ udp_output(struct inpcb *inp, struct mbu
         * XXXRW: Check that hash locking update here is correct.
         */
        pr = inp->inp_socket->so_proto->pr_protocol;
-       pcbinfo = get_inpcbinfo(pr);
+       pcbinfo = udp_get_inpcbinfo(pr);
        sin = (struct sockaddr_in *)addr;
        if (sin != NULL &&
            (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0)) {
@@ -1678,7 +1678,7 @@ udp_abort(struct socket *so)
        struct inpcb *inp;
        struct inpcbinfo *pcbinfo;
 
-       pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
+       pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol);
        inp = sotoinpcb(so);
        KASSERT(inp != NULL, ("udp_abort: inp == NULL"));
        INP_WLOCK(inp);
@@ -1699,7 +1699,7 @@ udp_attach(struct socket *so, int proto,
        struct inpcbinfo *pcbinfo;
        int error;
 
-       pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
+       pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol);
        inp = sotoinpcb(so);
        KASSERT(inp == NULL, ("udp_attach: inp != NULL"));
        error = soreserve(so, udp_sendspace, udp_recvspace);
@@ -1760,7 +1760,7 @@ udp_bind(struct socket *so, struct socka
        struct inpcbinfo *pcbinfo;
        int error;
 
-       pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
+       pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol);
        inp = sotoinpcb(so);
        KASSERT(inp != NULL, ("udp_bind: inp == NULL"));
        INP_WLOCK(inp);
@@ -1777,7 +1777,7 @@ udp_close(struct socket *so)
        struct inpcb *inp;
        struct inpcbinfo *pcbinfo;
 
-       pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
+       pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol);
        inp = sotoinpcb(so);
        KASSERT(inp != NULL, ("udp_close: inp == NULL"));
        INP_WLOCK(inp);
@@ -1799,7 +1799,7 @@ udp_connect(struct socket *so, struct so
        struct sockaddr_in *sin;
        int error;
 
-       pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
+       pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol);
        inp = sotoinpcb(so);
        KASSERT(inp != NULL, ("udp_connect: inp == NULL"));
        INP_WLOCK(inp);
@@ -1829,7 +1829,7 @@ udp_detach(struct socket *so)
        struct inpcbinfo *pcbinfo;
        struct udpcb *up;
 
-       pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
+       pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol);
        inp = sotoinpcb(so);
        KASSERT(inp != NULL, ("udp_detach: inp == NULL"));
        KASSERT(inp->inp_faddr.s_addr == INADDR_ANY,
@@ -1851,7 +1851,7 @@ udp_disconnect(struct socket *so)
        struct inpcb *inp;
        struct inpcbinfo *pcbinfo;
 
-       pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
+       pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol);
        inp = sotoinpcb(so);
        KASSERT(inp != NULL, ("udp_disconnect: inp == NULL"));
        INP_WLOCK(inp);

Modified: head/sys/netinet/udp_var.h
==============================================================================
--- head/sys/netinet/udp_var.h  Thu Aug 27 15:21:58 2015        (r287210)
+++ head/sys/netinet/udp_var.h  Thu Aug 27 15:27:41 2015        (r287211)
@@ -150,13 +150,13 @@ VNET_DECLARE(int, udp_blackhole);
 extern int                     udp_log_in_vain;
 
 static __inline struct inpcbinfo *
-get_inpcbinfo(int protocol)
+udp_get_inpcbinfo(int protocol)
 {
        return (protocol == IPPROTO_UDP) ? &V_udbinfo : &V_ulitecbinfo;
 }
 
 static __inline struct inpcbhead *
-get_pcblist(int protocol)
+udp_get_pcblist(int protocol)
 {
        return (protocol == IPPROTO_UDP) ? &V_udb : &V_ulitecb;
 }

Modified: head/sys/netinet6/udp6_usrreq.c
==============================================================================
--- head/sys/netinet6/udp6_usrreq.c     Thu Aug 27 15:21:58 2015        
(r287210)
+++ head/sys/netinet6/udp6_usrreq.c     Thu Aug 27 15:27:41 2015        
(r287211)
@@ -282,7 +282,7 @@ udp6_input(struct mbuf **mp, int *offp, 
        init_sin6(&fromsa, m);
        fromsa.sin6_port = uh->uh_sport;
 
-       pcbinfo = get_inpcbinfo(nxt);
+       pcbinfo = udp_get_inpcbinfo(nxt);
        if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) {
                struct inpcb *last;
                struct inpcbhead *pcblist;
@@ -304,7 +304,7 @@ udp6_input(struct mbuf **mp, int *offp, 
                 * here.  We need udphdr for IPsec processing so we do that
                 * later.
                 */
-               pcblist = get_pcblist(nxt);
+               pcblist = udp_get_pcblist(nxt);
                last = NULL;
                LIST_FOREACH(inp, pcblist, inp_list) {
                        if ((inp->inp_vflag & INP_IPV6) == 0)
@@ -908,7 +908,7 @@ udp6_abort(struct socket *so)
        struct inpcb *inp;
        struct inpcbinfo *pcbinfo;
 
-       pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
+       pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol);
        inp = sotoinpcb(so);
        KASSERT(inp != NULL, ("udp6_abort: inp == NULL"));
 
@@ -940,7 +940,7 @@ udp6_attach(struct socket *so, int proto
        struct inpcbinfo *pcbinfo;
        int error;
 
-       pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
+       pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol);
        inp = sotoinpcb(so);
        KASSERT(inp == NULL, ("udp6_attach: inp != NULL"));
 
@@ -988,7 +988,7 @@ udp6_bind(struct socket *so, struct sock
        struct inpcbinfo *pcbinfo;
        int error;
 
-       pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
+       pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol);
        inp = sotoinpcb(so);
        KASSERT(inp != NULL, ("udp6_bind: inp == NULL"));
 
@@ -1032,7 +1032,7 @@ udp6_close(struct socket *so)
        struct inpcb *inp;
        struct inpcbinfo *pcbinfo;
 
-       pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
+       pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol);
        inp = sotoinpcb(so);
        KASSERT(inp != NULL, ("udp6_close: inp == NULL"));
 
@@ -1064,7 +1064,7 @@ udp6_connect(struct socket *so, struct s
        struct sockaddr_in6 *sin6;
        int error;
 
-       pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
+       pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol);
        inp = sotoinpcb(so);
        sin6 = (struct sockaddr_in6 *)nam;
        KASSERT(inp != NULL, ("udp6_connect: inp == NULL"));
@@ -1126,7 +1126,7 @@ udp6_detach(struct socket *so)
        struct inpcbinfo *pcbinfo;
        struct udpcb *up;
 
-       pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
+       pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol);
        inp = sotoinpcb(so);
        KASSERT(inp != NULL, ("udp6_detach: inp == NULL"));
 
@@ -1147,7 +1147,7 @@ udp6_disconnect(struct socket *so)
        struct inpcbinfo *pcbinfo;
        int error;
 
-       pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
+       pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol);
        inp = sotoinpcb(so);
        KASSERT(inp != NULL, ("udp6_disconnect: inp == NULL"));
 
@@ -1188,7 +1188,7 @@ udp6_send(struct socket *so, int flags, 
        struct inpcbinfo *pcbinfo;
        int error = 0;
 
-       pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol);
+       pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol);
        inp = sotoinpcb(so);
        KASSERT(inp != NULL, ("udp6_send: inp == NULL"));
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to