diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2015-06-08 22:19:29 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2015-06-08 22:19:29 +0000 |
commit | baa8616302995c1c67c5cef16e393a8c4d170abd (patch) | |
tree | f3ca42f6e4e832b7857d6d008a125d4a78753a66 | |
parent | 93ed54a4e7d31d795814bcc1348460ce921aa7e6 (diff) |
More damned eye searing whitespace. No change to .o files.
-rw-r--r-- | sys/netinet6/icmp6.c | 10 | ||||
-rw-r--r-- | sys/netinet6/in6.c | 12 | ||||
-rw-r--r-- | sys/netinet6/in6.h | 4 | ||||
-rw-r--r-- | sys/netinet6/in6_cksum.c | 6 | ||||
-rw-r--r-- | sys/netinet6/in6_gif.c | 4 | ||||
-rw-r--r-- | sys/netinet6/in6_ifattach.c | 4 | ||||
-rw-r--r-- | sys/netinet6/in6_pcb.c | 20 | ||||
-rw-r--r-- | sys/netinet6/in6_src.c | 6 | ||||
-rw-r--r-- | sys/netinet6/ip6_divert.c | 4 | ||||
-rw-r--r-- | sys/netinet6/ip6_forward.c | 14 | ||||
-rw-r--r-- | sys/netinet6/ip6_input.c | 22 | ||||
-rw-r--r-- | sys/netinet6/ip6_mroute.c | 50 | ||||
-rw-r--r-- | sys/netinet6/ip6_mroute.h | 56 | ||||
-rw-r--r-- | sys/netinet6/ip6_output.c | 24 | ||||
-rw-r--r-- | sys/netinet6/nd6.c | 6 | ||||
-rw-r--r-- | sys/netinet6/nd6_rtr.c | 10 | ||||
-rw-r--r-- | sys/netinet6/raw_ip6.c | 14 | ||||
-rw-r--r-- | sys/netinet6/udp6_output.c | 8 |
18 files changed, 137 insertions, 137 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index 9c124e6867c..bf1c2124db1 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: icmp6.c,v 1.157 2015/03/04 11:10:55 mpi Exp $ */ +/* $OpenBSD: icmp6.c,v 1.158 2015/06/08 22:19:27 krw Exp $ */ /* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */ /* @@ -1345,7 +1345,7 @@ icmp6_fasttimo(void) } const char * -icmp6_redirect_diag(struct in6_addr *src6, struct in6_addr *dst6, +icmp6_redirect_diag(struct in6_addr *src6, struct in6_addr *dst6, struct in6_addr *tgt6) { static char buf[1024]; /* XXX */ @@ -1839,7 +1839,7 @@ fail: * ICMPv6 socket option processing. */ int -icmp6_ctloutput(int op, struct socket *so, int level, int optname, +icmp6_ctloutput(int op, struct socket *so, int level, int optname, struct mbuf **mp) { int error = 0; @@ -1940,7 +1940,7 @@ icmp6_mtudisc_clone(struct sockaddr *dst, u_int rdomain) int error; rt = rtalloc(dst, RT_REPORT|RT_RESOLVE, rdomain); - if (rt == 0) + if (rt == NULL) return NULL; /* If we didn't get a host route, allocate one */ @@ -2012,7 +2012,7 @@ icmp6_redirect_timeout(struct rtentry *rt, struct rttimer *r) int *icmpv6ctl_vars[ICMPV6CTL_MAXID] = ICMPV6CTL_VARS; int -icmp6_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, +icmp6_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, size_t newlen) { /* All sysctl names at this level are terminal. */ diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index d2c97378295..5111feb2091 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.c,v 1.158 2015/05/26 12:19:52 mpi Exp $ */ +/* $OpenBSD: in6.c,v 1.159 2015/06/08 22:19:27 krw Exp $ */ /* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */ /* @@ -477,7 +477,7 @@ in6_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp) * and link it to the list. try to enable inet6 if there * is no link-local yet. */ - s = splsoftnet(); + s = splsoftnet(); in6_ifattach(ifp); error = in6_update_ifa(ifp, ifra, ia6); splx(s); @@ -485,7 +485,7 @@ in6_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp) return (error); if ((ia6 = in6ifa_ifpwithaddr(ifp, &ifra->ifra_addr.sin6_addr)) == NULL) { - /* + /* * this can happen when the user specify the 0 valid * lifetime. */ @@ -754,7 +754,7 @@ in6_update_ifa(struct ifnet *ifp, struct in6_aliasreq *ifra, */ if ((ifp->if_flags & IFF_POINTOPOINT) && dst6.sin6_family == AF_INET6 && !IN6_ARE_ADDR_EQUAL(&dst6.sin6_addr, &ia6->ia_dstaddr.sin6_addr)) { - struct ifaddr *ifa = &ia6->ia_ifa; + struct ifaddr *ifa = &ia6->ia_ifa; if ((ia6->ia_flags & IFA_ROUTE) != 0 && rt_ifa_del(ifa, RTF_HOST, ifa->ifa_dstaddr) != 0) { @@ -1176,7 +1176,7 @@ in6_lifaddr_ioctl(struct socket *so, u_long cmd, caddr_t data, return EADDRNOTAVAIL; hostid = IFA_IN6(ifa); - /* prefixlen must be <= 64. */ + /* prefixlen must be <= 64. */ if (64 < iflr->prefixlen) return EINVAL; prefixlen = iflr->prefixlen; @@ -1464,7 +1464,7 @@ void in6_delmulti(struct in6_multi *in6m) { struct in6_ifreq ifr; - struct ifnet *ifp; + struct ifnet *ifp; int s; if (--in6m->in6m_refcnt == 0) { diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h index 4b3bb6dc969..0817e4c1106 100644 --- a/sys/netinet6/in6.h +++ b/sys/netinet6/in6.h @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.h,v 1.82 2015/04/14 14:18:37 mikeb Exp $ */ +/* $OpenBSD: in6.h,v 1.83 2015/06/08 22:19:28 krw Exp $ */ /* $KAME: in6.h,v 1.83 2001/03/29 02:55:07 jinmei Exp $ */ /* @@ -260,7 +260,7 @@ struct route_in6 { (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_LINKLOCAL)) #define IN6_IS_ADDR_MC_SITELOCAL(a) \ - (IN6_IS_ADDR_MULTICAST(a) && \ + (IN6_IS_ADDR_MULTICAST(a) && \ (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_SITELOCAL)) #define IN6_IS_ADDR_MC_ORGLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && \ diff --git a/sys/netinet6/in6_cksum.c b/sys/netinet6/in6_cksum.c index 00e35629071..69c59ec1ac3 100644 --- a/sys/netinet6/in6_cksum.c +++ b/sys/netinet6/in6_cksum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_cksum.c,v 1.16 2014/01/22 14:27:20 naddy Exp $ */ +/* $OpenBSD: in6_cksum.c,v 1.17 2015/06/08 22:19:28 krw Exp $ */ /* $KAME: in6_cksum.c,v 1.10 2000/12/03 00:53:59 itojun Exp $ */ /* @@ -91,7 +91,7 @@ in6_cksum(struct mbuf *m, u_int8_t nxt, u_int32_t off, u_int32_t len) int sum = 0; int mlen = 0; int byte_swapped = 0; - struct ip6_hdr *ip6; + struct ip6_hdr *ip6; union { u_int16_t phs[4]; struct { @@ -213,7 +213,7 @@ skip_phdr: /* * Lastly calculate a summary of the rest of mbufs. */ - + for (;m && len; m = m->m_next) { if (m->m_len == 0) continue; diff --git a/sys/netinet6/in6_gif.c b/sys/netinet6/in6_gif.c index c5bfed0ca88..c7230c70d17 100644 --- a/sys/netinet6/in6_gif.c +++ b/sys/netinet6/in6_gif.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_gif.c,v 1.38 2015/05/12 12:27:17 mpi Exp $ */ +/* $OpenBSD: in6_gif.c,v 1.39 2015/06/08 22:19:28 krw Exp $ */ /* $KAME: in6_gif.c,v 1.43 2001/01/22 07:27:17 itojun Exp $ */ /* @@ -120,7 +120,7 @@ in6_gif_output(struct ifnet *ifp, int family, struct mbuf **m0) m_freem(m); return EAFNOSUPPORT; } - + /* encapsulate into IPv6 packet */ *m0 = NULL; #if NBRIDGE > 0 diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c index 1aa40a7baf2..3c027cbdc43 100644 --- a/sys/netinet6/in6_ifattach.c +++ b/sys/netinet6/in6_ifattach.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_ifattach.c,v 1.87 2015/04/27 14:51:44 mpi Exp $ */ +/* $OpenBSD: in6_ifattach.c,v 1.88 2015/06/08 22:19:28 krw Exp $ */ /* $KAME: in6_ifattach.c,v 1.124 2001/07/18 08:32:51 jinmei Exp $ */ /* @@ -480,7 +480,7 @@ in6_ifattach_loopback(struct ifnet *ifp) * when ifp == NULL, the caller is responsible for filling scopeid. */ int -in6_nigroup(struct ifnet *ifp, const char *name, int namelen, +in6_nigroup(struct ifnet *ifp, const char *name, int namelen, struct sockaddr_in6 *sa6) { const char *p; diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 85abd36399b..d99bb5f1c0f 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_pcb.c,v 1.67 2014/12/05 15:50:04 mpi Exp $ */ +/* $OpenBSD: in6_pcb.c,v 1.68 2015/06/08 22:19:28 krw Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -31,11 +31,11 @@ /* * @(#)COPYRIGHT 1.1 (NRL) 17 January 1995 - * + * * NRL grants permission for redistribution and use in source and binary * forms, with or without modification, of the software and documentation * created at NRL provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright @@ -43,14 +43,14 @@ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgements: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * This product includes software developed at the Information - * Technology Division, US Naval Research Laboratory. + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * This product includes software developed at the Information + * Technology Division, US Naval Research Laboratory. * 4. Neither the name of the NRL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THE SOFTWARE PROVIDED BY NRL IS PROVIDED BY NRL AND CONTRIBUTORS ``AS * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @@ -62,7 +62,7 @@ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation * are those of the authors and should not be interpreted as representing * official policies, either expressed or implied, of the US Naval @@ -471,7 +471,7 @@ in6_pcbconnect(struct inpcb *inp, struct mbuf *nam) * once PCB to be notified has been located. */ int -in6_pcbnotify(struct inpcbtable *head, struct sockaddr_in6 *dst, +in6_pcbnotify(struct inpcbtable *head, struct sockaddr_in6 *dst, uint fport_arg, const struct sockaddr_in6 *src, uint lport_arg, u_int rdomain, int cmd, void *cmdarg, void (*notify)(struct inpcb *, int)) { diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c index aedab78a11f..570ce25f623 100644 --- a/sys/netinet6/in6_src.c +++ b/sys/netinet6/in6_src.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_src.c,v 1.50 2014/12/17 09:45:59 mpi Exp $ */ +/* $OpenBSD: in6_src.c,v 1.51 2015/06/08 22:19:28 krw Exp $ */ /* $KAME: in6_src.c,v 1.36 2001/02/06 04:08:17 itojun Exp $ */ /* @@ -231,7 +231,7 @@ in6_selectsrc(struct in6_addr **in6src, struct sockaddr_in6 *dstsock, if (rt) { ia6 = in6_ifawithscope(rt->rt_ifp, dst, rtableid); - if (ia6 == 0) + if (ia6 == NULL) ia6 = ifatoia6(rt->rt_ifa); } if (ia6 == NULL) @@ -283,7 +283,7 @@ in6_selectsrc(struct in6_addr **in6src, struct sockaddr_in6 *dstsock, if (ro->ro_rt) { ia6 = in6_ifawithscope(ro->ro_rt->rt_ifa->ifa_ifp, dst, rtableid); - if (ia6 == 0) /* xxx scope error ?*/ + if (ia6 == NULL) /* xxx scope error ?*/ ia6 = ifatoia6(ro->ro_rt->rt_ifa); } if (ia6 == NULL) diff --git a/sys/netinet6/ip6_divert.c b/sys/netinet6/ip6_divert.c index af13323d65e..4512dbe0ab9 100644 --- a/sys/netinet6/ip6_divert.c +++ b/sys/netinet6/ip6_divert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_divert.c,v 1.33 2015/04/10 13:58:20 dlg Exp $ */ +/* $OpenBSD: ip6_divert.c,v 1.34 2015/06/08 22:19:28 krw Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -189,7 +189,7 @@ divert6_packet(struct mbuf *m, int dir, u_int16_t divert_port) inp = NULL; div6stat.divs_ipackets++; - + if (m->m_len < sizeof(struct ip6_hdr) && (m = m_pullup(m, sizeof(struct ip6_hdr))) == NULL) { div6stat.divs_errors++; diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c index 131abd47736..cd69125c163 100644 --- a/sys/netinet6/ip6_forward.c +++ b/sys/netinet6/ip6_forward.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_forward.c,v 1.74 2015/05/23 12:52:59 markus Exp $ */ +/* $OpenBSD: ip6_forward.c,v 1.75 2015/06/08 22:19:28 krw Exp $ */ /* $KAME: ip6_forward.c,v 1.75 2001/06/29 12:42:13 jinmei Exp $ */ /* @@ -224,7 +224,7 @@ reroute: /* * ip6_forward_rt.ro_dst.sin6_addr is equal to ip6->ip6_dst */ - if (ip6_forward_rt.ro_rt == 0 || + if (ip6_forward_rt.ro_rt == NULL || (ip6_forward_rt.ro_rt->rt_flags & RTF_UP) == 0 || ip6_forward_rt.ro_tableid != rtableid) { if (ip6_forward_rt.ro_rt) { @@ -239,7 +239,7 @@ reroute: ip6_forward_rt.ro_tableid); } - if (ip6_forward_rt.ro_rt == 0) { + if (ip6_forward_rt.ro_rt == NULL) { ip6stat.ip6s_noroute++; /* XXX in6_ifstat_inc(rt->rt_ifp, ifs6_in_noroute) */ if (mcopy) { @@ -249,7 +249,7 @@ reroute: m_freem(m); return; } - } else if (ip6_forward_rt.ro_rt == 0 || + } else if (ip6_forward_rt.ro_rt == NULL || (ip6_forward_rt.ro_rt->rt_flags & RTF_UP) == 0 || !IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst, &dst->sin6_addr) || ip6_forward_rt.ro_tableid != rtableid) { @@ -267,7 +267,7 @@ reroute: &ip6->ip6_src.s6_addr32[0], ip6_forward_rt.ro_tableid); - if (ip6_forward_rt.ro_rt == 0) { + if (ip6_forward_rt.ro_rt == NULL) { ip6stat.ip6s_noroute++; /* XXX in6_ifstat_inc(rt->rt_ifp, ifs6_in_noroute) */ if (mcopy) { @@ -410,7 +410,7 @@ reroute: if (IN6_IS_SCOPE_EMBED(&ip6->ip6_dst)) ip6->ip6_dst.s6_addr16[1] = 0; -#if NPF > 0 +#if NPF > 0 if (pf_test(AF_INET6, PF_FWD, rt->rt_ifp, &m, NULL) != PF_PASS) { m_freem(m); goto senderr; @@ -428,7 +428,7 @@ reroute: srcrt = 1; goto reroute; } -#endif +#endif in6_proto_cksum_out(m, rt->rt_ifp); /* Check the size after pf_test to give pf a chance to refragment. */ diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index 9643cdb61dd..8d24ad2087a 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_input.c,v 1.141 2015/04/10 13:58:20 dlg Exp $ */ +/* $OpenBSD: ip6_input.c,v 1.142 2015/06/08 22:19:28 krw Exp $ */ /* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */ /* @@ -134,7 +134,7 @@ ip6_init(void) int i; pr = (struct ip6protosw *)pffindproto(PF_INET6, IPPROTO_RAW, SOCK_RAW); - if (pr == 0) + if (pr == NULL) panic("ip6_init"); for (i = 0; i < IPPROTO_MAX; i++) ip6_protox[i] = pr - inet6sw; @@ -387,7 +387,7 @@ ip6_input(struct mbuf *m) * Multicast check */ if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) { - struct in6_multi *in6m = 0; + struct in6_multi *in6m = NULL; /* * Make sure M_MCAST is set. It should theoretically @@ -428,7 +428,7 @@ ip6_input(struct mbuf *m) * Unicast check */ if (ip6_forward_rt.ro_rt != NULL && - (ip6_forward_rt.ro_rt->rt_flags & RTF_UP) != 0 && + (ip6_forward_rt.ro_rt->rt_flags & RTF_UP) != 0 && IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst, &ip6_forward_rt.ro_dst.sin6_addr) && rtableid == ip6_forward_rt.ro_tableid) @@ -532,7 +532,7 @@ ip6_input(struct mbuf *m) /* * Note that if a valid jumbo payload option is * contained, ip6_hoptops_input() must set a valid - * (non-zero) payload length to the variable plen. + * (non-zero) payload length to the variable plen. */ ip6stat.ip6s_badoptions++; in6_ifstat_inc(ifp, ifs6_in_discard); @@ -605,7 +605,7 @@ ip6_input(struct mbuf *m) } else if (!ours) { ip6_forward(m, srcrt); return; - } + } /* pf might have changed things */ in6_proto_cksum_out(m, NULL); @@ -713,7 +713,7 @@ ip6_check_rh0hdr(struct mbuf *m, int *offp) if (off + sizeof(opt6) > lim) { /* * Packet to short to make sense, we could - * reject the packet but as a router we + * reject the packet but as a router we * should not do that so forward it. */ return (0); @@ -789,7 +789,7 @@ ip6_hopopts_input(u_int32_t *plenp, u_int32_t *rtalertp, struct mbuf **mp, * opthead + hbhlen is located in continuous memory region. */ int -ip6_process_hopopts(struct mbuf *m, u_int8_t *opthead, int hbhlen, +ip6_process_hopopts(struct mbuf *m, u_int8_t *opthead, int hbhlen, u_int32_t *rtalertp, u_int32_t *plenp) { struct ip6_hdr *ip6; @@ -1162,8 +1162,8 @@ ip6_savecontrol(struct inpcb *in6p, struct mbuf *m, struct mbuf **mp) m_freem(ext); ext = NULL; } - loopend: - ; +loopend: + ; } } @@ -1387,7 +1387,7 @@ u_char inet6ctlerrmap[PRC_NCMDS] = { int *ipv6ctl_vars[IPV6CTL_MAXID] = IPV6CTL_VARS; int -ip6_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, +ip6_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, size_t newlen) { #ifdef MROUTING diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index 09a773a211a..b1a37e6bf26 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -128,7 +128,7 @@ int ip6_mrouter_ver = 0; int ip6_mrtproto = IPPROTO_PIM; /* for netstat only */ struct mrt6stat mrt6stat; -#define NO_RTE_FOUND 0x1 +#define NO_RTE_FOUND 0x1 #define RTE_FOUND 0x2 struct mf6c *mf6ctable[MF6CTBLSIZ]; @@ -136,7 +136,7 @@ SIPHASH_KEY mf6chashkey; u_char n6expire[MF6CTBLSIZ]; struct mif6 mif6table[MAXMIFS]; #ifdef MRT6DEBUG -u_int mrt6debug = 0; /* debug level */ +u_int mrt6debug = 0; /* debug level */ #define DEBUG_MFC 0x02 #define DEBUG_FORWARD 0x04 #define DEBUG_EXPIRE 0x08 @@ -374,7 +374,7 @@ mrt6_sysctl_mif(void *oldp, size_t *oldlenp) for (mifi = 0; mifi < nummifs; mifi++) { mifp = &mif6table[mifi]; if (mifp->m6_ifp == NULL) - continue; + continue; minfo.m6_mifi = mifi; minfo.m6_flags = mifp->m6_flags; @@ -387,7 +387,7 @@ mrt6_sysctl_mif(void *oldp, size_t *oldlenp) minfo.m6_rate_limit = mifp->m6_rate_limit; needed += sizeof(minfo); - if (where && needed <= given) { + if (where && needed <= given) { int error; error = copyout(&minfo, where, sizeof(minfo)); @@ -434,7 +434,7 @@ mrt6_sysctl_mfc(void *oldp, size_t *oldlenp) minfo.mf6c_stall_cnt = waitings; needed += sizeof(minfo); - if (where && needed <= given) { + if (where && needed <= given) { int error; error = copyout(&minfo, where, sizeof(minfo)); @@ -910,7 +910,7 @@ add_m6fc(struct mf6cctl *mfccp) #endif for (rt = mf6ctable[hash]; rt; rt = rt->mf6c_next) { - + if (IN6_ARE_ADDR_EQUAL(&rt->mf6c_origin.sin6_addr, &mfccp->mf6cc_origin.sin6_addr)&& IN6_ARE_ADDR_EQUAL(&rt->mf6c_mcastgrp.sin6_addr, @@ -938,7 +938,7 @@ add_m6fc(struct mf6cctl *mfccp) splx(s); return ENOBUFS; } - + /* insert new entry at head of hash chain */ rt->mf6c_origin = mfccp->mf6cc_origin; rt->mf6c_mcastgrp = mfccp->mf6cc_mcastgrp; @@ -950,7 +950,7 @@ add_m6fc(struct mf6cctl *mfccp) rt->mf6c_wrong_if = 0; rt->mf6c_expire = 0; rt->mf6c_stall = NULL; - + /* link into table */ rt->mf6c_next = mf6ctable[hash]; mf6ctable[hash] = rt; @@ -966,11 +966,11 @@ add_m6fc(struct mf6cctl *mfccp) int del_m6fc(struct mf6cctl *mfccp) { - struct sockaddr_in6 origin; - struct sockaddr_in6 mcastgrp; - struct mf6c *rt; - struct mf6c **nptr; - u_long hash; + struct sockaddr_in6 origin; + struct sockaddr_in6 mcastgrp; + struct mf6c *rt; + struct mf6c **nptr; + u_long hash; int s; origin = mfccp->mf6cc_origin; @@ -1137,7 +1137,7 @@ ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m) splx(s); return ENOBUFS; } - + /* is there an upcall waiting for this packet? */ hash = MF6CHASH(ip6->ip6_src, ip6->ip6_dst); for (rt = mf6ctable[hash]; rt; rt = rt->mf6c_next) { @@ -1182,7 +1182,7 @@ ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m) sin6.sin6_len = sizeof(sin6); sin6.sin6_family = AF_INET6; sin6.sin6_addr = ip6->ip6_src; - + im = NULL; switch (ip6_mrouter_ver) { case MRT6_INIT: @@ -1372,7 +1372,7 @@ ip6_mdq(struct mbuf *m, struct ifnet *ifp, struct mf6c *rt) "wrong if: ifid %d mifi %d mififid %x\n", ifp->if_index, mifi, mif6table[mifi].m6_ifp ? - mif6table[mifi].m6_ifp->if_index : -1); + mif6table[mifi].m6_ifp->if_index : -1); #endif mrt6stat.mrt6s_wrong_if++; rt->mf6c_wrong_if++; @@ -1401,7 +1401,7 @@ ip6_mdq(struct mbuf *m, struct ifnet *ifp, struct mf6c *rt) mm = m_pullup(mm, sizeof(struct ip6_hdr)); if (mm == NULL) return ENOBUFS; - + im = NULL; switch (ip6_mrouter_ver) { case MRT6_INIT: @@ -1793,9 +1793,9 @@ pim6_input(struct mbuf **mp, int *offp, int proto) m_freem(m); return (IPPROTO_DONE); } - + reghdr = (u_int32_t *)(pim + 1); - + if ((ntohl(*reghdr) & PIM_NULL_REGISTER)) goto pim6_input_to_daemon; @@ -1816,9 +1816,9 @@ pim6_input(struct mbuf **mp, int *offp, int proto) m_freem(m); return (IPPROTO_DONE); } - + eip6 = (struct ip6_hdr *) (reghdr + 1); -#ifdef MRT6DEBUG +#ifdef MRT6DEBUG if (mrt6debug & DEBUG_PIM) log(LOG_DEBUG, "pim6_input[register], eip6: %s -> %s, " @@ -1841,7 +1841,7 @@ pim6_input(struct mbuf **mp, int *offp, int proto) m_freem(m); return (IPPROTO_NONE); } - + /* verify the inner packet is destined to a mcast group */ if (!IN6_IS_ADDR_MULTICAST(&eip6->ip6_dst)) { ++pim6stat.pim6s_rcv_badregisters; @@ -1856,7 +1856,7 @@ pim6_input(struct mbuf **mp, int *offp, int proto) m_freem(m); return (IPPROTO_DONE); } - + /* * make a copy of the whole header to pass to the daemon later. */ @@ -1870,7 +1870,7 @@ pim6_input(struct mbuf **mp, int *offp, int proto) m_freem(m); return (IPPROTO_DONE); } - + /* * forward the inner ip6 packet; point m_data at the inner ip6. */ @@ -1890,7 +1890,7 @@ pim6_input(struct mbuf **mp, int *offp, int proto) looutput(mif6table[reg_mif_num].m6_ifp, m, sin6tosa(&dst), NULL); - + /* prepare the register head to send to the mrouting daemon */ m = mcp; } diff --git a/sys/netinet6/ip6_mroute.h b/sys/netinet6/ip6_mroute.h index 35e79af0812..5062d08ce13 100644 --- a/sys/netinet6/ip6_mroute.h +++ b/sys/netinet6/ip6_mroute.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_mroute.h,v 1.15 2015/02/09 12:23:22 claudio Exp $ */ +/* $OpenBSD: ip6_mroute.h,v 1.16 2015/06/08 22:19:28 krw Exp $ */ /* $KAME: ip6_mroute.h,v 1.17 2001/02/10 02:05:52 itojun Exp $ */ /* @@ -83,11 +83,11 @@ typedef struct if_set { * Argument structure for MRT6_ADD_IF. */ struct mif6ctl { - mifi_t mif6c_mifi; /* the index of the mif to be added */ - u_char mif6c_flags; /* MIFF_ flags defined below */ + mifi_t mif6c_mifi; /* the index of the mif to be added */ + u_char mif6c_flags; /* MIFF_ flags defined below */ u_short mif6c_pifi; /* the index of the physical IF */ #ifdef notyet - u_int mif6c_rate_limit; /* max rate */ + u_int mif6c_rate_limit; /* max rate */ #endif }; @@ -107,27 +107,27 @@ struct mf6cctl { /* structure used to get all the mif entries via sysctl */ struct mif6info { - struct in6_addr m6_lcl_addr; /* local interface address */ - u_int16_t m6_ifindex; /* interface index */ + struct in6_addr m6_lcl_addr; /* local interface address */ + u_int16_t m6_ifindex; /* interface index */ u_int64_t m6_pkt_in; /* # pkts in on interface */ u_int64_t m6_pkt_out; /* # pkts out on interface */ u_int64_t m6_bytes_in; /* # bytes in on interface */ u_int64_t m6_bytes_out; /* # bytes out on interface */ - u_int m6_rate_limit; /* max rate */ + u_int m6_rate_limit; /* max rate */ mifi_t m6_mifi; - u_char m6_flags; /* MIFF_ flags defined above */ + u_char m6_flags; /* MIFF_ flags defined above */ }; /* structure used to get all the mf6c entries via sysctl */ struct mf6cinfo { struct sockaddr_in6 mf6c_origin; /* IPv6 origin of mcasts */ struct sockaddr_in6 mf6c_mcastgrp; /* multicast group associated*/ - mifi_t mf6c_parent; /* incoming IF */ + mifi_t mf6c_parent; /* incoming IF */ struct if_set mf6c_ifset; /* set of outgoing IFs */ - u_int64_t mf6c_pkt_cnt; /* pkt count for src-grp */ - u_int64_t mf6c_byte_cnt; /* byte count for src-grp */ - u_int64_t mf6c_stall_cnt; /* pkt-cnt waiting for route */ + u_int64_t mf6c_pkt_cnt; /* pkt count for src-grp */ + u_int64_t mf6c_byte_cnt; /* byte count for src-grp */ + u_int64_t mf6c_stall_cnt; /* pkt-cnt waiting for route */ }; /* @@ -142,10 +142,10 @@ struct mrt6stat { u_int64_t mrt6s_cant_tunnel; /* no room for tunnel options */ u_int64_t mrt6s_wrong_if; /* arrived on wrong interface */ u_int64_t mrt6s_upq_ovflw; /* upcall Q overflow */ - u_int64_t mrt6s_cache_cleanups; /* # entries with no upcalls */ - u_int64_t mrt6s_drop_sel; /* pkts dropped selectively */ - u_int64_t mrt6s_q_overflow; /* pkts dropped - Q overflow */ - u_int64_t mrt6s_pkt2large; /* pkts dropped - size > BKT SIZE */ + u_int64_t mrt6s_cache_cleanups; /* # entries with no upcalls */ + u_int64_t mrt6s_drop_sel; /* pkts dropped selectively */ + u_int64_t mrt6s_q_overflow; /* pkts dropped - Q overflow */ + u_int64_t mrt6s_pkt2large; /* pkts dropped - size > BKT SIZE */ u_int64_t mrt6s_upq_sockfull; /* upcalls dropped - socket full */ }; @@ -196,13 +196,13 @@ struct sioc_mif_req6 { * The kernel's multicast-interface structure. */ struct mif6 { - u_char m6_flags; /* MIFF_ flags defined above */ - u_int m6_rate_limit; /* max rate */ + u_char m6_flags; /* MIFF_ flags defined above */ + u_int m6_rate_limit; /* max rate */ #ifdef notyet - struct tbf *m6_tbf; /* token bucket structure at intf. */ + struct tbf *m6_tbf; /* token bucket structure at intf. */ #endif - struct in6_addr m6_lcl_addr; /* local interface address */ - struct ifnet *m6_ifp; /* pointer to interface */ + struct in6_addr m6_lcl_addr; /* local interface address */ + struct ifnet *m6_ifp; /* pointer to interface */ u_int64_t m6_pkt_in; /* # pkts in on interface */ u_int64_t m6_pkt_out; /* # pkts out on interface */ u_int64_t m6_bytes_in; /* # bytes in on interface */ @@ -215,13 +215,13 @@ struct mif6 { struct mf6c { struct sockaddr_in6 mf6c_origin; /* IPv6 origin of mcasts */ struct sockaddr_in6 mf6c_mcastgrp; /* multicast group associated*/ - mifi_t mf6c_parent; /* incoming IF */ + mifi_t mf6c_parent; /* incoming IF */ struct if_set mf6c_ifset; /* set of outgoing IFs */ - u_int64_t mf6c_pkt_cnt; /* pkt count for src-grp */ - u_int64_t mf6c_byte_cnt; /* byte count for src-grp */ - u_int64_t mf6c_wrong_if; /* wrong if for src-grp */ - int mf6c_expire; /* time to clean entry up */ + u_int64_t mf6c_pkt_cnt; /* pkt count for src-grp */ + u_int64_t mf6c_byte_cnt; /* byte count for src-grp */ + u_int64_t mf6c_wrong_if; /* wrong if for src-grp */ + int mf6c_expire; /* time to clean entry up */ struct timeval mf6c_last_assert; /* last time I sent an assert*/ struct rtdetq *mf6c_stall; /* pkts waiting for route */ struct mf6c *mf6c_next; /* hash table linkage */ @@ -232,8 +232,8 @@ struct mf6c { */ #ifndef _NETINET_IP_MROUTE_H_ struct rtdetq { /* XXX: rtdetq is also defined in ip_mroute.h */ - struct mbuf *m; /* A copy of the packet */ - struct ifnet *ifp; /* Interface pkt came in on */ + struct mbuf *m; /* A copy of the packet */ + struct ifnet *ifp; /* Interface pkt came in on */ struct rtdetq *next; }; #endif /* _NETINET_IP_MROUTE_H_ */ diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 58bcc92d159..e467ccdb871 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_output.c,v 1.172 2015/05/23 12:52:59 markus Exp $ */ +/* $OpenBSD: ip6_output.c,v 1.173 2015/06/08 22:19:28 krw Exp $ */ /* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */ /* @@ -154,7 +154,7 @@ struct idgen32_ctx ip6_id_ctx; */ int ip6_output(struct mbuf *m0, struct ip6_pktopts *opt, struct route_in6 *ro, - int flags, struct ip6_moptions *im6o, struct ifnet **ifpp, + int flags, struct ip6_moptions *im6o, struct ifnet **ifpp, struct inpcb *inp) { struct ip6_hdr *ip6; @@ -197,7 +197,7 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt, struct route_in6 *ro, do { \ if (hp) { \ struct ip6_ext *eh = (struct ip6_ext *)(hp); \ - error = ip6_copyexthdr((mp), (caddr_t)(hp), \ + error = ip6_copyexthdr((mp), (caddr_t)(hp), \ ((eh)->ip6e_len + 1) << 3); \ if (error) \ goto freehdrs; \ @@ -437,7 +437,7 @@ reroute: #endif /* initialize cached route */ - if (ro == 0) { + if (ro == NULL) { ro = &ip6route; bzero((caddr_t)ro, sizeof(*ro)); } @@ -1122,7 +1122,7 @@ ip6_insert_jumboopt(struct ip6_exthdrs *exthdrs, u_int32_t plen) * Insert fragment header and copy unfragmentable header portions. */ int -ip6_insertfraghdr(struct mbuf *m0, struct mbuf *m, int hlen, +ip6_insertfraghdr(struct mbuf *m0, struct mbuf *m, int hlen, struct ip6_frag **frghdrp) { struct mbuf *n, *mlast; @@ -1130,7 +1130,7 @@ ip6_insertfraghdr(struct mbuf *m0, struct mbuf *m, int hlen, if (hlen > sizeof(struct ip6_hdr)) { n = m_copym(m0, sizeof(struct ip6_hdr), hlen - sizeof(struct ip6_hdr), M_DONTWAIT); - if (n == 0) + if (n == NULL) return (ENOBUFS); m->m_next = n; } else @@ -1163,7 +1163,7 @@ ip6_insertfraghdr(struct mbuf *m0, struct mbuf *m, int hlen, } int -ip6_getpmtu(struct route_in6 *ro_pmtu, struct route_in6 *ro, +ip6_getpmtu(struct route_in6 *ro_pmtu, struct route_in6 *ro, struct ifnet *ifp, struct in6_addr *dst, u_long *mtup, int *alwaysfragp) { u_int32_t mtu = 0; @@ -1180,7 +1180,7 @@ ip6_getpmtu(struct route_in6 *ro_pmtu, struct route_in6 *ro, rtfree(ro_pmtu->ro_rt); ro_pmtu->ro_rt = NULL; } - if (ro_pmtu->ro_rt == 0) { + if (ro_pmtu->ro_rt == NULL) { bzero(ro_pmtu, sizeof(*ro_pmtu)); ro_pmtu->ro_tableid = ifp->if_rdomain; sa6_dst->sin6_family = AF_INET6; @@ -1239,7 +1239,7 @@ ip6_getpmtu(struct route_in6 *ro_pmtu, struct route_in6 *ro, * IP6 socket option processing. */ int -ip6_ctloutput(int op, struct socket *so, int level, int optname, +ip6_ctloutput(int op, struct socket *so, int level, int optname, struct mbuf **mp) { int privileged, optdatalen, uproto; @@ -1919,7 +1919,7 @@ do { \ } int -ip6_raw_ctloutput(int op, struct socket *so, int level, int optname, +ip6_raw_ctloutput(int op, struct socket *so, int level, int optname, struct mbuf **mp) { int error = 0, optval; @@ -2608,7 +2608,7 @@ ip6_freemoptions(struct ip6_moptions *im6o) * Set IPv6 outgoing packet options based on advanced API. */ int -ip6_setpktopts(struct mbuf *control, struct ip6_pktopts *opt, +ip6_setpktopts(struct mbuf *control, struct ip6_pktopts *opt, struct ip6_pktopts *stickyopt, int priv, int uproto) { u_int clen; @@ -3168,7 +3168,7 @@ in6_delayed_cksum(struct mbuf *m, u_int8_t nxt) int nxtp, offset; u_int16_t csum; - offset = ip6_lasthdr(m, 0, IPPROTO_IPV6, &nxtp); + offset = ip6_lasthdr(m, 0, IPPROTO_IPV6, &nxtp); if (offset <= 0 || nxtp != nxt) /* If the desired next protocol isn't found, punt. */ return; diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 4f87e5a6a8e..7936cad3c97 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6.c,v 1.137 2015/06/06 09:31:53 mpi Exp $ */ +/* $OpenBSD: nd6.c,v 1.138 2015/06/08 22:19:28 krw Exp $ */ /* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */ /* @@ -1316,7 +1316,7 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp) * code - type dependent information */ struct rtentry * -nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *from, char *lladdr, +nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *from, char *lladdr, int lladdrlen, int type, int code) { struct rtentry *rt = NULL; @@ -1489,7 +1489,7 @@ fail: * 0 n y -- (3) c s s * 0 y y n (4) c s s * 0 y y y (5) c s s - * 1 -- n -- (6) c c c s + * 1 -- n -- (6) c c c s * 1 -- y -- (7) c c s c s * * (c=clear s=set) diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index aacbb4b194d..8e6ecb03818 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6_rtr.c,v 1.105 2015/06/04 09:51:15 mpi Exp $ */ +/* $OpenBSD: nd6_rtr.c,v 1.106 2015/06/08 22:19:28 krw Exp $ */ /* $KAME: nd6_rtr.c,v 1.97 2001/02/07 11:09:13 itojun Exp $ */ /* @@ -218,7 +218,7 @@ nd6_rs_output(struct ifnet* ifp, struct in6_ifaddr *ia6) /* ip6->ip6_plen will be set later */ ip6->ip6_nxt = IPPROTO_ICMPV6; ip6->ip6_hlim = 255; - + ip6->ip6_dst = in6addr_linklocal_allrouters; ip6->ip6_src = ia6->ia_addr.sin6_addr; @@ -998,7 +998,7 @@ purge_detached(struct ifnet *ifp) } int -nd6_prelist_add(struct nd_prefix *pr, struct nd_defrouter *dr, +nd6_prelist_add(struct nd_prefix *pr, struct nd_defrouter *dr, struct nd_prefix **newp) { struct nd_prefix *new = NULL; @@ -1395,7 +1395,7 @@ nd6_addr_add(void *prptr) autoconf = 1; privacy = (pr->ndpr_ifp->if_xflags & IFXF_INET6_NOPRIVACY) == 0; - /* + /* * Check again if a non-deprecated address has already * been autoconfigured for this prefix. */ @@ -1561,7 +1561,7 @@ pfxlist_onlink_check(void) * interfaces. Such cases will be handled in nd6_prefix_onlink, * so we don't have to care about them. */ - LIST_FOREACH(pr, &nd_prefix, ndpr_entry) { + LIST_FOREACH(pr, &nd_prefix, ndpr_entry) { int e; if (IN6_IS_ADDR_LINKLOCAL(&pr->ndpr_prefix.sin6_addr)) diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index 00f0bf52257..83a8d75c14a 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raw_ip6.c,v 1.73 2015/03/04 11:10:55 mpi Exp $ */ +/* $OpenBSD: raw_ip6.c,v 1.74 2015/06/08 22:19:28 krw Exp $ */ /* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */ /* @@ -503,7 +503,7 @@ rip6_output(struct mbuf *m, ...) * Raw IPv6 socket option processing. */ int -rip6_ctloutput(int op, struct socket *so, int level, int optname, +rip6_ctloutput(int op, struct socket *so, int level, int optname, struct mbuf **mp) { struct inpcb *inp = sotoinpcb(so); @@ -517,17 +517,17 @@ rip6_ctloutput(int op, struct socket *so, int level, int optname, case IP_DIVERTFL: switch (op) { case PRCO_SETOPT: - if (*mp == 0 || (*mp)->m_len < sizeof (int)) { + if (*mp == NULL || (*mp)->m_len < sizeof(int)) { error = EINVAL; break; } dir = *mtod(*mp, int *); if (inp->inp_divertfl > 0) error = ENOTSUP; - else if ((dir & IPPROTO_DIVERT_RESP) || + else if ((dir & IPPROTO_DIVERT_RESP) || (dir & IPPROTO_DIVERT_INIT)) inp->inp_divertfl = dir; - else + else error = EINVAL; break; @@ -588,7 +588,7 @@ extern u_long rip6_sendspace; extern u_long rip6_recvspace; int -rip6_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, +rip6_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, struct mbuf *control, struct proc *p) { struct inpcb *in6p = sotoinpcb(so); @@ -650,7 +650,7 @@ rip6_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, soisdisconnected(so); /* FALLTHROUGH */ case PRU_DETACH: - if (in6p == 0) + if (in6p == NULL) panic("rip6_detach"); #ifdef MROUTING if (so == ip6_mrouter) diff --git a/sys/netinet6/udp6_output.c b/sys/netinet6/udp6_output.c index 874d3088f1b..22555928ea2 100644 --- a/sys/netinet6/udp6_output.c +++ b/sys/netinet6/udp6_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udp6_output.c,v 1.34 2015/05/13 10:42:47 jsg Exp $ */ +/* $OpenBSD: udp6_output.c,v 1.35 2015/06/08 22:19:28 krw Exp $ */ /* $KAME: udp6_output.c,v 1.21 2001/02/07 11:51:54 itojun Exp $ */ /* @@ -93,7 +93,7 @@ * Per RFC 768, August, 1980. */ int -udp6_output(struct inpcb *in6p, struct mbuf *m, struct mbuf *addr6, +udp6_output(struct inpcb *in6p, struct mbuf *m, struct mbuf *addr6, struct mbuf *control) { u_int32_t ulen = m->m_pkthdr.len; @@ -201,8 +201,8 @@ udp6_output(struct inpcb *in6p, struct mbuf *m, struct mbuf *addr6, ip6 = mtod(m, struct ip6_hdr *); ip6->ip6_flow = in6p->inp_flowinfo & IPV6_FLOWINFO_MASK; - ip6->ip6_vfc &= ~IPV6_VERSION_MASK; - ip6->ip6_vfc |= IPV6_VERSION; + ip6->ip6_vfc &= ~IPV6_VERSION_MASK; + ip6->ip6_vfc |= IPV6_VERSION; #if 0 /* ip6_plen will be filled in ip6_output. */ ip6->ip6_plen = htons((u_short)plen); #endif |