diff options
-rw-r--r-- | sys/netinet6/ah_output.c | 4 | ||||
-rw-r--r-- | sys/netinet6/frag6.c | 6 | ||||
-rw-r--r-- | sys/netinet6/icmp6.c | 40 | ||||
-rw-r--r-- | sys/netinet6/in6.c | 122 | ||||
-rw-r--r-- | sys/netinet6/in6_gif.c | 4 | ||||
-rw-r--r-- | sys/netinet6/in6_ifattach.c | 6 | ||||
-rw-r--r-- | sys/netinet6/in6_pcb.c | 58 | ||||
-rw-r--r-- | sys/netinet6/in6_prefix.c | 20 | ||||
-rw-r--r-- | sys/netinet6/in6_proto.c | 8 | ||||
-rw-r--r-- | sys/netinet6/in6_src.c | 40 | ||||
-rw-r--r-- | sys/netinet6/ip6_fw.c | 58 | ||||
-rw-r--r-- | sys/netinet6/ip6_input.c | 34 | ||||
-rw-r--r-- | sys/netinet6/ip6_mroute.c | 131 | ||||
-rw-r--r-- | sys/netinet6/ip6_output.c | 104 | ||||
-rw-r--r-- | sys/netinet6/ipsec.c | 4 | ||||
-rw-r--r-- | sys/netinet6/nd6.c | 56 | ||||
-rw-r--r-- | sys/netinet6/nd6_rtr.c | 58 | ||||
-rw-r--r-- | sys/netinet6/raw_ip6.c | 6 | ||||
-rw-r--r-- | sys/netinet6/route6.c | 18 | ||||
-rw-r--r-- | sys/netinet6/scope6.c | 30 | ||||
-rw-r--r-- | sys/netinet6/udp6_output.c | 2 | ||||
-rw-r--r-- | sys/netinet6/udp6_usrreq.c | 2 |
22 files changed, 403 insertions, 408 deletions
diff --git a/sys/netinet6/ah_output.c b/sys/netinet6/ah_output.c index 0887c41..f4c4204 100644 --- a/sys/netinet6/ah_output.c +++ b/sys/netinet6/ah_output.c @@ -347,7 +347,7 @@ ah_hdrlen(sav) ahlen = plen + sizeof(struct newah); } - return(ahlen); + return (ahlen); } #ifdef INET6 @@ -495,7 +495,7 @@ ah6_output(m, nexthdrp, md, isr) } ipsec6stat.out_ahhist[sav->alg_auth]++; - return(error); + return (error); } #endif diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c index 28908ea..96c1a1b 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -149,7 +149,7 @@ frag6_input(mp, offp, proto) #else IP6_EXTHDR_GET(ip6f, struct ip6_frag *, m, offset, sizeof(*ip6f)); if (ip6f == NULL) - return IPPROTO_DONE; + return (IPPROTO_DONE); #endif dstifp = NULL; @@ -275,7 +275,7 @@ frag6_input(mp, offp, proto) offset - sizeof(struct ip6_frag) + offsetof(struct ip6_frag, ip6f_offlg)); frag6_doing_reass = 0; - return(IPPROTO_DONE); + return (IPPROTO_DONE); } } else if (fragoff + frgpartlen > IPV6_MAXPACKET) { @@ -283,7 +283,7 @@ frag6_input(mp, offp, proto) offset - sizeof(struct ip6_frag) + offsetof(struct ip6_frag, ip6f_offlg)); frag6_doing_reass = 0; - return(IPPROTO_DONE); + return (IPPROTO_DONE); } /* * If it's the first fragment, do the above check for each diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index 1373131..07b3373 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -848,7 +848,7 @@ icmp6_input(mp, offp, proto) deliver: if (icmp6_notify_error(m, off, icmp6len, code)) { /* In this case, m should've been freed. */ - return(IPPROTO_DONE); + return (IPPROTO_DONE); } break; @@ -895,7 +895,7 @@ icmp6_notify_error(m, off, icmp6len, code) sizeof(*icmp6) + sizeof(struct ip6_hdr)); if (icmp6 == NULL) { icmp6stat.icp6s_tooshort++; - return(-1); + return (-1); } #endif eip6 = (struct ip6_hdr *)(icmp6 + 1); @@ -932,7 +932,7 @@ icmp6_notify_error(m, off, icmp6len, code) eoff, sizeof(*eh)); if (eh == NULL) { icmp6stat.icp6s_tooshort++; - return(-1); + return (-1); } #endif @@ -961,7 +961,7 @@ icmp6_notify_error(m, off, icmp6len, code) eoff, sizeof(*rth)); if (rth == NULL) { icmp6stat.icp6s_tooshort++; - return(-1); + return (-1); } #endif rthlen = (rth->ip6r_len + 1) << 3; @@ -987,7 +987,7 @@ icmp6_notify_error(m, off, icmp6len, code) eoff, rthlen); if (rth0 == NULL) { icmp6stat.icp6s_tooshort++; - return(-1); + return (-1); } #endif /* just ignore a bogus header */ @@ -1010,7 +1010,7 @@ icmp6_notify_error(m, off, icmp6len, code) eoff, sizeof(*fh)); if (fh == NULL) { icmp6stat.icp6s_tooshort++; - return(-1); + return (-1); } #endif /* @@ -1045,7 +1045,7 @@ icmp6_notify_error(m, off, icmp6len, code) sizeof(*icmp6) + sizeof(struct ip6_hdr)); if (icmp6 == NULL) { icmp6stat.icp6s_tooshort++; - return(-1); + return (-1); } #endif @@ -1114,11 +1114,11 @@ icmp6_notify_error(m, off, icmp6len, code) &ip6cp); } } - return(0); + return (0); freeit: m_freem(m); - return(-1); + return (-1); } void @@ -1397,7 +1397,7 @@ ni6_input(m, off) MGETHDR(n, M_DONTWAIT, m->m_type); if (n == NULL) { m_freem(m); - return(NULL); + return (NULL); } M_MOVE_PKTHDR(n, m); /* just for recvif */ if (replylen > MHLEN) { @@ -1474,13 +1474,13 @@ ni6_input(m, off) nni6->ni_type = ICMP6_NI_REPLY; m_freem(m); - return(n); + return (n); bad: m_freem(m); if (n) m_freem(n); - return(NULL); + return (NULL); } #undef hostnamelen @@ -1672,7 +1672,7 @@ ni6_addrs(ni6, m, ifpp, subj) switch (ni6->ni_code) { case ICMP6_NI_SUBJ_IPV6: if (subj == NULL) /* must be impossible... */ - return(0); + return (0); subj_ip6 = (struct sockaddr_in6 *)subj; break; default: @@ -1680,7 +1680,7 @@ ni6_addrs(ni6, m, ifpp, subj) * XXX: we only support IPv6 subject address for * this Qtype. */ - return(0); + return (0); } } @@ -1743,14 +1743,14 @@ ni6_addrs(ni6, m, ifpp, subj) if (iffound) { *ifpp = ifp; IFNET_RUNLOCK(); - return(addrsofif); + return (addrsofif); } addrs += addrsofif; } IFNET_RUNLOCK(); - return(addrs); + return (addrs); } static int @@ -1769,7 +1769,7 @@ ni6_store_addrs(ni6, nni6, ifp0, resid) u_int32_t ltime; if (ifp0 == NULL && !(niflags & NI_NODEADDR_FLAG_ALL)) - return(0); /* needless to copy */ + return (0); /* needless to copy */ IFNET_RLOCK(); again: @@ -1839,7 +1839,7 @@ ni6_store_addrs(ni6, nni6, ifp0, resid) nni6->ni_flags |= NI_NODEADDR_FLAG_TRUNCATE; IFNET_RUNLOCK(); - return(copied); + return (copied); } /* @@ -1895,7 +1895,7 @@ ni6_store_addrs(ni6, nni6, ifp0, resid) IFNET_RUNLOCK(); - return(copied); + return (copied); } /* @@ -2785,7 +2785,7 @@ icmp6_ctloutput(so, sopt) break; } - return(error); + return (error); } #ifdef HAVE_NRL_INPCB #undef sotoin6pcb diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 838df1e..a887c35 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -338,10 +338,10 @@ in6_mask2len(mask, lim0) */ if (p < lim) { if (y != 0 && (*p & (0x00ff >> y)) != 0) - return(-1); + return (-1); for (p = p + 1; p < lim; p++) if (*p != 0) - return(-1); + return (-1); } return x * 8 + y; @@ -388,7 +388,7 @@ in6_control(so, cmd, data, ifp, td) } if (ifp == NULL) - return(EOPNOTSUPP); + return (EOPNOTSUPP); switch (cmd) { case SIOCSNDFLUSH_IN6: @@ -397,7 +397,7 @@ in6_control(so, cmd, data, ifp, td) case SIOCSDEFIFACE_IN6: case SIOCSIFINFO_FLAGS: if (!privileged) - return(EPERM); + return (EPERM); /* fall through */ case OSIOCGIFINFO_IN6: case SIOCGIFINFO_IN6: @@ -405,7 +405,7 @@ in6_control(so, cmd, data, ifp, td) case SIOCGPRLST_IN6: case SIOCGNBRINFO_IN6: case SIOCGDEFIFACE_IN6: - return(nd6_ioctl(cmd, data, ifp)); + return (nd6_ioctl(cmd, data, ifp)); } switch (cmd) { @@ -418,20 +418,20 @@ in6_control(so, cmd, data, ifp, td) log(LOG_NOTICE, "prefix ioctls are now invalidated. " "please use ifconfig.\n"); - return(EOPNOTSUPP); + return (EOPNOTSUPP); } switch (cmd) { case SIOCSSCOPE6: if (!privileged) - return(EPERM); - return(scope6_set(ifp, ifr->ifr_ifru.ifru_scope_id)); + return (EPERM); + return (scope6_set(ifp, ifr->ifr_ifru.ifru_scope_id)); break; case SIOCGSCOPE6: - return(scope6_get(ifp, ifr->ifr_ifru.ifru_scope_id)); + return (scope6_get(ifp, ifr->ifr_ifru.ifru_scope_id)); break; case SIOCGSCOPE6DEF: - return(scope6_get_default(ifr->ifr_ifru.ifru_scope_id)); + return (scope6_get_default(ifr->ifr_ifru.ifru_scope_id)); break; } @@ -439,7 +439,7 @@ in6_control(so, cmd, data, ifp, td) case SIOCALIFADDR: case SIOCDLIFADDR: if (!privileged) - return(EPERM); + return (EPERM); /* fall through */ case SIOCGLIFADDR: return in6_lifaddr_ioctl(so, cmd, data, ifp, td); @@ -459,12 +459,12 @@ in6_control(so, cmd, data, ifp, td) htons(ifp->if_index); } else if (sa6->sin6_addr.s6_addr16[1] != htons(ifp->if_index)) { - return(EINVAL); /* link ID contradicts */ + return (EINVAL); /* link ID contradicts */ } if (sa6->sin6_scope_id) { if (sa6->sin6_scope_id != (u_int32_t)ifp->if_index) - return(EINVAL); + return (EINVAL); sa6->sin6_scope_id = 0; /* XXX: good way? */ } } @@ -481,7 +481,7 @@ in6_control(so, cmd, data, ifp, td) * and should be unused. */ /* we decided to obsolete this command (20000704) */ - return(EINVAL); + return (EINVAL); case SIOCDIFADDR_IN6: /* @@ -492,7 +492,7 @@ in6_control(so, cmd, data, ifp, td) * semantics to be not preferable. */ if (ia == NULL) - return(EADDRNOTAVAIL); + return (EADDRNOTAVAIL); /* FALLTHROUGH */ case SIOCAIFADDR_IN6: /* @@ -501,9 +501,9 @@ in6_control(so, cmd, data, ifp, td) */ if (ifra->ifra_addr.sin6_family != AF_INET6 || ifra->ifra_addr.sin6_len != sizeof(struct sockaddr_in6)) - return(EAFNOSUPPORT); + return (EAFNOSUPPORT); if (!privileged) - return(EPERM); + return (EPERM); break; @@ -516,16 +516,16 @@ in6_control(so, cmd, data, ifp, td) case SIOCGIFALIFETIME_IN6: /* must think again about its semantics */ if (ia == NULL) - return(EADDRNOTAVAIL); + return (EADDRNOTAVAIL); break; case SIOCSIFALIFETIME_IN6: { struct in6_addrlifetime *lt; if (!privileged) - return(EPERM); + return (EPERM); if (ia == NULL) - return(EADDRNOTAVAIL); + return (EADDRNOTAVAIL); /* sanity for overflow - beware unsigned */ lt = &ifr->ifr_ifru.ifru_lifetime; if (lt->ia6t_vltime != ND6_INFINITE_LIFETIME @@ -548,7 +548,7 @@ in6_control(so, cmd, data, ifp, td) case SIOCGIFDSTADDR_IN6: if ((ifp->if_flags & IFF_POINTOPOINT) == 0) - return(EINVAL); + return (EINVAL); /* * XXX: should we check if ifa_dstaddr is NULL and return * an error? @@ -618,7 +618,7 @@ in6_control(so, cmd, data, ifp, td) * and link it to the list. */ if ((error = in6_update_ifa(ifp, ifra, ia)) != 0) - return(error); + return (error); /* * then, make the prefix on-link on the interface. @@ -664,11 +664,11 @@ in6_control(so, cmd, data, ifp, td) * interface route. */ if ((error = nd6_prelist_add(&pr0, NULL, &pr)) != 0) - return(error); + return (error); if (pr == NULL) { log(LOG_ERR, "nd6_prelist_add succedded but " "no prefix\n"); - return(EINVAL); /* XXX panic here? */ + return (EINVAL); /* XXX panic here? */ } } if ((ia = in6ifa_ifpwithaddr(ifp, &ifra->ifra_addr.sin6_addr)) @@ -759,11 +759,11 @@ in6_control(so, cmd, data, ifp, td) default: if (ifp == NULL || ifp->if_ioctl == 0) - return(EOPNOTSUPP); - return((*ifp->if_ioctl)(ifp, cmd, data)); + return (EOPNOTSUPP); + return ((*ifp->if_ioctl)(ifp, cmd, data)); } - return(0); + return (0); } /* @@ -785,7 +785,7 @@ in6_update_ifa(ifp, ifra, ia) /* Validate parameters */ if (ifp == NULL || ifra == NULL) /* this maybe redundant */ - return(EINVAL); + return (EINVAL); /* * The destination address for a p2p link must have a family @@ -794,13 +794,13 @@ in6_update_ifa(ifp, ifra, ia) if ((ifp->if_flags & IFF_POINTOPOINT) != 0 && ifra->ifra_dstaddr.sin6_family != AF_INET6 && ifra->ifra_dstaddr.sin6_family != AF_UNSPEC) - return(EAFNOSUPPORT); + return (EAFNOSUPPORT); /* * validate ifra_prefixmask. don't check sin6_family, netmask * does not carry fields other than sin6_len. */ if (ifra->ifra_prefixmask.sin6_len > sizeof(struct sockaddr_in6)) - return(EINVAL); + return (EINVAL); /* * Because the IPv6 address architecture is classless, we require * users to specify a (non 0) prefix length (mask) for a new address. @@ -808,13 +808,13 @@ in6_update_ifa(ifp, ifra, ia) * reject a non-consecutive mask. */ if (ia == NULL && ifra->ifra_prefixmask.sin6_len == 0) - return(EINVAL); + return (EINVAL); if (ifra->ifra_prefixmask.sin6_len != 0) { plen = in6_mask2len(&ifra->ifra_prefixmask.sin6_addr, (u_char *)&ifra->ifra_prefixmask + ifra->ifra_prefixmask.sin6_len); if (plen <= 0) - return(EINVAL); + return (EINVAL); } else { /* @@ -837,17 +837,17 @@ in6_update_ifa(ifp, ifra, ia) if ((error = in6_recoverscope(&dst6, &ifra->ifra_dstaddr.sin6_addr, ifp)) != 0) - return(error); + return (error); #endif scopeid = in6_addr2scopeid(ifp, &dst6.sin6_addr); if (dst6.sin6_scope_id == 0) /* user omit to specify the ID. */ dst6.sin6_scope_id = scopeid; else if (dst6.sin6_scope_id != scopeid) - return(EINVAL); /* scope ID mismatch. */ + return (EINVAL); /* scope ID mismatch. */ #ifndef SCOPEDROUTING if ((error = in6_embedscope(&dst6.sin6_addr, &dst6, NULL, NULL)) != 0) - return(error); + return (error); dst6.sin6_scope_id = 0; /* XXX */ #endif } @@ -861,7 +861,7 @@ in6_update_ifa(ifp, ifra, ia) /* XXX: noisy message */ log(LOG_INFO, "in6_update_ifa: a destination can be " "specified for a p2p or a loopback IF only\n"); - return(EINVAL); + return (EINVAL); } if (plen != 128) { /* @@ -870,7 +870,7 @@ in6_update_ifa(ifp, ifra, ia) */ log(LOG_INFO, "in6_update_ifa: prefixlen must be 128 " "when dstaddr is specified\n"); - return(EINVAL); + return (EINVAL); } } /* lifetime consistency check */ @@ -998,7 +998,7 @@ in6_update_ifa(ifp, ifra, ia) iilen = (sizeof(ia->ia_prefixmask.sin6_addr) << 3) - plen; if ((error = in6_prefix_add_ifid(iilen, ia)) != 0) { in6_purgeaddr((struct ifaddr *)ia); - return(error); + return (error); } } #endif @@ -1028,7 +1028,7 @@ in6_update_ifa(ifp, ifra, ia) ip6_sprintf(&llsol), if_name(ifp), error); in6_purgeaddr((struct ifaddr *)ia); - return(error); + return (error); } } @@ -1154,7 +1154,7 @@ in6_update_ifa(ifp, ifra, ia) nd6_dad_start((struct ifaddr *)ia, NULL); } - return(error); + return (error); unlink: /* @@ -1163,7 +1163,7 @@ in6_update_ifa(ifp, ifra, ia) */ if (hostIsNew) in6_unlink_ifa(ia, ifp); - return(error); + return (error); } void @@ -1605,7 +1605,7 @@ in6_ifinit(ifp, ia, sin6, newhost) if (ifacount <= 1 && ifp->if_ioctl && (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia))) { splx(s); - return(error); + return (error); } splx(s); @@ -1623,7 +1623,7 @@ in6_ifinit(ifp, ia, sin6, newhost) if (plen == 128 && ia->ia_dstaddr.sin6_family == AF_INET6) { if ((error = rtinit(&(ia->ia_ifa), (int)RTM_ADD, RTF_UP | RTF_HOST)) != 0) - return(error); + return (error); ia->ia_flags |= IFA_ROUTE; } if (plen < 128) { @@ -1640,7 +1640,7 @@ in6_ifinit(ifp, ia, sin6, newhost) in6_ifaddloop(&(ia->ia_ifa)); } - return(error); + return (error); } /* @@ -1703,7 +1703,7 @@ in6_addmulti(maddr6, ifp, errorp) */ mld6_start_listening(in6m); splx(s); - return(in6m); + return (in6m); } /* @@ -1755,7 +1755,7 @@ in6ifa_ifpforlinklocal(ifp, ignoreflags) } } - return((struct in6_ifaddr *)ifa); + return ((struct in6_ifaddr *)ifa); } @@ -1779,7 +1779,7 @@ in6ifa_ifpwithaddr(ifp, addr) break; } - return((struct in6_ifaddr *)ifa); + return ((struct in6_ifaddr *)ifa); } /* @@ -1833,7 +1833,7 @@ ip6_sprintf(addr) a++; } *--cp = 0; - return(ip6buf[ip6round]); + return (ip6buf[ip6round]); } int @@ -1866,12 +1866,12 @@ in6_is_addr_deprecated(sa6) ia->ia_addr.sin6_scope_id == sa6->sin6_scope_id && #endif (ia->ia6_flags & IN6_IFF_DEPRECATED) != 0) - return(1); /* true */ + return (1); /* true */ /* XXX: do we still have to go thru the rest of the list? */ } - return(0); /* false */ + return (0); /* false */ } /* @@ -1910,19 +1910,19 @@ in6_are_prefix_equal(p1, p2, len) if (0 > len || len > 128) { log(LOG_ERR, "in6_are_prefix_equal: invalid prefix length(%d)\n", len); - return(0); + return (0); } bytelen = len / 8; bitlen = len % 8; if (bcmp(&p1->s6_addr, &p2->s6_addr, bytelen)) - return(0); + return (0); if (p1->s6_addr[bytelen] >> (8 - bitlen) != p2->s6_addr[bytelen] >> (8 - bitlen)) - return(0); + return (0); - return(1); + return (1); } void @@ -1967,7 +1967,7 @@ in6_ifawithscope(oifp, dst) #if 0 printf("in6_ifawithscope: output interface is not specified\n"); #endif - return(NULL); + return (NULL); } /* @@ -2227,7 +2227,7 @@ in6_ifawithscope(oifp, dst) ip6stat.ip6s_sources_deprecated[best_scope]++; } - return(ifa_best); + return (ifa_best); } /* @@ -2285,7 +2285,7 @@ in6_ifawithifp(ifp, dst) } } if (besta) - return(besta); + return (besta); TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) { @@ -2347,7 +2347,7 @@ in6if_do_dad(ifp) struct ifnet *ifp; { if ((ifp->if_flags & IFF_LOOPBACK) != 0) - return(0); + return (0); switch (ifp->if_type) { #ifdef IFT_DUMMY @@ -2360,7 +2360,7 @@ in6if_do_dad(ifp) * interfaces. We should even omit it, because loop-backed * NS would confuse the DAD procedure. */ - return(0); + return (0); default: /* * Our DAD routine requires the interface up and running. @@ -2373,9 +2373,9 @@ in6if_do_dad(ifp) */ if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) - return(0); + return (0); - return(1); + return (1); } } diff --git a/sys/netinet6/in6_gif.c b/sys/netinet6/in6_gif.c index b560075..1531891 100644 --- a/sys/netinet6/in6_gif.c +++ b/sys/netinet6/in6_gif.c @@ -215,9 +215,9 @@ in6_gif_output(ifp, family, m) * it is too painful to ask for resend of inner packet, to achieve * path MTU discovery for encapsulated packets. */ - return(ip6_output(m, 0, &sc->gif_ro6, IPV6_MINMTU, 0, NULL, NULL)); + return (ip6_output(m, 0, &sc->gif_ro6, IPV6_MINMTU, 0, NULL, NULL)); #else - return(ip6_output(m, 0, &sc->gif_ro6, 0, 0, NULL, NULL)); + return (ip6_output(m, 0, &sc->gif_ro6, 0, 0, NULL, NULL)); #endif } diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c index 24df8fe..6773f10 100644 --- a/sys/netinet6/in6_ifattach.c +++ b/sys/netinet6/in6_ifattach.c @@ -507,7 +507,7 @@ in6_ifattach_linklocal(ifp, altifp) "configure a link-local address on %s " "(errno=%d)\n", if_name(ifp), error); - return(-1); + return (-1); } /* @@ -562,7 +562,7 @@ in6_ifattach_linklocal(ifp, altifp) */ if (nd6_prefix_lookup(&pr0) == NULL) { if ((error = nd6_prelist_add(&pr0, NULL, NULL)) != 0) - return(error); + return (error); } return 0; @@ -617,7 +617,7 @@ in6_ifattach_loopback(ifp) log(LOG_ERR, "in6_ifattach_loopback: failed to configure " "the loopback address on %s (errno=%d)\n", if_name(ifp), error); - return(-1); + return (-1); } return 0; diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 36130ff..170c6ff 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -138,18 +138,18 @@ in6_pcbbind(inp, nam, td) if (!in6_ifaddr) /* XXX broken! */ return (EADDRNOTAVAIL); if (inp->inp_lport || !IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) - return(EINVAL); + return (EINVAL); if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) == 0) wild = 1; if (nam) { sin6 = (struct sockaddr_in6 *)nam; if (nam->sa_len != sizeof(*sin6)) - return(EINVAL); + return (EINVAL); /* * family check. */ if (nam->sa_family != AF_INET6) - return(EAFNOSUPPORT); + return (EAFNOSUPPORT); /* KAME hack: embed scopeid */ if (in6_embedscope(&sin6->sin6_addr, sin6, inp, NULL) != 0) @@ -173,7 +173,7 @@ in6_pcbbind(inp, nam, td) sin6->sin6_port = 0; /* yech... */ if ((ia = ifa_ifwithaddr((struct sockaddr *)sin6)) == 0) - return(EADDRNOTAVAIL); + return (EADDRNOTAVAIL); /* * XXX: bind to an anycast address might accidentally @@ -184,7 +184,7 @@ in6_pcbbind(inp, nam, td) if (ia && ((struct in6_ifaddr *)ia)->ia6_flags & (IN6_IFF_ANYCAST|IN6_IFF_NOTREADY|IN6_IFF_DETACHED)) { - return(EADDRNOTAVAIL); + return (EADDRNOTAVAIL); } } if (lport) { @@ -193,7 +193,7 @@ in6_pcbbind(inp, nam, td) /* GROSS */ if (ntohs(lport) < IPV6PORT_RESERVED && td && suser_cred(td->td_ucred, PRISON_ROOT)) - return(EACCES); + return (EACCES); if (so->so_cred->cr_uid != 0 && !IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) { t = in6_pcblookup_local(pcbinfo, @@ -246,7 +246,7 @@ in6_pcbbind(inp, nam, td) if (t && (reuseport & ((t->inp_vflag & INP_TIMEWAIT) ? intotw(t)->tw_so_options : t->inp_socket->so_options)) == 0) - return(EADDRINUSE); + return (EADDRINUSE); if ((inp->inp_flags & IN6P_IPV6_V6ONLY) == 0 && IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { struct sockaddr_in sin; @@ -276,7 +276,7 @@ in6_pcbbind(inp, nam, td) if (lport == 0) { int e; if ((e = in6_pcbsetport(&inp->in6p_laddr, inp, td)) != 0) - return(e); + return (e); } else { inp->inp_lport = lport; @@ -286,7 +286,7 @@ in6_pcbbind(inp, nam, td) return (EAGAIN); } } - return(0); + return (0); } /* @@ -343,7 +343,7 @@ in6_pcbladdr(inp, nam, plocal_addr6) if (*plocal_addr6 == 0) { if (error == 0) error = EADDRNOTAVAIL; - return(error); + return (error); } /* * Don't do pcblookup call here; return interface in @@ -355,7 +355,7 @@ in6_pcbladdr(inp, nam, plocal_addr6) if (inp->in6p_route.ro_rt) ifp = inp->in6p_route.ro_rt->rt_ifp; - return(0); + return (0); } /* @@ -380,7 +380,7 @@ in6_pcbconnect(inp, nam, td) * in6_pcbladdr() may automatically fill in sin6_scope_id. */ if ((error = in6_pcbladdr(inp, nam, &addr6)) != 0) - return(error); + return (error); if (in6_pcblookup_hash(inp->inp_pcbinfo, &sin6->sin6_addr, sin6->sin6_port, @@ -442,14 +442,14 @@ in6_selectsrc(dstsock, opts, mopts, ro, laddr, errorp) */ if (opts && (pi = opts->ip6po_pktinfo) && !IN6_IS_ADDR_UNSPECIFIED(&pi->ipi6_addr)) - return(&pi->ipi6_addr); + return (&pi->ipi6_addr); /* * If the source address is not specified but the socket(if any) * is already bound, use the bound address. */ if (laddr && !IN6_IS_ADDR_UNSPECIFIED(laddr)) - return(laddr); + return (laddr); /* * If the caller doesn't specify the source address but @@ -461,9 +461,9 @@ in6_selectsrc(dstsock, opts, mopts, ro, laddr, errorp) ia6 = in6_ifawithscope(ifnet_byindex(pi->ipi6_ifindex), dst); if (ia6 == 0) { *errorp = EADDRNOTAVAIL; - return(0); + return (0); } - return(&satosin6(&ia6->ia_addr)->sin6_addr); + return (&satosin6(&ia6->ia_addr)->sin6_addr); } /* @@ -484,15 +484,15 @@ in6_selectsrc(dstsock, opts, mopts, ro, laddr, errorp) if (dstsock->sin6_scope_id < 0 || if_index < dstsock->sin6_scope_id) { *errorp = ENXIO; /* XXX: better error? */ - return(0); + return (0); } ia6 = in6_ifawithscope(ifnet_byindex(dstsock->sin6_scope_id), dst); if (ia6 == 0) { *errorp = EADDRNOTAVAIL; - return(0); + return (0); } - return(&satosin6(&ia6->ia_addr)->sin6_addr); + return (&satosin6(&ia6->ia_addr)->sin6_addr); } /* @@ -515,9 +515,9 @@ in6_selectsrc(dstsock, opts, mopts, ro, laddr, errorp) ia6 = in6_ifawithscope(ifp, dst); if (ia6 == 0) { *errorp = EADDRNOTAVAIL; - return(0); + return (0); } - return(&ia6->ia_addr.sin6_addr); + return (&ia6->ia_addr.sin6_addr); } } @@ -540,9 +540,9 @@ in6_selectsrc(dstsock, opts, mopts, ro, laddr, errorp) } if (ia6 == 0) { *errorp = EADDRNOTAVAIL; - return(0); + return (0); } - return(&satosin6(&ia6->ia_addr)->sin6_addr); + return (&satosin6(&ia6->ia_addr)->sin6_addr); } } @@ -589,13 +589,13 @@ in6_selectsrc(dstsock, opts, mopts, ro, laddr, errorp) } if (ia6 == 0) { *errorp = EHOSTUNREACH; /* no route */ - return(0); + return (0); } - return(&satosin6(&ia6->ia_addr)->sin6_addr); + return (&satosin6(&ia6->ia_addr)->sin6_addr); } *errorp = EADDRNOTAVAIL; - return(0); + return (0); } /* @@ -611,11 +611,11 @@ in6_selecthlim(in6p, ifp) struct ifnet *ifp; { if (in6p && in6p->in6p_hops >= 0) - return(in6p->in6p_hops); + return (in6p->in6p_hops); else if (ifp) - return(nd_ifinfo[ifp->if_index].chlim); + return (nd_ifinfo[ifp->if_index].chlim); else - return(ip6_defhlim); + return (ip6_defhlim); } #endif diff --git a/sys/netinet6/in6_prefix.c b/sys/netinet6/in6_prefix.c index 4292cd4..6e4b94a 100644 --- a/sys/netinet6/in6_prefix.c +++ b/sys/netinet6/in6_prefix.c @@ -351,7 +351,7 @@ rr_are_ifid_equal(struct in6_addr *ii1, struct in6_addr *ii2, int ii_len) ii_len > 124) { /* as RFC2373, prefix is at least 4 bit */ log(LOG_ERR, "rr_are_ifid_equal: invalid ifid length(%d)\n", ii_len); - return(0); + return (0); } ii_bytelen = ii_len / 8; @@ -362,12 +362,12 @@ rr_are_ifid_equal(struct in6_addr *ii1, struct in6_addr *ii2, int ii_len) if (bcmp(ii1->s6_addr + p_bytelen + 1, ii2->s6_addr + p_bytelen + 1, ii_bytelen)) - return(0); + return (0); if (((ii1->s6_addr[p_bytelen] << p_bitlen) & 0xff) != ((ii2->s6_addr[p_bytelen] << p_bitlen) & 0xff)) - return(0); + return (0); - return(1); + return (1); } static struct rp_addr * @@ -425,7 +425,7 @@ in6_prefix_add_llifid(int iilen, struct in6_ifaddr *ia) int error, s; if ((error = create_ra_entry(&rap)) != 0) - return(error); + return (error); /* copy interface id part */ bit_copy((caddr_t)&rap->ra_ifid, sizeof(rap->ra_ifid) << 3, (caddr_t)IA6_IN6(ia), sizeof(*IA6_IN6(ia)) << 3, @@ -462,7 +462,7 @@ in6_prefix_add_ifid(int iilen, struct in6_ifaddr *ia) int error = 0; if (IN6_IS_ADDR_LINKLOCAL(IA6_IN6(ia))) - return(in6_prefix_add_llifid(iilen, ia)); + return (in6_prefix_add_llifid(iilen, ia)); ifpr = in6_prefixwithifp(ia->ia_ifp, plen, IA6_IN6(ia)); if (ifpr == NULL) { struct rr_prefix rp; @@ -694,7 +694,7 @@ rrpr_update(struct socket *so, struct rr_prefix *new) * preferable than the new one, ignore installation request. */ if (rpp->rp_origin > new->rp_origin) - return(EPERM); + return (EPERM); /* update prefix information */ rpp->rp_flags.prf_ra = new->rp_flags.prf_ra; @@ -735,7 +735,7 @@ rrpr_update(struct socket *so, struct rr_prefix *new) if (rpp == NULL) { log(LOG_ERR, "in6_prefix.c: rrpr_update:%d" ": ENOBUFS for rr_prefix\n", __LINE__); - return(ENOBUFS); + return (ENOBUFS); } /* initilization */ *rpp = *new; @@ -796,7 +796,7 @@ static int add_each_prefix(struct socket *so, struct rr_prefix *rpp) { init_prefix_ltimes(rpp); - return(rrpr_update(so, rpp)); + return (rrpr_update(so, rpp)); } static void @@ -961,7 +961,7 @@ delete_each_prefix(struct rr_prefix *rpp, u_char origin) int error = 0; if (rpp->rp_origin > origin) - return(EPERM); + return (EPERM); while (rpp->rp_addrhead.lh_first != NULL) { struct rp_addr *rap; diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c index bd66dcb..2817b9b 100644 --- a/sys/netinet6/in6_proto.c +++ b/sys/netinet6/in6_proto.c @@ -368,9 +368,9 @@ sysctl_ip6_temppltime(SYSCTL_HANDLER_ARGS) if (ip6_temp_preferred_lifetime < ip6_desync_factor + ip6_temp_regen_advance) { ip6_temp_preferred_lifetime = old; - return(EINVAL); + return (EINVAL); } - return(error); + return (error); } static int @@ -386,9 +386,9 @@ sysctl_ip6_tempvltime(SYSCTL_HANDLER_ARGS) error = SYSCTL_IN(req, arg1, sizeof(int)); if (ip6_temp_valid_lifetime < ip6_temp_preferred_lifetime) { ip6_temp_preferred_lifetime = old; - return(EINVAL); + return (EINVAL); } - return(error); + return (error); } SYSCTL_INT(_net_inet6_ip6, IPV6CTL_FORWARDING, diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c index 84e73d6..ee4b6ce 100644 --- a/sys/netinet6/in6_src.c +++ b/sys/netinet6/in6_src.c @@ -125,14 +125,14 @@ in6_selectsrc(dstsock, opts, mopts, ro, laddr, errorp) */ if (opts && (pi = opts->ip6po_pktinfo) && !IN6_IS_ADDR_UNSPECIFIED(&pi->ipi6_addr)) - return(&pi->ipi6_addr); + return (&pi->ipi6_addr); /* * If the source address is not specified but the socket(if any) * is already bound, use the bound address. */ if (laddr && !IN6_IS_ADDR_UNSPECIFIED(laddr)) - return(laddr); + return (laddr); /* * If the caller doesn't specify the source address but @@ -144,9 +144,9 @@ in6_selectsrc(dstsock, opts, mopts, ro, laddr, errorp) ia6 = in6_ifawithscope(ifnet_byindex(pi->ipi6_ifindex), dst); if (ia6 == 0) { *errorp = EADDRNOTAVAIL; - return(0); + return (0); } - return(&satosin6(&ia6->ia_addr)->sin6_addr); + return (&satosin6(&ia6->ia_addr)->sin6_addr); } /* @@ -167,15 +167,15 @@ in6_selectsrc(dstsock, opts, mopts, ro, laddr, errorp) if (dstsock->sin6_scope_id < 0 || if_index < dstsock->sin6_scope_id) { *errorp = ENXIO; /* XXX: better error? */ - return(0); + return (0); } ia6 = in6_ifawithscope(ifnet_byindex(dstsock->sin6_scope_id), dst); if (ia6 == 0) { *errorp = EADDRNOTAVAIL; - return(0); + return (0); } - return(&satosin6(&ia6->ia_addr)->sin6_addr); + return (&satosin6(&ia6->ia_addr)->sin6_addr); } /* @@ -198,9 +198,9 @@ in6_selectsrc(dstsock, opts, mopts, ro, laddr, errorp) ia6 = in6_ifawithscope(ifp, dst); if (ia6 == 0) { *errorp = EADDRNOTAVAIL; - return(0); + return (0); } - return(&satosin6(&ia6->ia_addr)->sin6_addr); + return (&satosin6(&ia6->ia_addr)->sin6_addr); } } @@ -223,9 +223,9 @@ in6_selectsrc(dstsock, opts, mopts, ro, laddr, errorp) } if (ia6 == 0) { *errorp = EADDRNOTAVAIL; - return(0); + return (0); } - return(&satosin6(&ia6->ia_addr)->sin6_addr); + return (&satosin6(&ia6->ia_addr)->sin6_addr); } } @@ -289,19 +289,19 @@ in6_selectsrc(dstsock, opts, mopts, ro, laddr, errorp) if (ia6 == 0) ia6 = ifatoia6(ifa_ifwithnet(sin6tosa(&sin6))); if (ia6 == 0) - return(0); - return(&satosin6(&ia6->ia_addr)->sin6_addr); + return (0); + return (&satosin6(&ia6->ia_addr)->sin6_addr); } #endif /* 0 */ if (ia6 == 0) { *errorp = EHOSTUNREACH; /* no route */ - return(0); + return (0); } - return(&satosin6(&ia6->ia_addr)->sin6_addr); + return (&satosin6(&ia6->ia_addr)->sin6_addr); } *errorp = EADDRNOTAVAIL; - return(0); + return (0); } /* @@ -317,11 +317,11 @@ in6_selecthlim(in6p, ifp) struct ifnet *ifp; { if (in6p && in6p->in6p_hops >= 0) - return(in6p->in6p_hops); + return (in6p->in6p_hops); else if (ifp) - return(nd_ifinfo[ifp->if_index].chlim); + return (nd_ifinfo[ifp->if_index].chlim); else - return(ip6_defhlim); + return (ip6_defhlim); } /* @@ -418,7 +418,7 @@ in6_pcbsetport(laddr, inp, td) return (EAGAIN); } - return(0); + return (0); } /* diff --git a/sys/netinet6/ip6_fw.c b/sys/netinet6/ip6_fw.c index 55812a7..b60bec3 100644 --- a/sys/netinet6/ip6_fw.c +++ b/sys/netinet6/ip6_fw.c @@ -208,7 +208,7 @@ icmp6type_match(struct icmp6_hdr *icmp6, struct ip6_fw *f) int type; if (!(f->fw_flg & IPV6_FW_F_ICMPBIT)) - return(1); + return (1); type = icmp6->icmp6_type; @@ -216,9 +216,9 @@ icmp6type_match(struct icmp6_hdr *icmp6, struct ip6_fw *f) if (type < IPV6_FW_ICMPTYPES_DIM * sizeof(unsigned) * 8 && (f->fw_icmp6types[type / (sizeof(unsigned) * 8)] & (1U << (type % (8 * sizeof(unsigned)))))) - return(1); + return (1); - return(0); /* no match */ + return (0); /* no match */ } static int @@ -235,9 +235,9 @@ is_icmp6_query(struct ip6_hdr *ip6, int off) icmp6_type == ICMP6_WRUREQUEST || icmp6_type == ICMP6_FQDN_QUERY || icmp6_type == ICMP6_NI_QUERY) - return(1); + return (1); - return(0); + return (0); } static int @@ -327,11 +327,11 @@ iface_match(struct ifnet *ifp, union ip6_fw_if *ifu, int byname) /* Check unit number (-1 is wildcard) */ if (ifu->fu_via_if.unit != -1 && ifp->if_unit != ifu->fu_via_if.unit) - return(0); + return (0); /* Check name */ if (strncmp(ifp->if_name, ifu->fu_via_if.name, IP6FW_IFNLEN)) - return(0); - return(1); + return (0); + return (1); } else if (!IN6_IS_ADDR_UNSPECIFIED(&ifu->fu_via_ip6)) { /* Zero == wildcard */ struct ifaddr *ia; @@ -346,11 +346,11 @@ iface_match(struct ifnet *ifp, union ip6_fw_if *ifu, int byname) &(((struct sockaddr_in6 *) (ia->ifa_addr))->sin6_addr))) continue; - return(1); + return (1); } - return(0); + return (0); } - return(1); + return (1); } static void @@ -712,7 +712,7 @@ got_match: /* Take appropriate action */ switch (f->fw_flg & IPV6_FW_F_COMMAND) { case IPV6_FW_F_ACCEPT: - return(0); + return (0); case IPV6_FW_F_COUNT: continue; case IPV6_FW_F_DIVERT: @@ -721,7 +721,7 @@ got_match: #else *cookie = htons(f->fw_divert_port); #endif /* IP6FW_DIVERT_RESTART */ - return(f->fw_divert_port); + return (f->fw_divert_port); case IPV6_FW_F_TEE: /* * XXX someday tee packet here, but beware that you @@ -832,7 +832,7 @@ dropit: m_freem(*m); *m = NULL; } - return(0); + return (0); } static int @@ -863,7 +863,7 @@ add_entry6(struct ip6_fw_head *chainptr, struct ip6_fw *frwl) if (!chainptr->lh_first) { LIST_INSERT_HEAD(chainptr, fwc, chain); splx(s); - return(0); + return (0); } else if (ftmp->fw_number == (u_short)-1) { if (fwc) free(fwc, M_IP6FW); if (ftmp) free(ftmp, M_IP6FW); @@ -937,7 +937,7 @@ zero_entry6(struct mbuf *m) if (m && m->m_len != 0) { if (m->m_len != sizeof(struct ip6_fw)) - return(EINVAL); + return (EINVAL); frwl = mtod(m, struct ip6_fw *); } else @@ -965,7 +965,7 @@ zero_entry6(struct mbuf *m) "ip6fw: Accounting cleared.\n"); } - return(0); + return (0); } static struct ip6_fw * @@ -977,7 +977,7 @@ check_ip6fw_mbuf(struct mbuf *m) sizeof(struct ip6_fw))); return (NULL); } - return(check_ip6fw_struct(mtod(m, struct ip6_fw *))); + return (check_ip6fw_struct(mtod(m, struct ip6_fw *))); } static struct ip6_fw * @@ -1035,7 +1035,7 @@ check_ip6fw_struct(struct ip6_fw *frwl) (IPV6_FW_GETNSRCP(frwl) || IPV6_FW_GETNDSTP(frwl))) { dprintf(("%s port(s) specified for non TCP/UDP rule\n", err_prefix)); - return(NULL); + return (NULL); } /* @@ -1052,19 +1052,19 @@ check_ip6fw_struct(struct ip6_fw *frwl) (frwl->fw_dst.s6_addr32[2] & (~frwl->fw_dmsk.s6_addr32[2])) || (frwl->fw_dst.s6_addr32[3] & (~frwl->fw_dmsk.s6_addr32[3]))) { dprintf(("%s rule never matches\n", err_prefix)); - return(NULL); + return (NULL); } if ((frwl->fw_flg & IPV6_FW_F_FRAG) && (frwl->fw_prot == IPPROTO_UDP || frwl->fw_prot == IPPROTO_TCP)) { if (frwl->fw_nports) { dprintf(("%s cannot mix 'frag' and ports\n", err_prefix)); - return(NULL); + return (NULL); } if (frwl->fw_prot == IPPROTO_TCP && frwl->fw_tcpf != frwl->fw_tcpnf) { dprintf(("%s cannot mix 'frag' with TCP flags\n", err_prefix)); - return(NULL); + return (NULL); } } @@ -1076,7 +1076,7 @@ check_ip6fw_struct(struct ip6_fw *frwl) && !(frwl->fw_prot == IPPROTO_TCP && frwl->fw_reject_code == IPV6_FW_REJECT_RST)) { dprintf(("%s unknown reject code\n", err_prefix)); - return(NULL); + return (NULL); } break; case IPV6_FW_F_DIVERT: /* Diverting to port zero is invalid */ @@ -1093,7 +1093,7 @@ check_ip6fw_struct(struct ip6_fw *frwl) break; default: dprintf(("%s invalid command\n", err_prefix)); - return(NULL); + return (NULL); } return frwl; @@ -1109,12 +1109,12 @@ ip6_fw_ctl(int stage, struct mbuf **mm) struct ip6_fw_chain *fcp = ip6_fw_chain.lh_first; *mm = m = m_get(M_TRYWAIT, MT_DATA); /* XXX */ if (!m) - return(ENOBUFS); + return (ENOBUFS); if (sizeof *(fcp->rule) > MLEN) { MCLGET(m, M_TRYWAIT); if ((m->m_flags & M_EXT) == 0) { m_free(m); - return(ENOBUFS); + return (ENOBUFS); } } for (; fcp; fcp = fcp->chain.le_next) { @@ -1123,14 +1123,14 @@ ip6_fw_ctl(int stage, struct mbuf **mm) m->m_next = m_get(M_TRYWAIT, MT_DATA); /* XXX */ if (!m->m_next) { m_freem(*mm); - return(ENOBUFS); + return (ENOBUFS); } m = m->m_next; if (sizeof *(fcp->rule) > MLEN) { MCLGET(m, M_TRYWAIT); if ((m->m_flags & M_EXT) == 0) { m_freem(*mm); - return(ENOBUFS); + return (ENOBUFS); } } m->m_len = 0; @@ -1144,7 +1144,7 @@ ip6_fw_ctl(int stage, struct mbuf **mm) (void)m_freem(m); *mm = 0; } - return(EPERM); + return (EPERM); } if (stage == IPV6_FW_FLUSH) { while (ip6_fw_chain.lh_first != NULL && diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index cc368c4..d15eb02 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -904,11 +904,11 @@ ip6_hopopts_input(plenp, rtalertp, mp, offp) if (ip6_process_hopopts(m, (u_int8_t *)hbh + sizeof(struct ip6_hbh), hbhlen, rtalertp, plenp) < 0) - return(-1); + return (-1); *offp = off; *mp = m; - return(0); + return (0); } /* @@ -959,7 +959,7 @@ ip6_process_hopopts(m, opthead, hbhlen, rtalertp, plenp) icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, erroff + opt + 1 - opthead); - return(-1); + return (-1); } optlen = IP6OPT_RTALERT_LEN; bcopy((caddr_t)(opt + 2), (caddr_t)&rtalert_val, 2); @@ -976,7 +976,7 @@ ip6_process_hopopts(m, opthead, hbhlen, rtalertp, plenp) icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, erroff + opt + 1 - opthead); - return(-1); + return (-1); } optlen = IP6OPT_JUMBO_LEN; @@ -990,7 +990,7 @@ ip6_process_hopopts(m, opthead, hbhlen, rtalertp, plenp) icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, erroff + opt - opthead); - return(-1); + return (-1); } /* @@ -1014,7 +1014,7 @@ ip6_process_hopopts(m, opthead, hbhlen, rtalertp, plenp) icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, erroff + opt + 2 - opthead); - return(-1); + return (-1); } #endif @@ -1026,7 +1026,7 @@ ip6_process_hopopts(m, opthead, hbhlen, rtalertp, plenp) icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, erroff + opt + 2 - opthead); - return(-1); + return (-1); } *plenp = jumboplen; @@ -1039,17 +1039,17 @@ ip6_process_hopopts(m, opthead, hbhlen, rtalertp, plenp) optlen = ip6_unknown_opt(opt, m, erroff + opt - opthead); if (optlen == -1) - return(-1); + return (-1); optlen += 2; break; } } - return(0); + return (0); bad: m_freem(m); - return(-1); + return (-1); } /* @@ -1068,14 +1068,14 @@ ip6_unknown_opt(optp, m, off) switch (IP6OPT_TYPE(*optp)) { case IP6OPT_TYPE_SKIP: /* ignore the option */ - return((int)*(optp + 1)); + return ((int)*(optp + 1)); case IP6OPT_TYPE_DISCARD: /* silently discard */ m_freem(m); - return(-1); + return (-1); case IP6OPT_TYPE_FORCEICMP: /* send ICMP even if multicasted */ ip6stat.ip6s_badoptions++; icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_OPTION, off); - return(-1); + return (-1); case IP6OPT_TYPE_ICMP: /* send ICMP if not multicasted */ ip6stat.ip6s_badoptions++; ip6 = mtod(m, struct ip6_hdr *); @@ -1085,11 +1085,11 @@ ip6_unknown_opt(optp, m, off) else icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_OPTION, off); - return(-1); + return (-1); } m_freem(m); /* XXX: NOTREACHED */ - return(-1); + return (-1); } /* @@ -1445,7 +1445,7 @@ ip6_get_prevhdr(m, off) struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); if (off == sizeof(struct ip6_hdr)) - return(&ip6->ip6_nxt); + return (&ip6->ip6_nxt); else { int len, nxt; struct ip6_ext *ip6e = NULL; @@ -1469,7 +1469,7 @@ ip6_get_prevhdr(m, off) nxt = ip6e->ip6e_nxt; } if (ip6e) - return(&ip6e->ip6e_nxt); + return (&ip6e->ip6e_nxt); else return NULL; } diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index f1257d3..0857bf7 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -271,7 +271,7 @@ ip6_mrouter_set(so, sopt) } (void)m_freem(m); - return(error); + return (error); } /* @@ -284,7 +284,8 @@ ip6_mrouter_get(so, sopt) { int error = 0; - if (so != ip6_mrouter) return EACCES; + if (so != ip6_mrouter) + return (EACCES); switch (sopt->sopt_name) { case MRT6_PIM: @@ -302,20 +303,14 @@ mrt6_ioctl(cmd, data) int cmd; caddr_t data; { - int error = 0; - switch (cmd) { case SIOCGETSGCNT_IN6: - return(get_sg_cnt((struct sioc_sg_req6 *)data)); - break; /* for safety */ + return (get_sg_cnt((struct sioc_sg_req6 *)data)); case SIOCGETMIFCNT_IN6: - return(get_mif6_cnt((struct sioc_mif_req6 *)data)); - break; /* for safety */ + return (get_mif6_cnt((struct sioc_mif_req6 *)data)); default: return (EINVAL); - break; } - return error; } /* @@ -336,12 +331,12 @@ get_sg_cnt(req) req->bytecnt = rt->mf6c_byte_cnt; req->wrong_if = rt->mf6c_wrong_if; } else - return(ESRCH); + return (ESRCH); #if 0 req->pktcnt = req->bytecnt = req->wrong_if = 0xffffffff; #endif - return 0; + return (0); } /* @@ -354,14 +349,14 @@ get_mif6_cnt(req) mifi_t mifi = req->mifi; if (mifi >= nummifs) - return EINVAL; + return (EINVAL); req->icount = mif6table[mifi].m6_pkt_in; req->ocount = mif6table[mifi].m6_pkt_out; req->ibytes = mif6table[mifi].m6_bytes_in; req->obytes = mif6table[mifi].m6_bytes_out; - return 0; + return (0); } static int @@ -369,11 +364,11 @@ set_pim6(i) int *i; { if ((*i != 1) && (*i != 0)) - return EINVAL; + return (EINVAL); pim6 = *i; - return 0; + return (0); } /* @@ -396,16 +391,16 @@ ip6_mrouter_init(so, m, cmd) if (so->so_type != SOCK_RAW || so->so_proto->pr_protocol != IPPROTO_ICMPV6) - return EOPNOTSUPP; + return (EOPNOTSUPP); if (!m || (m->m_len != sizeof(int *))) - return ENOPROTOOPT; + return (ENOPROTOOPT); v = mtod(m, int *); if (*v != 1) - return ENOPROTOOPT; + return (ENOPROTOOPT); - if (ip6_mrouter != NULL) return EADDRINUSE; + if (ip6_mrouter != NULL) return (EADDRINUSE); ip6_mrouter = so; ip6_mrouter_ver = cmd; @@ -423,7 +418,7 @@ ip6_mrouter_init(so, m, cmd) log(LOG_DEBUG, "ip6_mrouter_init\n"); #endif - return 0; + return (0); } /* @@ -518,7 +513,7 @@ ip6_mrouter_done() log(LOG_DEBUG, "ip6_mrouter_done\n"); #endif - return 0; + return (0); } static struct sockaddr_in6 sin6 = { sizeof(sin6), AF_INET6 }; @@ -538,12 +533,12 @@ add_m6if(mifcp) #endif if (mifcp->mif6c_mifi >= MAXMIFS) - return EINVAL; + return (EINVAL); mifp = mif6table + mifcp->mif6c_mifi; if (mifp->m6_ifp) - return EADDRINUSE; /* XXX: is it appropriate? */ + return (EADDRINUSE); /* XXX: is it appropriate? */ if (mifcp->mif6c_pifi == 0 || mifcp->mif6c_pifi > if_index) - return ENXIO; + return (ENXIO); ifp = ifnet_byindex(mifcp->mif6c_pifi); if (mifcp->mif6c_flags & MIFF_REGISTER) { @@ -560,13 +555,13 @@ add_m6if(mifcp) else { /* Make sure the interface supports multicast */ if ((ifp->if_flags & IFF_MULTICAST) == 0) - return EOPNOTSUPP; + return (EOPNOTSUPP); s = splnet(); error = if_allmulti(ifp, 1); splx(s); if (error) - return error; + return (error); } s = splnet(); @@ -595,7 +590,7 @@ add_m6if(mifcp) ifp->if_name, ifp->if_unit); #endif - return 0; + return (0); } /* @@ -611,9 +606,9 @@ del_m6if(mifip) int s; if (*mifip >= nummifs) - return EINVAL; + return (EINVAL); if (mifp->m6_ifp == NULL) - return EINVAL; + return (EINVAL); s = splnet(); @@ -646,7 +641,7 @@ del_m6if(mifip) log(LOG_DEBUG, "del_m6if %d, nummifs %d\n", *mifip, nummifs); #endif - return 0; + return (0); } /* @@ -680,7 +675,7 @@ add_m6fc(mfccp) rt->mf6c_parent = mfccp->mf6cc_parent; rt->mf6c_ifset = mfccp->mf6cc_ifset; splx(s); - return 0; + return (0); } /* @@ -780,7 +775,7 @@ add_m6fc(mfccp) M_NOWAIT); if (rt == NULL) { splx(s); - return ENOBUFS; + return (ENOBUFS); } /* insert new entry at head of hash chain */ @@ -801,7 +796,7 @@ add_m6fc(mfccp) } } splx(s); - return 0; + return (0); } #ifdef UPCALL_TIMING @@ -871,7 +866,7 @@ del_m6fc(mfccp) } if (rt == NULL) { splx(s); - return EADDRNOTAVAIL; + return (EADDRNOTAVAIL); } *nptr = rt->mf6c_next; @@ -879,7 +874,7 @@ del_m6fc(mfccp) splx(s); - return 0; + return (0); } static int @@ -893,11 +888,11 @@ socket_send(s, mm, src) (struct sockaddr *)src, mm, (struct mbuf *)0) != 0) { sorwakeup(s); - return 0; + return (0); } } m_freem(mm); - return -1; + return (-1); } /* @@ -936,7 +931,7 @@ ip6_mforward(ip6, ifp, m) */ if (ip6->ip6_hlim <= 1 || IN6_IS_ADDR_MC_NODELOCAL(&ip6->ip6_dst) || IN6_IS_ADDR_MC_LINKLOCAL(&ip6->ip6_dst)) - return 0; + return (0); ip6->ip6_hlim--; /* @@ -958,7 +953,7 @@ ip6_mforward(ip6, ifp, m) ip6->ip6_nxt, if_name(m->m_pkthdr.rcvif)); } - return 0; + return (0); } /* @@ -1004,7 +999,7 @@ ip6_mforward(ip6, ifp, m) M_NOWAIT); if (rte == NULL) { splx(s); - return ENOBUFS; + return (ENOBUFS); } mb0 = m_copy(m, 0, M_COPYALL); /* @@ -1017,7 +1012,7 @@ ip6_mforward(ip6, ifp, m) if (mb0 == NULL) { free(rte, M_MRTABLE); splx(s); - return ENOBUFS; + return (ENOBUFS); } /* is there an upcall waiting for this packet? */ @@ -1044,7 +1039,7 @@ ip6_mforward(ip6, ifp, m) free(rte, M_MRTABLE); m_freem(mb0); splx(s); - return ENOBUFS; + return (ENOBUFS); } /* * Make a copy of the header to send to the user @@ -1057,7 +1052,7 @@ ip6_mforward(ip6, ifp, m) m_freem(mb0); free(rt, M_MRTABLE); splx(s); - return ENOBUFS; + return (ENOBUFS); } /* @@ -1087,7 +1082,7 @@ ip6_mforward(ip6, ifp, m) m_freem(mb0); free(rt, M_MRTABLE); splx(s); - return EINVAL; + return (EINVAL); } #ifdef MRT6DEBUG @@ -1120,7 +1115,7 @@ ip6_mforward(ip6, ifp, m) m_freem(mb0); free(rt, M_MRTABLE); splx(s); - return ENOBUFS; + return (ENOBUFS); } mrt6stat.mrt6s_upcalls++; @@ -1153,7 +1148,7 @@ ip6_mforward(ip6, ifp, m) free(rte, M_MRTABLE); m_freem(mb0); splx(s); - return 0; + return (0); } /* Add this entry to the end of the queue */ @@ -1169,7 +1164,7 @@ ip6_mforward(ip6, ifp, m) splx(s); - return 0; + return (0); } } @@ -1303,7 +1298,7 @@ ip6_mdq(m, ifp, rt) mm->m_len < sizeof(struct ip6_hdr))) mm = m_pullup(mm, sizeof(struct ip6_hdr)); if (mm == NULL) - return ENOBUFS; + return (ENOBUFS); #ifdef MRT6_OINIT oim = NULL; @@ -1324,7 +1319,7 @@ ip6_mdq(m, ifp, rt) break; default: m_freem(mm); - return EINVAL; + return (EINVAL); } for (mifp = mif6table, iif = 0; @@ -1354,10 +1349,10 @@ ip6_mdq(m, ifp, rt) log(LOG_WARNING, "mdq, ip6_mrouter socket queue full\n"); #endif ++mrt6stat.mrt6s_upq_sockfull; - return ENOBUFS; + return (ENOBUFS); } /* if socket Q full */ } /* if PIM */ - return 0; + return (0); } /* if wrong iif */ /* If I sourced this packet, it counts as output, else it was input. */ @@ -1401,7 +1396,7 @@ ip6_mdq(m, ifp, rt) mifp->m6_bytes_out += plen; MC6_SEND(ip6, mifp, m); } - return 0; + return (0); } static void @@ -1533,21 +1528,21 @@ register_send(ip6, mif, m) /* Make a copy of the packet to send to the user level process */ MGETHDR(mm, M_DONTWAIT, MT_HEADER); if (mm == NULL) - return ENOBUFS; + return (ENOBUFS); mm->m_pkthdr.rcvif = NULL; mm->m_data += max_linkhdr; mm->m_len = sizeof(struct ip6_hdr); if ((mm->m_next = m_copy(m, 0, M_COPYALL)) == NULL) { m_freem(mm); - return ENOBUFS; + return (ENOBUFS); } i = MHLEN - M_LEADINGSPACE(mm); if (i > len) i = len; mm = m_pullup(mm, i); if (mm == NULL) - return ENOBUFS; + return (ENOBUFS); /* TODO: check it! */ mm->m_pkthdr.len = len + sizeof(struct ip6_hdr); @@ -1572,9 +1567,9 @@ register_send(ip6, mif, m) "register_send: ip6_mrouter socket queue full\n"); #endif ++mrt6stat.mrt6s_upq_sockfull; - return ENOBUFS; + return (ENOBUFS); } - return 0; + return (0); } /* @@ -1611,7 +1606,7 @@ pim6_input(mp, offp, proto) log(LOG_DEBUG,"pim6_input: PIM packet too short\n"); #endif m_freem(m); - return(IPPROTO_DONE); + return (IPPROTO_DONE); } /* @@ -1639,7 +1634,7 @@ pim6_input(mp, offp, proto) IP6_EXTHDR_GET(pim, struct pim *, m, off, minlen); if (pim == NULL) { pim6stat.pim6s_rcv_tooshort++; - return IPPROTO_DONE; + return (IPPROTO_DONE); } #endif @@ -1665,7 +1660,7 @@ pim6_input(mp, offp, proto) "pim6_input: invalid checksum\n"); #endif m_freem(m); - return(IPPROTO_DONE); + return (IPPROTO_DONE); } } #endif /* PIM_CHECKSUM */ @@ -1679,7 +1674,7 @@ pim6_input(mp, offp, proto) pim->pim_ver, PIM_VERSION); #endif m_freem(m); - return(IPPROTO_DONE); + return (IPPROTO_DONE); } if (pim->pim_type == PIM_REGISTER) { @@ -1705,7 +1700,7 @@ pim6_input(mp, offp, proto) reg_mif_num); #endif m_freem(m); - return(IPPROTO_DONE); + return (IPPROTO_DONE); } reghdr = (u_int32_t *)(pim + 1); @@ -1726,7 +1721,7 @@ pim6_input(mp, offp, proto) pimlen, ip6_sprintf(&ip6->ip6_src)); #endif m_freem(m); - return(IPPROTO_DONE); + return (IPPROTO_DONE); } eip6 = (struct ip6_hdr *) (reghdr + 1); @@ -1749,7 +1744,7 @@ pim6_input(mp, offp, proto) (eip6->ip6_vfc & IPV6_VERSION)); #endif m_freem(m); - return(IPPROTO_NONE); + return (IPPROTO_NONE); } /* verify the inner packet is destined to a mcast group */ @@ -1763,7 +1758,7 @@ pim6_input(mp, offp, proto) ip6_sprintf(&eip6->ip6_dst)); #endif m_freem(m); - return(IPPROTO_DONE); + return (IPPROTO_DONE); } /* @@ -1777,7 +1772,7 @@ pim6_input(mp, offp, proto) "could not copy register head\n"); #endif m_freem(m); - return(IPPROTO_DONE); + return (IPPROTO_DONE); } /* @@ -1810,5 +1805,5 @@ pim6_input(mp, offp, proto) */ pim6_input_to_daemon: rip6_input(&m, offp, proto); - return(IPPROTO_DONE); + return (IPPROTO_DONE); } diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index ff7cf8b..a7050e3 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1119,7 +1119,7 @@ done: KEY_FREESP(&sp); #endif /* FAST_IPSEC */ - return(error); + return (error); freehdrs: m_freem(exthdrs.ip6e_hbh); /* m_freem will check if mbuf is 0 */ @@ -1141,17 +1141,17 @@ ip6_copyexthdr(mp, hdr, hlen) struct mbuf *m; if (hlen > MCLBYTES) - return(ENOBUFS); /* XXX */ + return (ENOBUFS); /* XXX */ MGET(m, M_DONTWAIT, MT_DATA); if (!m) - return(ENOBUFS); + return (ENOBUFS); if (hlen > MLEN) { MCLGET(m, M_DONTWAIT); if ((m->m_flags & M_EXT) == 0) { m_free(m); - return(ENOBUFS); + return (ENOBUFS); } } m->m_len = hlen; @@ -1159,7 +1159,7 @@ ip6_copyexthdr(mp, hdr, hlen) bcopy(hdr, mtod(m, caddr_t), hlen); *mp = m; - return(0); + return (0); } /* @@ -1185,7 +1185,7 @@ ip6_insert_jumboopt(exthdrs, plen) if (exthdrs->ip6e_hbh == 0) { MGET(mopt, M_DONTWAIT, MT_DATA); if (mopt == 0) - return(ENOBUFS); + return (ENOBUFS); mopt->m_len = JUMBOOPTLEN; optbuf = mtod(mopt, u_char *); optbuf[1] = 0; /* = ((JUMBOOPTLEN) >> 3) - 1 */ @@ -1209,7 +1209,7 @@ ip6_insert_jumboopt(exthdrs, plen) * not fit even in an mbuf cluster. */ if (oldoptlen + JUMBOOPTLEN > MCLBYTES) - return(ENOBUFS); + return (ENOBUFS); /* * As a consequence, we must always prepare a cluster @@ -1224,7 +1224,7 @@ ip6_insert_jumboopt(exthdrs, plen) } } if (!n) - return(ENOBUFS); + return (ENOBUFS); n->m_len = oldoptlen + JUMBOOPTLEN; bcopy(mtod(mopt, caddr_t), mtod(n, caddr_t), oldoptlen); @@ -1255,7 +1255,7 @@ ip6_insert_jumboopt(exthdrs, plen) /* finally, adjust the packet header length */ exthdrs->ip6e_ip6->m_pkthdr.len += JUMBOOPTLEN; - return(0); + return (0); #undef JUMBOOPTLEN } @@ -1274,7 +1274,7 @@ ip6_insertfraghdr(m0, m, hlen, frghdrp) n = m_copym(m0, sizeof(struct ip6_hdr), hlen - sizeof(struct ip6_hdr), M_DONTWAIT); if (n == 0) - return(ENOBUFS); + return (ENOBUFS); m->m_next = n; } else n = m; @@ -1296,13 +1296,13 @@ ip6_insertfraghdr(m0, m, hlen, frghdrp) MGET(mfrg, M_DONTWAIT, MT_DATA); if (mfrg == 0) - return(ENOBUFS); + return (ENOBUFS); mfrg->m_len = sizeof(struct ip6_frag); *frghdrp = mtod(mfrg, struct ip6_frag *); mlast->m_next = mfrg; } - return(0); + return (0); } /* @@ -1459,12 +1459,12 @@ do { \ * See comments for IPV6_RECVHOPOPTS. */ if (!privileged) - return(EPERM); + return (EPERM); OPTSET(IN6P_HOPOPTS); break; case IPV6_DSTOPTS: if (!privileged) - return(EPERM); + return (EPERM); OPTSET(IN6P_DSTOPTS|IN6P_RTHDRDSTOPTS); /* XXX */ break; case IPV6_RTHDR: @@ -1642,7 +1642,7 @@ do { \ if (optname == IPV6_HOPOPTS || optname == IPV6_DSTOPTS || !privileged) - return(EPERM); + return (EPERM); switch (optname) { case IPV6_PKTINFO: optval = OPTBIT(IN6P_PKTINFO); @@ -1652,7 +1652,7 @@ do { \ break; case IPV6_HOPOPTS: if (!privileged) - return(EPERM); + return (EPERM); optval = OPTBIT(IN6P_HOPOPTS); break; case IPV6_RTHDR: @@ -1660,7 +1660,7 @@ do { \ break; case IPV6_DSTOPTS: if (!privileged) - return(EPERM); + return (EPERM); optval = OPTBIT(IN6P_DSTOPTS|IN6P_RTHDRDSTOPTS); break; } @@ -1737,7 +1737,7 @@ do { \ } else { error = EINVAL; } - return(error); + return (error); } /* @@ -1775,7 +1775,7 @@ ip6_pcbopts(pktopt, m, so, sopt) * whether the opt is just created or given. */ free(opt, M_IP6OPT); - return(0); + return (0); } /* set options specified by user. */ @@ -1784,10 +1784,10 @@ ip6_pcbopts(pktopt, m, so, sopt) if ((error = ip6_setpktoptions(m, opt, priv, 1)) != 0) { ip6_clearpktopts(opt, 1, -1); /* XXX: discard all options */ free(opt, M_IP6OPT); - return(error); + return (error); } *pktopt = opt; - return(0); + return (0); } /* @@ -1870,7 +1870,7 @@ ip6_copypktopts(src, canwait) if (src == NULL) { printf("ip6_clearpktopts: invalid argument\n"); - return(NULL); + return (NULL); } dst = malloc(sizeof(*dst), M_IP6OPT, canwait); @@ -1898,7 +1898,7 @@ ip6_copypktopts(src, canwait) PKTOPT_EXTHDRCPY(ip6po_dest1); PKTOPT_EXTHDRCPY(ip6po_dest2); PKTOPT_EXTHDRCPY(ip6po_rthdr); /* not copy the cached route */ - return(dst); + return (dst); bad: if (dst->ip6po_pktinfo) free(dst->ip6po_pktinfo, M_IP6OPT); @@ -1908,7 +1908,7 @@ ip6_copypktopts(src, canwait) if (dst->ip6po_dest2) free(dst->ip6po_dest2, M_IP6OPT); if (dst->ip6po_rthdr) free(dst->ip6po_rthdr, M_IP6OPT); free(dst, M_IP6OPT); - return(NULL); + return (NULL); } #undef PKTOPT_EXTHDRCPY @@ -1952,7 +1952,7 @@ ip6_setmoptions(optname, im6op, m) malloc(sizeof(*im6o), M_IPMOPTS, M_WAITOK); if (im6o == NULL) - return(ENOBUFS); + return (ENOBUFS); *im6op = im6o; im6o->im6o_multicast_ifp = NULL; im6o->im6o_multicast_hlim = ip6_defmcasthlim; @@ -2210,7 +2210,7 @@ ip6_setmoptions(optname, im6op, m) *im6op = NULL; } - return(error); + return (error); } /* @@ -2235,7 +2235,7 @@ ip6_getmoptions(optname, im6o, mp) *ifindex = 0; else *ifindex = im6o->im6o_multicast_ifp->if_index; - return(0); + return (0); case IPV6_MULTICAST_HOPS: hlim = mtod(*mp, u_int *); @@ -2244,7 +2244,7 @@ ip6_getmoptions(optname, im6o, mp) *hlim = ip6_defmcasthlim; else *hlim = im6o->im6o_multicast_hlim; - return(0); + return (0); case IPV6_MULTICAST_LOOP: loop = mtod(*mp, u_int *); @@ -2253,10 +2253,10 @@ ip6_getmoptions(optname, im6o, mp) *loop = ip6_defmcasthlim; else *loop = im6o->im6o_multicast_loop; - return(0); + return (0); default: - return(EOPNOTSUPP); + return (EOPNOTSUPP); } } @@ -2293,7 +2293,7 @@ ip6_setpktoptions(control, opt, priv, needcopy) struct cmsghdr *cm = 0; if (control == 0 || opt == 0) - return(EINVAL); + return (EINVAL); init_ip6pktopts(opt); @@ -2302,13 +2302,13 @@ ip6_setpktoptions(control, opt, priv, needcopy) * in a single mbuf. */ if (control->m_next) - return(EINVAL); + return (EINVAL); for (; control->m_len; control->m_data += CMSG_ALIGN(cm->cmsg_len), control->m_len -= CMSG_ALIGN(cm->cmsg_len)) { cm = mtod(control, struct cmsghdr *); if (cm->cmsg_len == 0 || cm->cmsg_len > control->m_len) - return(EINVAL); + return (EINVAL); if (cm->cmsg_level != IPPROTO_IPV6) continue; @@ -2318,7 +2318,7 @@ ip6_setpktoptions(control, opt, priv, needcopy) switch (cm->cmsg_type) { case IPV6_PKTINFO: if (cm->cmsg_len != CMSG_LEN(sizeof(struct in6_pktinfo))) - return(EINVAL); + return (EINVAL); if (needcopy) { /* XXX: Is it really WAITOK? */ opt->ip6po_pktinfo = @@ -2336,7 +2336,7 @@ ip6_setpktoptions(control, opt, priv, needcopy) if (opt->ip6po_pktinfo->ipi6_ifindex > if_index || opt->ip6po_pktinfo->ipi6_ifindex < 0) { - return(ENXIO); + return (ENXIO); } /* @@ -2357,27 +2357,27 @@ ip6_setpktoptions(control, opt, priv, needcopy) if (ia6 == NULL || (ia6->ia6_flags & (IN6_IFF_ANYCAST | IN6_IFF_NOTREADY)) != 0) - return(EADDRNOTAVAIL); + return (EADDRNOTAVAIL); } break; case IPV6_HOPLIMIT: if (cm->cmsg_len != CMSG_LEN(sizeof(int))) - return(EINVAL); + return (EINVAL); opt->ip6po_hlim = *(int *)CMSG_DATA(cm); if (opt->ip6po_hlim < -1 || opt->ip6po_hlim > 255) - return(EINVAL); + return (EINVAL); break; case IPV6_NEXTHOP: if (!priv) - return(EPERM); + return (EPERM); if (cm->cmsg_len < sizeof(u_char) || /* check if cmsg_len is large enough for sa_len */ cm->cmsg_len < CMSG_LEN(*CMSG_DATA(cm))) - return(EINVAL); + return (EINVAL); if (needcopy) { opt->ip6po_nexthop = @@ -2397,11 +2397,11 @@ ip6_setpktoptions(control, opt, priv, needcopy) int hbhlen; if (cm->cmsg_len < CMSG_LEN(sizeof(struct ip6_hbh))) - return(EINVAL); + return (EINVAL); hbh = (struct ip6_hbh *)CMSG_DATA(cm); hbhlen = (hbh->ip6h_len + 1) << 3; if (cm->cmsg_len != CMSG_LEN(hbhlen)) - return(EINVAL); + return (EINVAL); if (needcopy) { opt->ip6po_hbh = @@ -2418,11 +2418,11 @@ ip6_setpktoptions(control, opt, priv, needcopy) int destlen; if (cm->cmsg_len < CMSG_LEN(sizeof(struct ip6_dest))) - return(EINVAL); + return (EINVAL); dest = (struct ip6_dest *)CMSG_DATA(cm); destlen = (dest->ip6d_len + 1) << 3; if (cm->cmsg_len != CMSG_LEN(destlen)) - return(EINVAL); + return (EINVAL); /* * The old advacned API is ambiguous on this @@ -2457,25 +2457,25 @@ ip6_setpktoptions(control, opt, priv, needcopy) int rthlen; if (cm->cmsg_len < CMSG_LEN(sizeof(struct ip6_rthdr))) - return(EINVAL); + return (EINVAL); rth = (struct ip6_rthdr *)CMSG_DATA(cm); rthlen = (rth->ip6r_len + 1) << 3; if (cm->cmsg_len != CMSG_LEN(rthlen)) - return(EINVAL); + return (EINVAL); switch (rth->ip6r_type) { case IPV6_RTHDR_TYPE_0: /* must contain one addr */ if (rth->ip6r_len == 0) - return(EINVAL); + return (EINVAL); /* length must be even */ if (rth->ip6r_len % 2) - return(EINVAL); + return (EINVAL); if (rth->ip6r_len / 2 != rth->ip6r_segleft) - return(EINVAL); + return (EINVAL); break; default: - return(EINVAL); /* not supported */ + return (EINVAL); /* not supported */ } if (needcopy) { @@ -2489,11 +2489,11 @@ ip6_setpktoptions(control, opt, priv, needcopy) } default: - return(ENOPROTOOPT); + return (ENOPROTOOPT); } } - return(0); + return (0); } /* diff --git a/sys/netinet6/ipsec.c b/sys/netinet6/ipsec.c index 1e05d6e..708641b 100644 --- a/sys/netinet6/ipsec.c +++ b/sys/netinet6/ipsec.c @@ -3451,10 +3451,10 @@ ipsec_copypkt(m) mpp = &n->m_next; } - return(m); + return (m); fail: m_freem(m); - return(NULL); + return (NULL); } void diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 7ef59c9..758897e 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -708,12 +708,12 @@ regen_tmpaddr(ia6) if ((e = in6_tmpifadd(public_ifa6, 0)) != 0) { log(LOG_NOTICE, "regen_tmpaddr: failed to create a new" " tmp addr,errno=%d\n", e); - return(-1); + return (-1); } - return(0); + return (0); } - return(-1); + return (-1); } /* @@ -838,7 +838,7 @@ nd6_lookup(addr6, create, ifp) struct ifaddr *ifa = ifaof_ifpforaddr((struct sockaddr *)&sin6, ifp); if (ifa == NULL) - return(NULL); + return (NULL); /* * Create a new route. RTF_LLINFO is necessary @@ -858,14 +858,14 @@ nd6_lookup(addr6, create, ifp) "neighbor(%s), errno=%d\n", ip6_sprintf(addr6), e); if (rt == NULL) - return(NULL); + return (NULL); if (rt->rt_llinfo) { struct llinfo_nd6 *ln = (struct llinfo_nd6 *)rt->rt_llinfo; ln->ln_state = ND6_LLINFO_NOSTATE; } } else - return(NULL); + return (NULL); } rt->rt_refcnt--; /* @@ -888,9 +888,9 @@ nd6_lookup(addr6, create, ifp) ip6_sprintf(addr6), ifp ? if_name(ifp) : "unspec"); /* xxx more logs... kazu */ } - return(NULL); + return (NULL); } - return(rt); + return (rt); } /* @@ -915,7 +915,7 @@ nd6_is_addr_neighbor(addr, ifp) */ if (IN6_IS_ADDR_LINKLOCAL(&addr->sin6_addr) && ntohs(*(u_int16_t *)&addr->sin6_addr.s6_addr[2]) == ifp->if_index) - return(1); + return (1); /* * If the address matches one of our addresses, @@ -934,7 +934,7 @@ nd6_is_addr_neighbor(addr, ifp) IFMASK6(ifa).s6_addr32[i]) goto next; } - return(1); + return (1); } /* @@ -942,9 +942,9 @@ nd6_is_addr_neighbor(addr, ifp) * in the neighbor cache. */ if (nd6_lookup(&addr->sin6_addr, 0, ifp) != NULL) - return(1); + return (1); - return(0); + return (0); #undef IFADDR6 #undef IFMASK6 } @@ -1037,7 +1037,7 @@ nd6_free(rt) rtrequest(RTM_DELETE, rt_key(rt), (struct sockaddr *)0, rt_mask(rt), 0, (struct rtentry **)0); - return(next); + return (next); } /* @@ -1596,10 +1596,10 @@ nd6_ioctl(cmd, data, ifp) ndif->ifindex = nd6_defifindex; break; case SIOCSDEFIFACE_IN6: /* XXX: should be implemented as a sysctl? */ - return(nd6_setdefaultiface(ndif->ifindex)); + return (nd6_setdefaultiface(ndif->ifindex)); break; } - return(error); + return (error); } /* @@ -2025,7 +2025,7 @@ nd6_output(ifp, origifp, m0, dst, rt0) nd6_ns_output(ifp, NULL, &dst->sin6_addr, ln, 0); } } - return(0); + return (0); sendpkt: @@ -2033,10 +2033,10 @@ nd6_output(ifp, origifp, m0, dst, rt0) mac_create_mbuf_linklayer(ifp, m); #endif if ((ifp->if_flags & IFF_LOOPBACK) != 0) { - return((*ifp->if_output)(origifp, m, (struct sockaddr *)dst, + return ((*ifp->if_output)(origifp, m, (struct sockaddr *)dst, rt)); } - return((*ifp->if_output)(ifp, m, (struct sockaddr *)dst, rt)); + return ((*ifp->if_output)(ifp, m, (struct sockaddr *)dst, rt)); bad: if (m) @@ -2068,9 +2068,9 @@ nd6_need_cache(ifp) case IFT_IEEE80211: #endif case IFT_GIF: /* XXX need more cases? */ - return(1); + return (1); default: - return(0); + return (0); } } @@ -2098,7 +2098,7 @@ nd6_storelladdr(ifp, rt, m, dst, desten) case IFT_ISO88025: ETHER_MAP_IPV6_MULTICAST(&SIN6(dst)->sin6_addr, desten); - return(1); + return (1); case IFT_IEEE1394: /* * netbsd can use if_broadcastaddr, but we don't do so @@ -2106,36 +2106,36 @@ nd6_storelladdr(ifp, rt, m, dst, desten) */ for (i = 0; i < ifp->if_addrlen; i++) desten[i] = ~0; - return(1); + return (1); case IFT_ARCNET: *desten = 0; - return(1); + return (1); default: m_freem(m); - return(0); + return (0); } } if (rt == NULL) { /* this could happen, if we could not allocate memory */ m_freem(m); - return(0); + return (0); } if (rt->rt_gateway->sa_family != AF_LINK) { printf("nd6_storelladdr: something odd happens\n"); m_freem(m); - return(0); + return (0); } sdl = SDL(rt->rt_gateway); if (sdl->sdl_alen == 0) { /* this should be impossible, but we bark here for debugging */ printf("nd6_storelladdr: sdl_alen == 0\n"); m_freem(m); - return(0); + return (0); } bcopy(LLADDR(sdl), desten, sdl->sdl_alen); - return(1); + return (1); } static int nd6_sysctl_drlist(SYSCTL_HANDLER_ARGS); diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 845c2fd..ede69a4 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -550,10 +550,10 @@ defrouter_lookup(addr, ifp) for (dr = TAILQ_FIRST(&nd_defrouter); dr; dr = TAILQ_NEXT(dr, dr_entry)) { if (dr->ifp == ifp && IN6_ARE_ADDR_EQUAL(addr, &dr->rtaddr)) - return(dr); + return (dr); } - return(NULL); /* search failed */ + return (NULL); /* search failed */ } void @@ -729,19 +729,19 @@ defrtrlist_update(new) dr->expire = new->expire; } splx(s); - return(dr); + return (dr); } /* entry does not exist */ if (new->rtlifetime == 0) { splx(s); - return(NULL); + return (NULL); } n = (struct nd_defrouter *)malloc(sizeof(*n), M_IP6NDP, M_NOWAIT); if (n == NULL) { splx(s); - return(NULL); + return (NULL); } bzero(n, sizeof(*n)); *n = *new; @@ -756,7 +756,7 @@ defrtrlist_update(new) defrouter_select(); splx(s); - return(n); + return (n); } static struct nd_pfxrouter * @@ -771,7 +771,7 @@ pfxrtr_lookup(pr, dr) break; } - return(search); + return (search); } static void @@ -817,7 +817,7 @@ nd6_prefix_lookup(pr) } } - return(search); + return (search); } int @@ -1232,7 +1232,7 @@ find_pfxlist_reachable_router(pr) break; /* found */ } - return(pfxrtr); + return (pfxrtr); } @@ -1408,7 +1408,7 @@ nd6_prefix_onlink(pr) nd6log((LOG_ERR, "nd6_prefix_onlink: %s/%d is already on-link\n", ip6_sprintf(&pr->ndpr_prefix.sin6_addr), pr->ndpr_plen); - return(EEXIST)); + return (EEXIST)); } /* @@ -1429,7 +1429,7 @@ nd6_prefix_onlink(pr) in6_are_prefix_equal(&pr->ndpr_prefix.sin6_addr, &opr->ndpr_prefix.sin6_addr, pr->ndpr_plen)) - return(0); + return (0); } /* @@ -1460,7 +1460,7 @@ nd6_prefix_onlink(pr) " to add route for a prefix(%s/%d) on %s\n", ip6_sprintf(&pr->ndpr_prefix.sin6_addr), pr->ndpr_plen, if_name(ifp))); - return(0); + return (0); } /* @@ -1504,7 +1504,7 @@ nd6_prefix_onlink(pr) RT_UNLOCK(rt); } - return(error); + return (error); } int @@ -1522,7 +1522,7 @@ nd6_prefix_offlink(pr) nd6log((LOG_ERR, "nd6_prefix_offlink: %s/%d is already off-link\n", ip6_sprintf(&pr->ndpr_prefix.sin6_addr), pr->ndpr_plen)); - return(EEXIST); + return (EEXIST); } bzero(&sa6, sizeof(sa6)); @@ -1594,7 +1594,7 @@ nd6_prefix_offlink(pr) if (rt != NULL) RTFREE(rt); - return(error); + return (error); } static struct in6_ifaddr * @@ -1726,12 +1726,12 @@ in6_ifadd(pr, ifid) "in6_ifadd: failed to make ifaddr %s on %s (errno=%d)\n", ip6_sprintf(&ifra.ifra_addr.sin6_addr), if_name(ifp), error)); - return(NULL); /* ifaddr must not have been allocated. */ + return (NULL); /* ifaddr must not have been allocated. */ } ia = in6ifa_ifpwithaddr(ifp, &ifra.ifra_addr.sin6_addr); - return(ia); /* this must NOT be NULL. */ + return (ia); /* this must NOT be NULL. */ } int @@ -1777,7 +1777,7 @@ in6_tmpifadd(ia0, forcegen) if (trylimit-- == 0) { nd6log((LOG_NOTICE, "in6_tmpifadd: failed to find " "a unique random IFID\n")); - return(EEXIST); + return (EEXIST); } forcegen = 1; goto again; @@ -1814,7 +1814,7 @@ in6_tmpifadd(ia0, forcegen) * Lifetime is greater than REGEN_ADVANCE time units. */ if (ifra.ifra_lifetime.ia6t_pltime <= ip6_temp_regen_advance) - return(0); + return (0); /* XXX: scope zone ID? */ @@ -1822,14 +1822,14 @@ in6_tmpifadd(ia0, forcegen) /* allocate ifaddr structure, link into chain, etc. */ if ((error = in6_update_ifa(ifp, &ifra, NULL)) != 0) - return(error); + return (error); newia = in6ifa_ifpwithaddr(ifp, &ifra.ifra_addr.sin6_addr); if (newia == NULL) { /* XXX: can it happen? */ nd6log((LOG_ERR, "in6_tmpifadd: ifa update succeeded, but we got " "no ifaddr\n")); - return(EINVAL); /* XXX */ + return (EINVAL); /* XXX */ } newia->ia6_ndpr = ia0->ia6_ndpr; newia->ia6_ndpr->ndpr_refcnt++; @@ -1844,7 +1844,7 @@ in6_tmpifadd(ia0, forcegen) */ pfxlist_onlink_check(); - return(0); + return (0); } int @@ -1926,10 +1926,10 @@ rt6_deleteroute(rn, arg) struct in6_addr *gate = (struct in6_addr *)arg; if (rt->rt_gateway == NULL || rt->rt_gateway->sa_family != AF_INET6) - return(0); + return (0); if (!IN6_ARE_ADDR_EQUAL(gate, &SIN6(rt->rt_gateway)->sin6_addr)) - return(0); + return (0); /* * Do not delete a static route. @@ -1937,16 +1937,16 @@ rt6_deleteroute(rn, arg) * 'cloned' bit instead? */ if ((rt->rt_flags & RTF_STATIC) != 0) - return(0); + return (0); /* * We delete only host route. This means, in particular, we don't * delete default route. */ if ((rt->rt_flags & RTF_HOST) == 0) - return(0); + return (0); - return(rtrequest(RTM_DELETE, rt_key(rt), + return (rtrequest(RTM_DELETE, rt_key(rt), rt->rt_gateway, rt_mask(rt), rt->rt_flags, 0)); #undef SIN6 } @@ -1958,7 +1958,7 @@ nd6_setdefaultiface(ifindex) int error = 0; if (ifindex < 0 || if_index < ifindex) - return(EINVAL); + return (EINVAL); if (nd6_defifindex != ifindex) { nd6_defifindex = ifindex; @@ -1986,5 +1986,5 @@ nd6_setdefaultiface(ifindex) scope6_setdefault(nd6_defifp); } - return(error); + return (error); } diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index 728da31..1a8f6a5 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -492,7 +492,7 @@ rip6_output(m, va_alist) ip6_clearpktopts(optp, 0, -1); m_freem(control); } - return(error); + return (error); } /* @@ -510,7 +510,7 @@ rip6_ctloutput(so, sopt) * XXX: is it better to call icmp6_ctloutput() directly * from protosw? */ - return(icmp6_ctloutput(so, sopt)); + return (icmp6_ctloutput(so, sopt)); else if (sopt->sopt_level != IPPROTO_IPV6) return (EINVAL); @@ -647,7 +647,7 @@ rip6_bind(struct socket *so, struct sockaddr *nam, struct thread *td) ((struct in6_ifaddr *)ia)->ia6_flags & (IN6_IFF_ANYCAST|IN6_IFF_NOTREADY| IN6_IFF_DETACHED|IN6_IFF_DEPRECATED)) { - return(EADDRNOTAVAIL); + return (EADDRNOTAVAIL); } inp->in6p_laddr = addr->sin6_addr; return 0; diff --git a/sys/netinet6/route6.c b/sys/netinet6/route6.c index f2575bc..16f790c 100644 --- a/sys/netinet6/route6.c +++ b/sys/netinet6/route6.c @@ -111,7 +111,7 @@ route6_input(mp, offp, proto) } #endif if (ip6_rthdr0(m, ip6, (struct ip6_rthdr0 *)rh)) - return(IPPROTO_DONE); + return (IPPROTO_DONE); break; default: /* unknown routing type */ @@ -122,11 +122,11 @@ route6_input(mp, offp, proto) ip6stat.ip6s_badoptions++; icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, (caddr_t)&rh->ip6r_type - (caddr_t)ip6); - return(IPPROTO_DONE); + return (IPPROTO_DONE); } *offp += rhlen; - return(rh->ip6r_nxt); + return (rh->ip6r_nxt); } /* @@ -145,7 +145,7 @@ ip6_rthdr0(m, ip6, rh0) struct in6_addr *nextaddr, tmpaddr; if (rh0->ip6r0_segleft == 0) - return(0); + return (0); if (rh0->ip6r0_len % 2 #ifdef COMPAT_RFC1883 @@ -160,14 +160,14 @@ ip6_rthdr0(m, ip6, rh0) ip6stat.ip6s_badoptions++; icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, (caddr_t)&rh0->ip6r0_len - (caddr_t)ip6); - return(-1); + return (-1); } if ((addrs = rh0->ip6r0_len / 2) < rh0->ip6r0_segleft) { ip6stat.ip6s_badoptions++; icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, (caddr_t)&rh0->ip6r0_segleft - (caddr_t)ip6); - return(-1); + return (-1); } index = addrs - rh0->ip6r0_segleft; @@ -186,7 +186,7 @@ ip6_rthdr0(m, ip6, rh0) IN6_IS_ADDR_V4COMPAT(nextaddr)) { ip6stat.ip6s_badoptions++; m_freem(m); - return(-1); + return (-1); } if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) || IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_dst) || @@ -194,7 +194,7 @@ ip6_rthdr0(m, ip6, rh0) IN6_IS_ADDR_V4COMPAT(&ip6->ip6_dst)) { ip6stat.ip6s_badoptions++; m_freem(m); - return(-1); + return (-1); } /* @@ -217,5 +217,5 @@ ip6_rthdr0(m, ip6, rh0) ip6_forward(m, 1); #endif - return(-1); /* m would be freed in ip6_forward() */ + return (-1); /* m would be freed in ip6_forward() */ } diff --git a/sys/netinet6/scope6.c b/sys/netinet6/scope6.c index 0c32da8..d38ac44 100644 --- a/sys/netinet6/scope6.c +++ b/sys/netinet6/scope6.c @@ -116,7 +116,7 @@ scope6_set(ifp, idlist) int error = 0; if (scope6_ids == NULL) /* paranoid? */ - return(EINVAL); + return (EINVAL); /* * XXX: We need more consistency checks of the relationship among @@ -142,7 +142,7 @@ scope6_set(ifp, idlist) * safety in later use. */ splx(s); - return(EINVAL); + return (EINVAL); } /* @@ -155,7 +155,7 @@ scope6_set(ifp, idlist) } splx(s); - return(error); + return (error); } int @@ -164,12 +164,12 @@ scope6_get(ifp, idlist) u_int32_t *idlist; { if (scope6_ids == NULL) /* paranoid? */ - return(EINVAL); + return (EINVAL); bcopy(scope6_ids[ifp->if_index].s6id_list, idlist, sizeof(scope6_ids[ifp->if_index].s6id_list)); - return(0); + return (0); } @@ -240,26 +240,26 @@ in6_addr2scopeid(ifp, addr) int scope = in6_addrscope(addr); if (scope6_ids == NULL) /* paranoid? */ - return(0); /* XXX */ + return (0); /* XXX */ if (ifp->if_index >= if_indexlim) - return(0); /* XXX */ + return (0); /* XXX */ #define SID scope6_ids[ifp->if_index] switch(scope) { case IPV6_ADDR_SCOPE_NODELOCAL: - return(-1); /* XXX: is this an appropriate value? */ + return (-1); /* XXX: is this an appropriate value? */ case IPV6_ADDR_SCOPE_LINKLOCAL: - return(SID.s6id_list[IPV6_ADDR_SCOPE_LINKLOCAL]); + return (SID.s6id_list[IPV6_ADDR_SCOPE_LINKLOCAL]); case IPV6_ADDR_SCOPE_SITELOCAL: - return(SID.s6id_list[IPV6_ADDR_SCOPE_SITELOCAL]); + return (SID.s6id_list[IPV6_ADDR_SCOPE_SITELOCAL]); case IPV6_ADDR_SCOPE_ORGLOCAL: - return(SID.s6id_list[IPV6_ADDR_SCOPE_ORGLOCAL]); + return (SID.s6id_list[IPV6_ADDR_SCOPE_ORGLOCAL]); default: - return(0); /* XXX: treat as global. */ + return (0); /* XXX: treat as global. */ } #undef SID } @@ -287,17 +287,17 @@ scope6_get_default(idlist) u_int32_t *idlist; { if (scope6_ids == NULL) /* paranoid? */ - return(EINVAL); + return (EINVAL); bcopy(scope6_ids[0].s6id_list, idlist, sizeof(scope6_ids[0].s6id_list)); - return(0); + return (0); } u_int32_t scope6_addr2default(addr) struct in6_addr *addr; { - return(scope6_ids[0].s6id_list[in6_addrscope(addr)]); + return (scope6_ids[0].s6id_list[in6_addrscope(addr)]); } diff --git a/sys/netinet6/udp6_output.c b/sys/netinet6/udp6_output.c index 1de45f0..a685f6a 100644 --- a/sys/netinet6/udp6_output.c +++ b/sys/netinet6/udp6_output.c @@ -308,5 +308,5 @@ releaseopt: in6p->in6p_outputopts = stickyopt; m_freem(control); } - return(error); + return (error); } diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index fd642cb..3bb2f9f 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -760,7 +760,7 @@ udp6_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, bad: m_freem(m); - return(error); + return (error); } struct pr_usrreqs udp6_usrreqs = { |