whitespace/costmetic sync w/kame

This commit is contained in:
itojun 2001-12-21 08:54:52 +00:00
parent 1536628a1f
commit a225c3930f
8 changed files with 74 additions and 60 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ah_input.c,v 1.30 2001/12/21 07:16:58 itojun Exp $ */
/* $NetBSD: ah_input.c,v 1.31 2001/12/21 08:54:52 itojun Exp $ */
/* $KAME: ah_input.c,v 1.64 2001/09/04 08:43:19 itojun Exp $ */
/*
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ah_input.c,v 1.30 2001/12/21 07:16:58 itojun Exp $");
__KERNEL_RCSID(0, "$NetBSD: ah_input.c,v 1.31 2001/12/21 08:54:52 itojun Exp $");
#include "opt_inet.h"
@ -654,7 +654,7 @@ ah6_input(mp, offp, proto)
ip6 = mtod(m, struct ip6_hdr *);
nxt = ah->ah_nxt;
/* find the sassoc. */
/* find the sassoc. */
spi = ah->ah_spi;
if (ntohs(ip6->ip6_plen) == 0) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: esp_core.c,v 1.19 2001/11/27 11:19:36 itojun Exp $ */
/* $NetBSD: esp_core.c,v 1.20 2001/12/21 08:54:52 itojun Exp $ */
/* $KAME: esp_core.c,v 1.53 2001/11/27 09:47:30 sakane Exp $ */
/*
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: esp_core.c,v 1.19 2001/11/27 11:19:36 itojun Exp $");
__KERNEL_RCSID(0, "$NetBSD: esp_core.c,v 1.20 2001/12/21 08:54:52 itojun Exp $");
#include "opt_inet.h"
@ -629,8 +629,8 @@ esp_cbc_decrypt(m, off, sav, algo, ivlen)
{
struct mbuf *s;
struct mbuf *d, *d0, *dp;
int soff, doff; /* offset from the head of chain, to head of this mbuf */
int sn, dn; /* offset from the head of the mbuf, to meat */
int soff, doff; /* offset from the head of chain, to head of this mbuf */
int sn, dn; /* offset from the head of the mbuf, to meat */
size_t ivoff, bodyoff;
u_int8_t iv[MAXIVLEN], *ivp;
u_int8_t sbuf[MAXIVLEN], *sp;
@ -833,8 +833,8 @@ esp_cbc_encrypt(m, off, plen, sav, algo, ivlen)
{
struct mbuf *s;
struct mbuf *d, *d0, *dp;
int soff, doff; /* offset from the head of chain, to head of this mbuf */
int sn, dn; /* offset from the head of the mbuf, to meat */
int soff, doff; /* offset from the head of chain, to head of this mbuf */
int sn, dn; /* offset from the head of the mbuf, to meat */
size_t ivoff, bodyoff;
u_int8_t iv[MAXIVLEN], *ivp;
u_int8_t sbuf[MAXIVLEN], *sp;

View File

@ -1,4 +1,4 @@
/* $NetBSD: icmp6.c,v 1.73 2001/12/20 07:26:36 itojun Exp $ */
/* $NetBSD: icmp6.c,v 1.74 2001/12/21 08:54:53 itojun Exp $ */
/* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
/*
@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.73 2001/12/20 07:26:36 itojun Exp $");
__KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.74 2001/12/21 08:54:53 itojun Exp $");
#include "opt_inet.h"
#include "opt_ipsec.h"
@ -697,7 +697,7 @@ icmp6_input(mp, offp, proto)
case MLD6_MTRACE_RESP:
case MLD6_MTRACE:
/* XXX: these two are experimental. not officially defind. */
/* XXX: these two are experimental. not officially defined. */
/* XXX: per-interface statistics? */
break; /* just pass it to applications */
@ -767,7 +767,7 @@ icmp6_input(mp, offp, proto)
bzero(p, 4);
bcopy(hostname, p + 4, maxhlen); /* meaningless TTL */
noff = sizeof(struct ip6_hdr);
M_COPY_PKTHDR(n, m); /* just for recvif */
M_COPY_PKTHDR(n, m); /* just for rcvif */
n->m_pkthdr.len = n->m_len = sizeof(struct ip6_hdr) +
sizeof(struct icmp6_hdr) + 4 + maxhlen;
nicmp6->icmp6_type = ICMP6_WRUREPLY;
@ -1455,7 +1455,7 @@ ni6_input(m, off)
m_freem(m);
return(NULL);
}
M_COPY_PKTHDR(n, m); /* just for recvif */
M_COPY_PKTHDR(n, m); /* just for rcvif */
if (replylen > MHLEN) {
if (replylen > MCLBYTES) {
/*
@ -2448,18 +2448,18 @@ icmp6_redirect_input(m, off)
}
}
/* finally update cached route in each socket via pfctlinput */
{
struct sockaddr_in6 sdst;
{
struct sockaddr_in6 sdst;
bzero(&sdst, sizeof(sdst));
sdst.sin6_family = AF_INET6;
sdst.sin6_len = sizeof(struct sockaddr_in6);
bcopy(&reddst6, &sdst.sin6_addr, sizeof(struct in6_addr));
pfctlinput(PRC_REDIRECT_HOST, (struct sockaddr *)&sdst);
bzero(&sdst, sizeof(sdst));
sdst.sin6_family = AF_INET6;
sdst.sin6_len = sizeof(struct sockaddr_in6);
bcopy(&reddst6, &sdst.sin6_addr, sizeof(struct in6_addr));
pfctlinput(PRC_REDIRECT_HOST, (struct sockaddr *)&sdst);
#ifdef IPSEC
key_sa_routechange((struct sockaddr *)&sdst);
key_sa_routechange((struct sockaddr *)&sdst);
#endif
}
}
freeit:
m_freem(m);
@ -2531,6 +2531,7 @@ icmp6_redirect_output(m0, rt)
MCLGET(m, M_DONTWAIT);
if (!m)
goto fail;
m->m_pkthdr.rcvif = NULL;
m->m_len = 0;
maxlen = M_TRAILINGSPACE(m);
maxlen = min(IPV6_MMTU, maxlen);

View File

@ -1,4 +1,4 @@
/* $NetBSD: in6.c,v 1.51 2001/12/20 07:26:36 itojun Exp $ */
/* $NetBSD: in6.c,v 1.52 2001/12/21 08:54:53 itojun Exp $ */
/* $KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $ */
/*
@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.51 2001/12/20 07:26:36 itojun Exp $");
__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.52 2001/12/21 08:54:53 itojun Exp $");
#include "opt_inet.h"
@ -127,6 +127,8 @@ const struct sockaddr_in6 sa6_any = {sizeof(sa6_any), AF_INET6,
static int in6_lifaddr_ioctl __P((struct socket *, u_long, caddr_t,
struct ifnet *, struct proc *));
static int in6_ifinit __P((struct ifnet *, struct in6_ifaddr *,
struct sockaddr_in6 *, int));
/*
* This structure is used to keep track of in6_multi chains which belong to
@ -363,7 +365,7 @@ in6_control(so, cmd, data, ifp, p)
case SIOCSIFINFO_FLAGS:
if (!privileged)
return(EPERM);
/*fall through*/
/* fall through */
case SIOCGIFINFO_IN6:
case SIOCGDRLST_IN6:
case SIOCGPRLST_IN6:
@ -380,7 +382,7 @@ in6_control(so, cmd, data, ifp, p)
case SIOCSGIFPREFIX_IN6:
if (!privileged)
return(EPERM);
/*fall through*/
/* fall through */
case SIOCGIFPREFIX_IN6:
return(in6_prefix_ioctl(so, cmd, data, ifp));
}
@ -390,7 +392,7 @@ in6_control(so, cmd, data, ifp, p)
case SIOCDLIFADDR:
if (!privileged)
return(EPERM);
/*fall through*/
/* fall through */
case SIOCGLIFADDR:
return in6_lifaddr_ioctl(so, cmd, data, ifp, p);
}
@ -409,7 +411,7 @@ in6_control(so, cmd, data, ifp, p)
htons(ifp->if_index);
} else if (sa6->sin6_addr.s6_addr16[1] !=
htons(ifp->if_index)) {
return(EINVAL); /* ifid contradicts */
return(EINVAL); /* link ID contradicts */
}
if (sa6->sin6_scope_id) {
if (sa6->sin6_scope_id !=
@ -427,10 +429,10 @@ in6_control(so, cmd, data, ifp, p)
case SIOCDIFADDR_IN6:
/*
* for IPv4, we look for existing in_ifaddr here to allow
* "ifconfig if0 delete" to remove first IPv4 address on the
* interface. For IPv6, as the spec allow multiple interface
* address from the day one, we consider "remove the first one"
* semantics to be not preferable.
* "ifconfig if0 delete" to remove the first IPv4 address on
* the interface. For IPv6, as the spec allows multiple
* interface address from the day one, we consider "remove the
* first one" semantics to be not preferable.
*/
if (ia == NULL)
return(EADDRNOTAVAIL);
@ -849,6 +851,7 @@ in6_control(so, cmd, data, ifp, p)
return(EOPNOTSUPP);
return((*ifp->if_ioctl)(ifp, cmd, data));
}
return(0);
}
@ -929,7 +932,8 @@ in6_purgeif(ifp)
{
struct ifaddr *ifa, *nifa;
for (ifa = TAILQ_FIRST(&ifp->if_addrlist); ifa != NULL; ifa = nifa) {
for (ifa = TAILQ_FIRST(&ifp->if_addrlist); ifa != NULL; ifa = nifa)
{
nifa = TAILQ_NEXT(ifa, ifa_list);
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
@ -977,7 +981,7 @@ in6_lifaddr_ioctl(so, cmd, data, ifp, p)
/* sanity checks */
if (!data || !ifp) {
panic("invalid argument to in6_lifaddr_ioctl");
/*NOTRECHED*/
/* NOTREACHED */
}
switch (cmd) {
@ -985,7 +989,7 @@ in6_lifaddr_ioctl(so, cmd, data, ifp, p)
/* address must be specified on GET with IFLR_PREFIX */
if ((iflr->flags & IFLR_PREFIX) == 0)
break;
/*FALLTHROUGH*/
/* FALLTHROUGH */
case SIOCALIFADDR:
case SIOCDLIFADDR:
/* address must be specified on ADD and DELETE */
@ -1001,10 +1005,10 @@ in6_lifaddr_ioctl(so, cmd, data, ifp, p)
if (sa->sa_len && sa->sa_len != sizeof(struct sockaddr_in6))
return EINVAL;
break;
default: /*shouldn't happen*/
default: /* shouldn't happen */
#if 0
panic("invalid cmd to in6_lifaddr_ioctl");
/*NOTREACHED*/
/* NOTREACHED */
#else
return EOPNOTSUPP;
#endif
@ -1061,7 +1065,7 @@ in6_lifaddr_ioctl(so, cmd, data, ifp, p)
hostid->s6_addr32[3];
}
if (((struct sockaddr *)&iflr->dstaddr)->sa_family) { /*XXX*/
if (((struct sockaddr *)&iflr->dstaddr)->sa_family) { /* XXX */
bcopy(&iflr->dstaddr, &ifra.ifra_dstaddr,
((struct sockaddr *)&iflr->dstaddr)->sa_len);
if (hostid) {
@ -1107,7 +1111,7 @@ in6_lifaddr_ioctl(so, cmd, data, ifp, p)
} else {
if (cmd == SIOCGLIFADDR) {
/* on getting an address, take the 1st match */
cmp = 0; /*XXX*/
cmp = 0; /* XXX */
} else {
/* on deleting an address, do exact match */
in6_len2mask(&mask, 128);
@ -1151,7 +1155,7 @@ in6_lifaddr_ioctl(so, cmd, data, ifp, p)
iflr->prefixlen =
in6_mask2len(&ia->ia_prefixmask.sin6_addr);
iflr->flags = ia->ia6_flags; /*XXX*/
iflr->flags = ia->ia6_flags; /* XXX */
return 0;
} else {
@ -1181,7 +1185,7 @@ in6_lifaddr_ioctl(so, cmd, data, ifp, p)
}
}
return EOPNOTSUPP; /*just for safety*/
return EOPNOTSUPP; /* just for safety */
}
/*
@ -1216,7 +1220,7 @@ in6_ifscrub(ifp, ia)
* Initialize an interface's intetnet6 address
* and routing table entry.
*/
int
static int
in6_ifinit(ifp, ia, sin6, scrub)
struct ifnet *ifp;
struct in6_ifaddr *ia;
@ -1629,8 +1633,8 @@ ip6_sprintf(addr)
static char ip6buf[8][48];
int i;
char *cp;
u_short *a = (u_short *)addr;
u_char *d;
const u_short *a = (u_short *)addr;
const u_char *d;
int dcolon = 0;
ip6round = (ip6round + 1) & 7;
@ -1659,7 +1663,7 @@ ip6_sprintf(addr)
a++;
continue;
}
d = (u_char *)a;
d = (const u_char *)a;
*cp++ = digits[*d >> 4];
*cp++ = digits[*d++ & 0xf];
*cp++ = digits[*d >> 4];
@ -1794,6 +1798,7 @@ struct in6_addr *src, *dst;
return match;
}
/* XXX: to be scope conscious */
int
in6_are_prefix_equal(p1, p2, len)
struct in6_addr *p1, *p2;
@ -2105,7 +2110,7 @@ in6_ifawithifp(ifp, dst)
int dst_scope = in6_addrscope(dst), blen = -1, tlen;
struct ifaddr *ifa;
struct in6_ifaddr *besta = 0;
struct in6_ifaddr *dep[2]; /*last-resort: deprecated*/
struct in6_ifaddr *dep[2]; /* last-resort: deprecated */
dep[0] = dep[1] = NULL;

View File

@ -1,4 +1,4 @@
/* $NetBSD: in6.h,v 1.32 2001/11/17 18:55:11 perry Exp $ */
/* $NetBSD: in6.h,v 1.33 2001/12/21 08:54:54 itojun Exp $ */
/* $KAME: in6.h,v 1.83 2001/03/29 02:55:07 jinmei Exp $ */
/*
@ -520,6 +520,7 @@ struct in6_pktinfo {
#define IPV6CTL_KAME_VERSION 20
#define IPV6CTL_USE_DEPRECATED 21 /* use deprecated addr (RFC2462 5.5.4) */
#define IPV6CTL_RR_PRUNE 22 /* walk timer for router renumbering */
/* 23: reserved */
#define IPV6CTL_V6ONLY 24
/* 25 to 27: reserved */
#define IPV6CTL_ANONPORTMIN 28 /* minimum ephemeral port */

View File

@ -1,4 +1,4 @@
/* $NetBSD: in6_ifattach.c,v 1.40 2001/12/18 03:04:02 itojun Exp $ */
/* $NetBSD: in6_ifattach.c,v 1.41 2001/12/21 08:54:54 itojun Exp $ */
/* $KAME: in6_ifattach.c,v 1.124 2001/07/18 08:32:51 jinmei Exp $ */
/*
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: in6_ifattach.c,v 1.40 2001/12/18 03:04:02 itojun Exp $");
__KERNEL_RCSID(0, "$NetBSD: in6_ifattach.c,v 1.41 2001/12/21 08:54:54 itojun Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -816,6 +816,8 @@ statinit:;
/*
* NOTE: in6_ifdetach() does not support loopback if at this moment.
* We don't need this function in bsdi, because interfaces are never removed
* from the ifnet list in bsdi.
*/
void
in6_ifdetach(ifp)
@ -893,7 +895,14 @@ in6_ifdetach(ifp)
/* cleanup multicast address kludge table, if there is any */
in6_purgemkludge(ifp);
/* remove neighbor management table */
/*
* remove neighbor management table. we call it twice just to make
* sure we nuke everything. maybe we need just one call.
* XXX: since the first call did not release addresses, some prefixes
* might remain. We should call nd6_purge() again to release the
* prefixes after removing all addresses above.
* (Or can we just delay calling nd6_purge until at this point?)
*/
nd6_purge(ifp);
/* remove route to link-local allnodes multicast (ff02::1) */

View File

@ -1,4 +1,4 @@
/* $NetBSD: in6_pcb.c,v 1.44 2001/11/13 00:56:59 lukem Exp $ */
/* $NetBSD: in6_pcb.c,v 1.45 2001/12/21 08:54:54 itojun Exp $ */
/* $KAME: in6_pcb.c,v 1.84 2001/02/08 18:02:08 itojun Exp $ */
/*
@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.44 2001/11/13 00:56:59 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.45 2001/12/21 08:54:54 itojun Exp $");
#include "opt_ipsec.h"
@ -222,8 +222,9 @@ in6_pcbbind(in6p, nam, p)
return(EADDRNOTAVAIL);
/*
* XXX: bind to an anycast address might accidentally
* cause sending a packet with anycast source address.
* bind to an anycast address might accidentally
* cause sending a packet with an anycast source
* address, so we forbid it.
*/
if (ia &&
((struct in6_ifaddr *)ia)->ia6_flags &
@ -664,8 +665,7 @@ in6_pcbpurgeif0(head, ifp)
nimm = imm->i6mm_chain.le_next;
if (imm->i6mm_maddr->in6m_ifp == ifp) {
LIST_REMOVE(imm, i6mm_chain);
in6_delmulti(imm->i6mm_maddr);
free(imm, M_IPMADDR);
in6_leavegroup(imm);
}
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: in6_var.h,v 1.23 2001/12/20 07:26:37 itojun Exp $ */
/* $NetBSD: in6_var.h,v 1.24 2001/12/21 08:54:54 itojun Exp $ */
/* $KAME: in6_var.h,v 1.53 2001/02/10 02:44:27 itojun Exp $ */
/*
@ -555,8 +555,6 @@ do { \
IN6_NEXT_MULTI((step), (in6m)); \
} while (0)
int in6_ifinit __P((struct ifnet *,
struct in6_ifaddr *, struct sockaddr_in6 *, int));
struct in6_multi *in6_addmulti __P((struct in6_addr *, struct ifnet *,
int *));
void in6_delmulti __P((struct in6_multi *));