From owner-svn-src-head@FreeBSD.ORG Sun Jun 21 16:56:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27C5A1065675; Sun, 21 Jun 2009 16:56:50 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1537A8FC18; Sun, 21 Jun 2009 16:56:50 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5LGunoW012857; Sun, 21 Jun 2009 16:56:49 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5LGunTK012855; Sun, 21 Jun 2009 16:56:49 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200906211656.n5LGunTK012855@svn.freebsd.org> From: Robert Watson Date: Sun, 21 Jun 2009 16:56:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194595 - head/sys/netipx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jun 2009 16:56:50 -0000 Author: rwatson Date: Sun Jun 21 16:56:49 2009 New Revision: 194595 URL: http://svn.freebsd.org/changeset/base/194595 Log: Minor style cleanups. MFC after: 3 days Modified: head/sys/netipx/ipx.c Modified: head/sys/netipx/ipx.c ============================================================================== --- head/sys/netipx/ipx.c Sun Jun 21 16:42:52 2009 (r194594) +++ head/sys/netipx/ipx.c Sun Jun 21 16:56:49 2009 (r194595) @@ -82,9 +82,9 @@ __FBSDID("$FreeBSD$"); */ struct ipx_ifaddr *ipx_ifaddr; -static void ipx_ifscrub(struct ifnet *ifp, struct ipx_ifaddr *ia); -static int ipx_ifinit(struct ifnet *ifp, struct ipx_ifaddr *ia, - struct sockaddr_ipx *sipx, int scrub); +static void ipx_ifscrub(struct ifnet *ifp, struct ipx_ifaddr *ia); +static int ipx_ifinit(struct ifnet *ifp, struct ipx_ifaddr *ia, + struct sockaddr_ipx *sipx, int scrub); /* * Generic internet control operations (ioctl's). @@ -111,7 +111,6 @@ ipx_control(struct socket *so, u_long cm break; switch (cmd) { - case SIOCGIFADDR: if (ia == NULL) return (EADDRNOTAVAIL); @@ -182,18 +181,20 @@ ipx_control(struct socket *so, u_long cm ifa->ifa_dstaddr = (struct sockaddr *)&ia->ia_dstaddr; if (ifp->if_flags & IFF_BROADCAST) { ia->ia_broadaddr.sipx_family = AF_IPX; - ia->ia_broadaddr.sipx_len = sizeof(ia->ia_addr); - ia->ia_broadaddr.sipx_addr.x_host = ipx_broadhost; + ia->ia_broadaddr.sipx_len = + sizeof(ia->ia_addr); + ia->ia_broadaddr.sipx_addr.x_host = + ipx_broadhost; } } break; + default: if (td && (error = priv_check(td, PRIV_NET_HWIOCTL)) != 0) return (error); } switch (cmd) { - case SIOCSIFDSTADDR: if ((ifp->if_flags & IFF_POINTOPOINT) == 0) return (EINVAL); @@ -202,7 +203,8 @@ ipx_control(struct socket *so, u_long cm ia->ia_flags &= ~IFA_ROUTE; } if (ifp->if_ioctl) { - error = (*ifp->if_ioctl)(ifp, SIOCSIFDSTADDR, (void *)ia); + error = (*ifp->if_ioctl)(ifp, SIOCSIFDSTADDR, + (void *)ia); if (error) return (error); } @@ -263,8 +265,8 @@ ipx_control(struct socket *so, u_long cm } /* -* Delete any previous route for an old address. -*/ + * Delete any previous route for an old address. + */ static void ipx_ifscrub(struct ifnet *ifp, struct ipx_ifaddr *ia) { @@ -277,9 +279,9 @@ ipx_ifscrub(struct ifnet *ifp, struct ip ia->ia_flags &= ~IFA_ROUTE; } } + /* - * Initialize an interface's internet address - * and routing table entry. + * Initialize an interface's internet address and routing table entry. */ static int ipx_ifinit(struct ifnet *ifp, struct ipx_ifaddr *ia, @@ -295,15 +297,13 @@ ipx_ifinit(struct ifnet *ifp, struct ipx ia->ia_addr = *sipx; /* - * The convention we shall adopt for naming is that - * a supplied address of zero means that "we don't care". - * Use the MAC address of the interface. If it is an - * interface without a MAC address, like a serial line, the - * address must be supplied. + * The convention we shall adopt for naming is that a supplied + * address of zero means that "we don't care". Use the MAC address + * of the interface. If it is an interface without a MAC address, + * like a serial line, the address must be supplied. * - * Give the interface a chance to initialize - * if this is its first address, - * and to validate the address if necessary. + * Give the interface a chance to initialize if this is its first + * address, and to validate the address if necessary. */ if (ifp->if_ioctl != NULL && (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (void *)ia))) { @@ -313,6 +313,7 @@ ipx_ifinit(struct ifnet *ifp, struct ipx } splx(s); ia->ia_ifa.ifa_metric = ifp->if_metric; + /* * Add route for the network. */ @@ -349,10 +350,12 @@ ipx_iaonnetof(struct ipx_addr *dst) compare = &satoipx_addr(ia->ia_dstaddr); if (ipx_hosteq(*dst, *compare)) return (ia); - if (ipx_neteqnn(net, ia->ia_addr.sipx_addr.x_net)) + if (ipx_neteqnn(net, + ia->ia_addr.sipx_addr.x_net)) ia_maybe = ia; } else { - if (ipx_neteqnn(net, ia->ia_addr.sipx_addr.x_net)) + if (ipx_neteqnn(net, + ia->ia_addr.sipx_addr.x_net)) return (ia); } } @@ -360,7 +363,6 @@ ipx_iaonnetof(struct ipx_addr *dst) return (ia_maybe); } - void ipx_printhost(struct ipx_addr *addr) { @@ -373,7 +375,6 @@ ipx_printhost(struct ipx_addr *addr) port = ntohs(work.x_port); if (ipx_nullnet(work) && ipx_nullhost(work)) { - if (port) printf("*.%x", port); else