PERFORCE change 39382 for review
Sam Leffler
sam at FreeBSD.org
Wed Oct 8 16:05:00 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=39382
Change 39382 by sam at sam_ebb on 2003/10/08 16:04:44
IFC @ 39381
Affected files ...
.. //depot/projects/netperf/sys/compat/linprocfs/linprocfs.c#8 integrate
.. //depot/projects/netperf/sys/dev/hifn/hifn7751.c#8 integrate
.. //depot/projects/netperf/sys/dev/hifn/hifn7751reg.h#5 integrate
.. //depot/projects/netperf/sys/dev/hifn/hifn7751var.h#3 integrate
.. //depot/projects/netperf/sys/ia64/ia64/pmap.c#8 integrate
.. //depot/projects/netperf/sys/netinet6/in6_cksum.c#2 integrate
.. //depot/projects/netperf/sys/netinet6/in6_gif.c#3 integrate
.. //depot/projects/netperf/sys/netinet6/in6_gif.h#2 integrate
.. //depot/projects/netperf/sys/netinet6/in6_ifattach.c#7 integrate
.. //depot/projects/netperf/sys/netinet6/in6_pcb.c#8 integrate
.. //depot/projects/netperf/sys/netinet6/in6_proto.c#4 integrate
.. //depot/projects/netperf/sys/netinet6/in6_rmx.c#7 integrate
.. //depot/projects/netperf/sys/netinet6/in6_src.c#5 integrate
.. //depot/projects/netperf/sys/netinet6/in6_var.h#2 integrate
.. //depot/projects/netperf/sys/netinet6/ip6_forward.c#6 integrate
.. //depot/projects/netperf/sys/netinet6/ip6_fw.c#5 integrate
.. //depot/projects/netperf/sys/netinet6/ip6_fw.h#2 integrate
.. //depot/projects/netperf/sys/netinet6/ip6_input.c#8 integrate
.. //depot/projects/netperf/sys/netinet6/ip6_mroute.c#3 integrate
.. //depot/projects/netperf/sys/netinet6/ip6_output.c#12 integrate
.. //depot/projects/netperf/sys/netinet6/ip6_var.h#5 integrate
.. //depot/projects/netperf/sys/netinet6/ip6protosw.h#4 integrate
.. //depot/projects/netperf/sys/netinet6/ipcomp_core.c#2 integrate
.. //depot/projects/netperf/sys/netinet6/ipcomp_input.c#2 integrate
.. //depot/projects/netperf/sys/netinet6/ipsec.c#4 integrate
.. //depot/projects/netperf/sys/netinet6/ipsec.h#2 integrate
Differences ...
==== //depot/projects/netperf/sys/compat/linprocfs/linprocfs.c#8 (text+ko) ====
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.75 2003/09/30 13:35:19 des Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.76 2003/10/08 18:05:59 gallatin Exp $");
#include <sys/param.h>
#include <sys/queue.h>
@@ -413,7 +413,7 @@
static int
linprocfs_dostat(PFS_FILL_ARGS)
{
- unsigned int olen, plen;
+ size_t olen, plen;
int name[2];
int i, ncpu;
==== //depot/projects/netperf/sys/dev/hifn/hifn7751.c#8 (text+ko) ====
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/hifn/hifn7751.c,v 1.22 2003/09/02 17:30:36 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/hifn/hifn7751.c,v 1.23 2003/10/08 20:25:47 sam Exp $");
/*
* Driver for various Hifn encryption processors.
==== //depot/projects/netperf/sys/dev/hifn/hifn7751reg.h#5 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/dev/hifn/hifn7751reg.h,v 1.2 2003/09/02 17:30:36 jhb Exp $ */
+/* $FreeBSD: src/sys/dev/hifn/hifn7751reg.h,v 1.3 2003/10/08 20:25:47 sam Exp $ */
/* $OpenBSD: hifn7751reg.h,v 1.35 2002/04/08 17:49:42 jason Exp $ */
/*
==== //depot/projects/netperf/sys/dev/hifn/hifn7751var.h#3 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/dev/hifn/hifn7751var.h,v 1.3 2003/06/04 17:57:52 sam Exp $ */
+/* $FreeBSD: src/sys/dev/hifn/hifn7751var.h,v 1.4 2003/10/08 20:25:47 sam Exp $ */
/* $OpenBSD: hifn7751var.h,v 1.42 2002/04/08 17:49:42 jason Exp $ */
/*
==== //depot/projects/netperf/sys/ia64/ia64/pmap.c#8 (text+ko) ====
@@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/ia64/ia64/pmap.c,v 1.124 2003/10/03 22:46:53 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/ia64/ia64/pmap.c,v 1.125 2003/10/08 19:55:45 marcel Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -54,6 +54,7 @@
#include <sys/mman.h>
#include <sys/mutex.h>
#include <sys/proc.h>
+#include <sys/smp.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
==== //depot/projects/netperf/sys/netinet6/in6_cksum.c#2 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/netinet6/in6_cksum.c,v 1.7 2003/04/29 08:43:55 suz Exp $ */
+/* $FreeBSD: src/sys/netinet6/in6_cksum.c,v 1.8 2003/10/08 18:26:08 ume Exp $ */
/* $KAME: in6_cksum.c,v 1.10 2000/12/03 00:53:59 itojun Exp $ */
/*
@@ -100,9 +100,6 @@
int sum = 0;
int mlen = 0;
int byte_swapped = 0;
-#if 0
- int srcifid = 0, dstifid = 0;
-#endif
struct ip6_hdr *ip6;
union {
u_int16_t phs[4];
@@ -133,16 +130,6 @@
* First create IP6 pseudo header and calculate a summary.
*/
ip6 = mtod(m, struct ip6_hdr *);
-#if 0
- if (IN6_IS_SCOPE_LINKLOCAL(&ip6->ip6_src)) {
- srcifid = ip6->ip6_src.s6_addr16[1];
- ip6->ip6_src.s6_addr16[1] = 0;
- }
- if (IN6_IS_SCOPE_LINKLOCAL(&ip6->ip6_dst)) {
- dstifid = ip6->ip6_dst.s6_addr16[1];
- ip6->ip6_dst.s6_addr16[1] = 0;
- }
-#endif
w = (u_int16_t *)&ip6->ip6_src;
uph.ph.ph_len = htonl(len);
uph.ph.ph_nxt = nxt;
@@ -163,12 +150,6 @@
sum += uph.phs[0]; sum += uph.phs[1];
sum += uph.phs[2]; sum += uph.phs[3];
-#if 0
- if (srcifid)
- ip6->ip6_src.s6_addr16[1] = srcifid;
- if (dstifid)
- ip6->ip6_dst.s6_addr16[1] = dstifid;
-#endif
/*
* Secondly calculate a summary of the first mbuf excluding offset.
*/
==== //depot/projects/netperf/sys/netinet6/in6_gif.c#3 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/netinet6/in6_gif.c,v 1.13 2003/10/06 14:02:08 ume Exp $ */
+/* $FreeBSD: src/sys/netinet6/in6_gif.c,v 1.14 2003/10/08 18:26:08 ume Exp $ */
/* $KAME: in6_gif.c,v 1.49 2001/05/14 14:02:17 itojun Exp $ */
/*
@@ -75,7 +75,7 @@
extern struct domain inet6domain;
struct ip6protosw in6_gif_protosw =
-{ SOCK_RAW, &inet6domain, 0/*IPPROTO_IPV[46]*/, PR_ATOMIC|PR_ADDR,
+{ SOCK_RAW, &inet6domain, 0/* IPPROTO_IPV[46] */, PR_ATOMIC|PR_ADDR,
in6_gif_input, rip6_output, 0, rip6_ctloutput,
0,
0, 0, 0, 0,
@@ -143,7 +143,7 @@
m_freem(m);
return EAFNOSUPPORT;
}
-
+
/* prepend new IP header */
M_PREPEND(m, sizeof(struct ip6_hdr), M_DONTWAIT);
if (m && m->m_len < sizeof(struct ip6_hdr))
@@ -208,7 +208,7 @@
- sizeof(struct ip6_hdr);
#endif
}
-
+
#ifdef IPV6_MINMTU
/*
* force fragmentation to minimum MTU, to avoid path MTU discovery.
@@ -221,7 +221,8 @@
#endif
}
-int in6_gif_input(mp, offp, proto)
+int
+in6_gif_input(mp, offp, proto)
struct mbuf **mp;
int *offp, proto;
{
@@ -288,7 +289,7 @@
m_freem(m);
return IPPROTO_DONE;
}
-
+
gif_input(m, af, gifp);
return IPPROTO_DONE;
}
==== //depot/projects/netperf/sys/netinet6/in6_gif.h#2 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/netinet6/in6_gif.h,v 1.5 2002/10/17 17:47:55 ume Exp $ */
+/* $FreeBSD: src/sys/netinet6/in6_gif.h,v 1.6 2003/10/08 18:26:08 ume Exp $ */
/* $KAME: in6_gif.h,v 1.5 2000/04/14 08:36:03 itojun Exp $ */
/*
@@ -42,4 +42,4 @@
int in6_gif_attach __P((struct gif_softc *));
int in6_gif_detach __P((struct gif_softc *));
-#endif /*_NETINET6_IN6_GIF_H_*/
+#endif /* _NETINET6_IN6_GIF_H_ */
==== //depot/projects/netperf/sys/netinet6/in6_ifattach.c#7 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/netinet6/in6_ifattach.c,v 1.15 2003/10/06 14:02:08 ume Exp $ */
+/* $FreeBSD: src/sys/netinet6/in6_ifattach.c,v 1.16 2003/10/08 18:26:08 ume Exp $ */
/* $KAME: in6_ifattach.c,v 1.118 2001/05/24 07:44:00 itojun Exp $ */
/*
@@ -156,9 +156,8 @@
val32 = random() ^ tv.tv_usec;
bcopy(&val32, seed + sizeof(val32) * i, sizeof(val32));
}
- } else {
+ } else
bcopy(seed0, seed, 8);
- }
/* copy the right-most 64-bits of the given address */
/* XXX assumption on the size of IFID */
@@ -205,7 +204,7 @@
* RFC 3041 3.2.1. (4)
* Take the rightmost 64-bits of the MD5 digest and save them in
* stable storage as the history value to be used in the next
- * iteration of the algorithm.
+ * iteration of the algorithm.
*/
bcopy(&digest[8], seed0, 8);
@@ -240,8 +239,7 @@
for (ifa = ifp->if_addrlist.tqh_first;
ifa;
- ifa = ifa->ifa_list.tqe_next)
- {
+ ifa = ifa->ifa_list.tqe_next) {
if (ifa->ifa_addr->sa_family != AF_LINK)
continue;
sdl = (struct sockaddr_dl *)ifa->ifa_addr;
@@ -383,8 +381,7 @@
/* next, try to get it from some other hardware interface */
IFNET_RLOCK();
- for (ifp = ifnet.tqh_first; ifp; ifp = ifp->if_list.tqe_next)
- {
+ for (ifp = ifnet.tqh_first; ifp; ifp = ifp->if_list.tqe_next) {
if (ifp == ifp0)
continue;
if (get_hw_ifid(ifp, in6) != 0)
@@ -416,13 +413,10 @@
return -1;
success:
- nd6log((LOG_INFO, "%s: ifid: "
- "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
- if_name(ifp0),
- in6->s6_addr[8], in6->s6_addr[9],
- in6->s6_addr[10], in6->s6_addr[11],
- in6->s6_addr[12], in6->s6_addr[13],
- in6->s6_addr[14], in6->s6_addr[15]));
+ nd6log((LOG_INFO, "%s: ifid: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
+ if_name(ifp0), in6->s6_addr[8], in6->s6_addr[9], in6->s6_addr[10],
+ in6->s6_addr[11], in6->s6_addr[12], in6->s6_addr[13],
+ in6->s6_addr[14], in6->s6_addr[15]));
return 0;
}
@@ -463,7 +457,7 @@
if (get_ifid(ifp, altifp, &ifra.ifra_addr.sin6_addr) != 0) {
nd6log((LOG_ERR,
"%s: no ifid available\n", if_name(ifp)));
- return -1;
+ return (-1);
}
}
#ifdef SCOPEDROUTING
@@ -500,7 +494,7 @@
* XXX: When the interface does not support IPv6, this call
* would fail in the SIOCSIFADDR ioctl. I believe the
* notification is rather confusing in this case, so just
- * supress it. (jinmei at kame.net 20010130)
+ * suppress it. (jinmei at kame.net 20010130)
*/
if (error != EAFNOSUPPORT)
log(LOG_NOTICE, "in6_ifattach_linklocal: failed to "
@@ -528,7 +522,7 @@
}
/*
- * Make the link-local prefix (fe80::/64%link) as on-link.
+ * Make the link-local prefix (fe80::%link/64) as on-link.
* Since we'd like to manage prefixes separately from addresses,
* we make an ND6 prefix structure for the link-local prefix,
* and add it to the prefix list as a never-expire prefix.
@@ -543,7 +537,7 @@
/* apply the mask for safety. (nd6_prelist_add will apply it again) */
for (i = 0; i < 4; i++) {
pr0.ndpr_prefix.sin6_addr.s6_addr32[i] &=
- in6mask64.s6_addr32[i];
+ in6mask64.s6_addr32[i];
}
/*
* Initialize parameters. The link-local prefix must always be
@@ -751,7 +745,7 @@
/* some of the interfaces are inherently not IPv6 capable */
switch (ifp->if_type) {
-#ifdef IFT_BRIDGE /*OpenBSD 2.8*/
+#ifdef IFT_BRIDGE /* OpenBSD 2.8, NetBSD 1.6 */
case IFT_BRIDGE:
return;
#endif
@@ -842,7 +836,7 @@
}
/*
- * assign a link-local address, if there's none.
+ * assign a link-local address, if there's none.
*/
if (ip6_auto_linklocal) {
ia = in6ifa_ifpforlinklocal(ifp, 0);
@@ -856,7 +850,7 @@
}
#ifdef IFT_STF /* XXX */
-statinit:
+statinit:
#endif
/* update dynamically. */
@@ -902,8 +896,7 @@
nd6_purge(ifp);
/* nuke any of IPv6 addresses we have */
- for (ifa = ifp->if_addrlist.tqh_first; ifa; ifa = next)
- {
+ for (ifa = ifp->if_addrlist.tqh_first; ifa; ifa = next) {
next = ifa->ifa_list.tqe_next;
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
@@ -911,11 +904,9 @@
}
/* undo everything done by in6_ifattach(), just in case */
- for (ifa = ifp->if_addrlist.tqh_first; ifa; ifa = next)
- {
+ for (ifa = ifp->if_addrlist.tqh_first; ifa; ifa = next) {
next = ifa->ifa_list.tqe_next;
-
if (ifa->ifa_addr->sa_family != AF_INET6
|| !IN6_IS_ADDR_LINKLOCAL(&satosin6(&ifa->ifa_addr)->sin6_addr)) {
continue;
@@ -924,15 +915,14 @@
ia = (struct in6_ifaddr *)ifa;
/* remove from the routing table */
- if ((ia->ia_flags & IFA_ROUTE)
- && (rt = rtalloc1((struct sockaddr *)&ia->ia_addr, 0, 0UL))) {
+ if ((ia->ia_flags & IFA_ROUTE) &&
+ (rt = rtalloc1((struct sockaddr *)&ia->ia_addr, 0, 0UL))) {
rtflags = rt->rt_flags;
rtfree(rt);
- rtrequest(RTM_DELETE,
- (struct sockaddr *)&ia->ia_addr,
- (struct sockaddr *)&ia->ia_addr,
- (struct sockaddr *)&ia->ia_prefixmask,
- rtflags, (struct rtentry **)0);
+ rtrequest(RTM_DELETE, (struct sockaddr *)&ia->ia_addr,
+ (struct sockaddr *)&ia->ia_addr,
+ (struct sockaddr *)&ia->ia_prefixmask,
+ rtflags, (struct rtentry **)0);
}
/* remove from the linked list */
@@ -949,9 +939,9 @@
if (ia->ia_next)
ia->ia_next = oia->ia_next;
else {
- nd6log((LOG_ERR,
- "%s: didn't unlink in6ifaddr from "
- "list\n", if_name(ifp)));
+ nd6log((LOG_ERR,
+ "%s: didn't unlink in6ifaddr from list\n",
+ if_name(ifp)));
}
}
@@ -959,10 +949,12 @@
}
/* leave from all multicast groups joined */
+
if (udbinfo.listhead != NULL)
in6_pcbpurgeif0(LIST_FIRST(udbinfo.listhead), ifp);
if (ripcbinfo.listhead != NULL)
in6_pcbpurgeif0(LIST_FIRST(ripcbinfo.listhead), ifp);
+
for (in6m = LIST_FIRST(&in6_multihead); in6m; in6m = in6m_next) {
in6m_next = LIST_NEXT(in6m, in6m_entry);
if (in6m->in6m_ifp != ifp)
@@ -992,7 +984,7 @@
if (rt->rt_ifp == ifp) {
RT_UNLOCK(rt);
rtrequest(RTM_DELETE, (struct sockaddr *)rt_key(rt),
- rt->rt_gateway, rt_mask(rt), rt->rt_flags, 0);
+ rt->rt_gateway, rt_mask(rt), rt->rt_flags, 0);
RTFREE(rt);
} else
rtfree(rt);
@@ -1020,7 +1012,7 @@
/* generate_tmp_ifid will update seedn and buf */
(void)generate_tmp_ifid(ndi->randomseed0, ndi->randomseed1,
- ndi->randomid);
+ ndi->randomid);
}
bcopy(ndi->randomid, retbuf, 8);
}
@@ -1035,9 +1027,8 @@
int s = splnet();
callout_reset(&in6_tmpaddrtimer_ch,
- (ip6_temp_preferred_lifetime - ip6_desync_factor -
- ip6_temp_regen_advance) * hz,
- in6_tmpaddrtimer, NULL);
+ (ip6_temp_preferred_lifetime - ip6_desync_factor -
+ ip6_temp_regen_advance) * hz, in6_tmpaddrtimer, NULL);
bzero(nullbuf, sizeof(nullbuf));
for (i = 1; i < if_index + 1; i++) {
@@ -1048,8 +1039,7 @@
* Create a new one.
*/
(void)generate_tmp_ifid(ndi->randomseed0,
- ndi->randomseed1,
- ndi->randomid);
+ ndi->randomseed1, ndi->randomid);
}
}
==== //depot/projects/netperf/sys/netinet6/in6_pcb.c#8 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/netinet6/in6_pcb.c,v 1.41 2003/10/06 14:02:08 ume Exp $ */
+/* $FreeBSD: src/sys/netinet6/in6_pcb.c,v 1.42 2003/10/08 18:26:08 ume Exp $ */
/* $KAME: in6_pcb.c,v 1.31 2001/05/21 05:45:10 jinmei Exp $ */
/*
@@ -179,7 +179,7 @@
* XXX: bind to an anycast address might accidentally
* cause sending a packet with anycast source address.
* We should allow to bind to a deprecated address, since
- * the application dare to use it.
+ * the application dares to use it.
*/
if (ia &&
((struct in6_ifaddr *)ia)->ia6_flags &
@@ -413,212 +413,6 @@
return (0);
}
-#if 0
-/*
- * Return an IPv6 address, which is the most appropriate for given
- * destination and user specified options.
- * If necessary, this function lookups the routing table and return
- * an entry to the caller for later use.
- */
-struct in6_addr *
-in6_selectsrc(dstsock, opts, mopts, ro, laddr, errorp)
- struct sockaddr_in6 *dstsock;
- struct ip6_pktopts *opts;
- struct ip6_moptions *mopts;
- struct route_in6 *ro;
- struct in6_addr *laddr;
- int *errorp;
-{
- struct in6_addr *dst;
- struct in6_ifaddr *ia6 = 0;
- struct in6_pktinfo *pi = NULL;
-
- dst = &dstsock->sin6_addr;
- *errorp = 0;
-
- /*
- * If the source address is explicitly specified by the caller,
- * use it.
- */
- if (opts && (pi = opts->ip6po_pktinfo) &&
- !IN6_IS_ADDR_UNSPECIFIED(&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);
-
- /*
- * If the caller doesn't specify the source address but
- * the outgoing interface, use an address associated with
- * the interface.
- */
- if (pi && pi->ipi6_ifindex) {
- /* XXX boundary check is assumed to be already done. */
- ia6 = in6_ifawithscope(ifnet_byindex(pi->ipi6_ifindex), dst);
- if (ia6 == 0) {
- *errorp = EADDRNOTAVAIL;
- return (0);
- }
- return (&satosin6(&ia6->ia_addr)->sin6_addr);
- }
-
- /*
- * If the destination address is a link-local unicast address or
- * a multicast address, and if the outgoing interface is specified
- * by the sin6_scope_id filed, use an address associated with the
- * interface.
- * XXX: We're now trying to define more specific semantics of
- * sin6_scope_id field, so this part will be rewritten in
- * the near future.
- */
- if ((IN6_IS_ADDR_LINKLOCAL(dst) || IN6_IS_ADDR_MULTICAST(dst)) &&
- dstsock->sin6_scope_id) {
- /*
- * I'm not sure if boundary check for scope_id is done
- * somewhere...
- */
- if (dstsock->sin6_scope_id < 0 ||
- if_index < dstsock->sin6_scope_id) {
- *errorp = ENXIO; /* XXX: better error? */
- return (0);
- }
- ia6 = in6_ifawithscope(ifnet_byindex(dstsock->sin6_scope_id),
- dst);
- if (ia6 == 0) {
- *errorp = EADDRNOTAVAIL;
- return (0);
- }
- return (&satosin6(&ia6->ia_addr)->sin6_addr);
- }
-
- /*
- * If the destination address is a multicast address and
- * the outgoing interface for the address is specified
- * by the caller, use an address associated with the interface.
- * There is a sanity check here; if the destination has node-local
- * scope, the outgoing interfacde should be a loopback address.
- * Even if the outgoing interface is not specified, we also
- * choose a loopback interface as the outgoing interface.
- */
- if (IN6_IS_ADDR_MULTICAST(dst)) {
- struct ifnet *ifp = mopts ? mopts->im6o_multicast_ifp : NULL;
-
- if (ifp == NULL && IN6_IS_ADDR_MC_NODELOCAL(dst)) {
- ifp = &loif[0];
- }
-
- if (ifp) {
- ia6 = in6_ifawithscope(ifp, dst);
- if (ia6 == 0) {
- *errorp = EADDRNOTAVAIL;
- return (0);
- }
- return (&ia6->ia_addr.sin6_addr);
- }
- }
-
- /*
- * If the next hop address for the packet is specified
- * by caller, use an address associated with the route
- * to the next hop.
- */
- {
- struct sockaddr_in6 *sin6_next;
- struct rtentry *rt;
-
- if (opts && opts->ip6po_nexthop) {
- sin6_next = satosin6(opts->ip6po_nexthop);
- rt = nd6_lookup(&sin6_next->sin6_addr, 1, NULL);
- if (rt) {
- ia6 = in6_ifawithscope(rt->rt_ifp, dst);
- if (ia6 == 0)
- ia6 = ifatoia6(rt->rt_ifa);
- }
- if (ia6 == 0) {
- *errorp = EADDRNOTAVAIL;
- return (0);
- }
- return (&satosin6(&ia6->ia_addr)->sin6_addr);
- }
- }
-
- /*
- * If route is known or can be allocated now,
- * our src addr is taken from the i/f, else punt.
- */
- if (ro) {
- if (ro->ro_rt &&
- !IN6_ARE_ADDR_EQUAL(&satosin6(&ro->ro_dst)->sin6_addr, dst)) {
- RTFREE(ro->ro_rt);
- ro->ro_rt = (struct rtentry *)0;
- }
- if (ro->ro_rt == (struct rtentry *)0 ||
- ro->ro_rt->rt_ifp == (struct ifnet *)0) {
- struct sockaddr_in6 *dst6;
-
- /* No route yet, so try to acquire one */
- bzero(&ro->ro_dst, sizeof(struct sockaddr_in6));
- dst6 = (struct sockaddr_in6 *)&ro->ro_dst;
- dst6->sin6_family = AF_INET6;
- dst6->sin6_len = sizeof(struct sockaddr_in6);
- dst6->sin6_addr = *dst;
- if (IN6_IS_ADDR_MULTICAST(dst)) {
- ro->ro_rt = rtalloc1(&((struct route *)ro)
- ->ro_dst, 0, 0UL);
- RT_UNLOCK(ro->ro_rt);
- } else {
- rtalloc((struct route *)ro);
- }
- }
-
- /*
- * in_pcbconnect() checks out IFF_LOOPBACK to skip using
- * the address. But we don't know why it does so.
- * It is necessary to ensure the scope even for lo0
- * so doesn't check out IFF_LOOPBACK.
- */
-
- if (ro->ro_rt) {
- ia6 = in6_ifawithscope(ro->ro_rt->rt_ifa->ifa_ifp, dst);
- if (ia6 == 0) /* xxx scope error ?*/
- ia6 = ifatoia6(ro->ro_rt->rt_ifa);
- }
- if (ia6 == 0) {
- *errorp = EHOSTUNREACH; /* no route */
- return (0);
- }
- return (&satosin6(&ia6->ia_addr)->sin6_addr);
- }
-
- *errorp = EADDRNOTAVAIL;
- return (0);
-}
-
-/*
- * Default hop limit selection. The precedence is as follows:
- * 1. Hoplimit valued specified via ioctl.
- * 2. (If the outgoing interface is detected) the current
- * hop limit of the interface specified by router advertisement.
- * 3. The system default hoplimit.
-*/
-int
-in6_selecthlim(in6p, ifp)
- struct in6pcb *in6p;
- struct ifnet *ifp;
-{
- if (in6p && in6p->in6p_hops >= 0)
- return (in6p->in6p_hops);
- else if (ifp)
- return (nd_ifinfo[ifp->if_index].chlim);
- else
- return (ip6_defhlim);
-}
-#endif
-
void
in6_pcbdisconnect(inp)
struct inpcb *inp;
@@ -645,6 +439,7 @@
#endif /* IPSEC */
inp->inp_gencnt = ++ipi->ipi_gencnt;
in_pcbremlists(inp);
+
if (so) {
so->so_pcb = NULL;
sotryfree(so);
@@ -778,9 +573,10 @@
error = in_setsockaddr(so, nam, &tcbinfo);
if (error == 0)
in6_sin_2_v4mapsin6_in_sock(nam);
- } else
- /* scope issues will be handled in in6_setsockaddr(). */
- error = in6_setsockaddr(so, nam);
+ } else {
+ /* scope issues will be handled in in6_setsockaddr(). */
+ error = in6_setsockaddr(so, nam);
+ }
return error;
}
==== //depot/projects/netperf/sys/netinet6/in6_proto.c#4 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/netinet6/in6_proto.c,v 1.23 2003/10/06 14:02:08 ume Exp $ */
+/* $FreeBSD: src/sys/netinet6/in6_proto.c,v 1.24 2003/10/08 18:26:08 ume Exp $ */
/* $KAME: in6_proto.c,v 1.91 2001/05/27 13:28:35 itojun Exp $ */
/*
@@ -187,26 +187,26 @@
},
{ SOCK_RAW, &inet6domain, IPPROTO_DSTOPTS,PR_ATOMIC|PR_ADDR,
dest6_input, 0, 0, 0,
- 0,
+ 0,
0, 0, 0, 0,
&nousrreqs
},
{ SOCK_RAW, &inet6domain, IPPROTO_ROUTING,PR_ATOMIC|PR_ADDR,
route6_input, 0, 0, 0,
- 0,
+ 0,
0, 0, 0, 0,
&nousrreqs
},
{ SOCK_RAW, &inet6domain, IPPROTO_FRAGMENT,PR_ATOMIC|PR_ADDR,
frag6_input, 0, 0, 0,
- 0,
+ 0,
0, 0, 0, 0,
&nousrreqs
},
#ifdef IPSEC
{ SOCK_RAW, &inet6domain, IPPROTO_AH, PR_ATOMIC|PR_ADDR,
ah6_input, 0, 0, 0,
- 0,
+ 0,
0, 0, 0, 0,
&nousrreqs,
},
@@ -222,7 +222,7 @@
#endif
{ SOCK_RAW, &inet6domain, IPPROTO_IPCOMP, PR_ATOMIC|PR_ADDR,
ipcomp6_input, 0, 0, 0,
- 0,
+ 0,
0, 0, 0, 0,
&nousrreqs,
},
@@ -299,7 +299,7 @@
int ip6_gif_hlim = 0;
int ip6_use_deprecated = 1; /* allow deprecated addr (RFC2462 5.5.4) */
int ip6_rr_prune = 5; /* router renumbering prefix
- * walk list every 5 sec. */
+ * walk list every 5 sec. */
int ip6_v6only = 1;
#ifndef RANDOM_IP_ID
==== //depot/projects/netperf/sys/netinet6/in6_rmx.c#7 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/netinet6/in6_rmx.c,v 1.7 2003/10/04 03:44:49 sam Exp $ */
+/* $FreeBSD: src/sys/netinet6/in6_rmx.c,v 1.8 2003/10/08 18:26:08 ume Exp $ */
/* $KAME: in6_rmx.c,v 1.11 2001/07/26 06:53:16 jinmei Exp $ */
/*
@@ -234,17 +234,17 @@
/* one hour is ``really old'' */
SYSCTL_INT(_net_inet6_ip6, IPV6CTL_RTEXPIRE, rtexpire,
CTLFLAG_RW, &rtq_reallyold , 0, "");
-
+
static int rtq_minreallyold = 10;
/* never automatically crank down to less */
SYSCTL_INT(_net_inet6_ip6, IPV6CTL_RTMINEXPIRE, rtminexpire,
CTLFLAG_RW, &rtq_minreallyold , 0, "");
-
+
static int rtq_toomany = 128;
/* 128 cached routes is ``too many'' */
SYSCTL_INT(_net_inet6_ip6, IPV6CTL_RTMAXCACHE, rtmaxcache,
CTLFLAG_RW, &rtq_toomany , 0, "");
-
+
/*
* On last reference drop, mark the route as belong to us so that it can be
==== //depot/projects/netperf/sys/netinet6/in6_src.c#5 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/netinet6/in6_src.c,v 1.12 2003/10/06 14:02:08 ume Exp $ */
+/* $FreeBSD: src/sys/netinet6/in6_src.c,v 1.13 2003/10/08 18:26:08 ume Exp $ */
/* $KAME: in6_src.c,v 1.37 2001/03/29 05:34:31 itojun Exp $ */
/*
@@ -274,26 +274,7 @@
if (ia6 == 0) /* xxx scope error ?*/
ia6 = ifatoia6(ro->ro_rt->rt_ifa);
}
-#if 0
- /*
- * xxx The followings are necessary? (kazu)
- * I don't think so.
- * It's for SO_DONTROUTE option in IPv4.(jinmei)
- */
if (ia6 == 0) {
- struct sockaddr_in6 sin6 = {sizeof(sin6), AF_INET6, 0};
-
- sin6->sin6_addr = *dst;
-
- ia6 = ifatoia6(ifa_ifwithdstaddr(sin6tosa(&sin6)));
- if (ia6 == 0)
- ia6 = ifatoia6(ifa_ifwithnet(sin6tosa(&sin6)));
- if (ia6 == 0)
- return (0);
- return (&satosin6(&ia6->ia_addr)->sin6_addr);
- }
-#endif /* 0 */
- if (ia6 == 0) {
*errorp = EHOSTUNREACH; /* no route */
return (0);
}
@@ -422,14 +403,14 @@
}
/*
- * generate kernel-internal form (scopeid embedded into s6_addr16[1]).
+ * Generate kernel-internal form (scopeid embedded into s6_addr16[1]).
* If the address scope of is link-local, embed the interface index in the
* address. The routine determines our precedence
* between advanced API scope/interface specification and basic API
* specification.
*
- * this function should be nuked in the future, when we get rid of
- * embedded scopeid thing.
+ * This function should be nuked in the future, when we get rid of embedded
+ * scopeid thing.
*
* XXX actually, it is over-specification to return ifp against sin6_scope_id.
* there can be multiple interfaces that belong to a particular scope zone
@@ -489,7 +470,7 @@
if (scopeid < 0 || if_index < scopeid)
return ENXIO; /* XXX EINVAL? */
ifp = ifnet_byindex(scopeid);
- /*XXX assignment to 16bit from 32bit variable */
+ /* XXX assignment to 16bit from 32bit variable */
in6->s6_addr16[1] = htons(scopeid & 0xffff);
}
@@ -547,7 +528,7 @@
}
/*
- * just clear the embedded scope identifer.
+ * just clear the embedded scope identifier.
* XXX: currently used for bsdi4 only as a supplement function.
*/
void
==== //depot/projects/netperf/sys/netinet6/in6_var.h#2 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/netinet6/in6_var.h,v 1.12 2003/03/04 23:19:53 jlemon Exp $ */
+/* $FreeBSD: src/sys/netinet6/in6_var.h,v 1.13 2003/10/08 18:26:08 ume Exp $ */
/* $KAME: in6_var.h,v 1.56 2001/03/29 05:34:31 itojun Exp $ */
/*
@@ -105,9 +105,8 @@
struct in6_addrlifetime ia6_lifetime;
struct ifprefix *ia6_ifpr; /* back pointer to ifprefix */
- struct nd_prefix *ia6_ndpr; /* back pointer to the ND prefix
- * (for autoconfigured addresses only)
- */
+ /* back pointer to the ND prefix (for autoconfigured addresses only) */
+ struct nd_prefix *ia6_ndpr;
};
/*
@@ -458,14 +457,14 @@
&& in6_ifstat && in6_ifstat[(ifp)->if_index]) { \
in6_ifstat[(ifp)->if_index]->tag++; \
} \
-} while (0)
+} while (/*CONSTCOND*/ 0)
extern struct in6_addr zeroin6_addr;
extern u_char inet6ctlerrmap[];
extern unsigned long in6_maxmtu;
#ifdef MALLOC_DECLARE
MALLOC_DECLARE(M_IPMADDR);
-#endif
+#endif /* MALLOC_DECLARE */
/*
* Macro for finding the internet address structure (in6_ifaddr) corresponding
@@ -484,7 +483,7 @@
break; \
} \
(ia) = (struct in6_ifaddr *)ifa; \
-} while (0)
+} while (/*CONSTCOND*/ 0)
#endif /* _KERNEL */
@@ -564,15 +563,15 @@
} while(0)
struct in6_multi *in6_addmulti __P((struct in6_addr *, struct ifnet *,
- int *));
+ int *));
void in6_delmulti __P((struct in6_multi *));
extern int in6_ifindex2scopeid __P((int));
extern int in6_mask2len __P((struct in6_addr *, u_char *));
extern void in6_len2mask __P((struct in6_addr *, int));
-int in6_control __P((struct socket *,
- u_long, caddr_t, struct ifnet *, struct thread *));
+int in6_control __P((struct socket *, u_long, caddr_t, struct ifnet *,
+ struct thread *));
int in6_update_ifa __P((struct ifnet *, struct in6_aliasreq *,
- struct in6_ifaddr *));
+ struct in6_ifaddr *));
void in6_purgeaddr __P((struct ifaddr *));
int in6if_do_dad __P((struct ifnet *));
void in6_purgeif __P((struct ifnet *));
@@ -581,18 +580,16 @@
void in6_restoremkludge __P((struct in6_ifaddr *, struct ifnet *));
void in6_purgemkludge __P((struct ifnet *));
struct in6_ifaddr *in6ifa_ifpforlinklocal __P((struct ifnet *, int));
-struct in6_ifaddr *in6ifa_ifpwithaddr __P((struct ifnet *,
- struct in6_addr *));
+struct in6_ifaddr *in6ifa_ifpwithaddr __P((struct ifnet *, struct in6_addr *));
char *ip6_sprintf __P((const struct in6_addr *));
int in6_addr2scopeid __P((struct ifnet *, struct in6_addr *));
int in6_matchlen __P((struct in6_addr *, struct in6_addr *));
-int in6_are_prefix_equal __P((struct in6_addr *p1, struct in6_addr *p2,
- int len));
-void in6_prefixlen2mask __P((struct in6_addr *maskp, int len));
-int in6_prefix_ioctl __P((struct socket *so, u_long cmd, caddr_t data,
- struct ifnet *ifp));
-int in6_prefix_add_ifid __P((int iilen, struct in6_ifaddr *ia));
-void in6_prefix_remove_ifid __P((int iilen, struct in6_ifaddr *ia));
+int in6_are_prefix_equal __P((struct in6_addr *, struct in6_addr *, int));
+void in6_prefixlen2mask __P((struct in6_addr *, int));
+int in6_prefix_ioctl __P((struct socket *, u_long, caddr_t,
+ struct ifnet *));
+int in6_prefix_add_ifid __P((int, struct in6_ifaddr *));
+void in6_prefix_remove_ifid __P((int, struct in6_ifaddr *));
void in6_purgeprefix __P((struct ifnet *));
int in6_is_addr_deprecated __P((struct sockaddr_in6 *));
==== //depot/projects/netperf/sys/netinet6/ip6_forward.c#6 (text+ko) ====
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/netinet6/ip6_forward.c,v 1.18 2003/09/30 04:46:08 sam Exp $ */
+/* $FreeBSD: src/sys/netinet6/ip6_forward.c,v 1.19 2003/10/08 18:26:08 ume Exp $ */
/* $KAME: ip6_forward.c,v 1.69 2001/05/17 03:48:30 itojun Exp $ */
/*
@@ -139,7 +139,7 @@
* Do not forward packets to multicast destination (should be handled
* by ip6_mforward().
* Do not forward packets with unspecified source. It was discussed
- * in July 2000, on ipngwg mailing list.
+ * in July 2000, on the ipngwg mailing list.
*/
if ((m->m_flags & (M_BCAST|M_MCAST)) != 0 ||
IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) ||
@@ -181,8 +181,8 @@
#ifdef IPSEC
/* get a security policy for this packet */
- sp = ipsec6_getpolicybyaddr(m, IPSEC_DIR_OUTBOUND, IP_FORWARDING,
- &error);
+ sp = ipsec6_getpolicybyaddr(m, IPSEC_DIR_OUTBOUND,
+ IP_FORWARDING, &error);
if (sp == NULL) {
ipsec6stat.out_inval++;
ip6stat.ip6s_cantforward++;
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list