The NetBSD Project

CVS log for src/sys/netinet6/in6_pcb.h

[BACK] Up to [] / src / sys / netinet6

Request diff between arbitrary revisions

Default branch: MAIN
Current tag: MAIN

Revision 1.52 / (download) - annotate - [select for diffs], Tue Sep 8 14:12:57 2020 UTC (12 months, 2 weeks ago) by christos
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-futex, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, HEAD
Changes since 1.51: +17 -17 lines
Diff to previous 1.51 (colored)

Add IP_BINDANY, IPV6_BINDANY which can be used to bind to any address in
order to implement transparent proxies.

Revision 1.51 / (download) - annotate - [select for diffs], Thu Aug 20 21:21:32 2020 UTC (13 months ago) by riastradh
Branch: MAIN
Changes since 1.50: +11 -1 lines
Diff to previous 1.50 (colored)

[ozaki-r] Changes to the kernel core for wireguard

Revision 1.50 / (download) - annotate - [select for diffs], Thu Nov 22 04:48:34 2018 UTC (2 years, 10 months ago) by knakahara
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, netbsd-9-base, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, isaki-audio2-base, isaki-audio2, is-mlppp-base, is-mlppp, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh, ad-namecache-base3, ad-namecache-base2, ad-namecache-base1, ad-namecache-base, ad-namecache
Changes since 1.49: +3 -1 lines
Diff to previous 1.49 (colored)

Support IPv6 NAT-T. Implemented by hsuenaga@IIJ and ohishi@IIJ.

Add ATF later.

Revision 1.49 / (download) - annotate - [select for diffs], Thu Mar 2 05:26:24 2017 UTC (4 years, 6 months ago) by ozaki-r
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202, prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-compat-base, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1
Branch point for: phil-wifi, pgoyette-compat
Changes since 1.48: +4 -2 lines
Diff to previous 1.48 (colored)

Make sure im6o_memberships is protected by in6p's lock (solock)

Revision 1.48 / (download) - annotate - [select for diffs], Wed Feb 22 07:05:04 2017 UTC (4 years, 7 months ago) by ozaki-r
Branch: MAIN
Changes since 1.47: +3 -1 lines
Diff to previous 1.47 (colored)

Add assertions and comments for lock states of socket and pcb

Revision 1.47 / (download) - annotate - [select for diffs], Thu Dec 8 05:16:34 2016 UTC (4 years, 9 months ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-localcount-20170107, nick-nhusb-base-20170204, bouyer-socketcan-base
Branch point for: bouyer-socketcan
Changes since 1.46: +3 -1 lines
Diff to previous 1.46 (colored)

Add rtcache_unref to release points of rtentry stemming from rtcache

In the MP-safe world, a rtentry stemming from a rtcache can be freed at any
points. So we need to protect rtentries somehow say by reference couting or
passive references. Regardless of the method, we need to call some release
function of a rtentry after using it.

The change adds a new function rtcache_unref to release a rtentry. At this
point, this function does nothing because for now we don't add a reference
to a rtentry when we get one from a rtcache. We will add something useful
in a further commit.

This change is a part of changes for MP-safe routing table. It is separated
to avoid one big change that makes difficult to debug by bisecting.

Revision 1.46 / (download) - annotate - [select for diffs], Sun May 24 15:43:45 2015 UTC (6 years, 4 months ago) by rtr
Branch: MAIN
CVS Tags: pgoyette-localcount-base, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20161204, nick-nhusb-base-20161004, nick-nhusb-base-20160907, nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226, nick-nhusb-base-20150921, nick-nhusb-base-20150606, localcount-20160914
Branch point for: pgoyette-localcount
Changes since 1.45: +1 -2 lines
Diff to previous 1.45 (colored)

remove transitional functions in{,6}_pcbconnect_m() that were used in
converting protocol user requests to accept sockaddr instead of mbufs.

remove tcp_input copy in to mbuf from sockaddr and just copy to sockaddr
to make it possible for the transitional functions to go away.

no version bump since these functions only existed for a short time and
were commented as adapters (they appeared in 7.99.15).

Revision 1.45 / (download) - annotate - [select for diffs], Sat May 2 17:18:03 2015 UTC (6 years, 4 months ago) by rtr
Branch: MAIN
Changes since 1.44: +3 -2 lines
Diff to previous 1.44 (colored)

make connect syscall use sockaddr_big and modify pr_{send,connect}
nam parameter type from buf * to sockaddr *.

final commit for parameter type changes to protocol user requests

* bump kernel version to 7.99.15 for parameter type changes to pr_{send,connect}

Revision 1.44 / (download) - annotate - [select for diffs], Mon Apr 27 02:59:44 2015 UTC (6 years, 5 months ago) by ozaki-r
Branch: MAIN
Changes since 1.43: +2 -1 lines
Diff to previous 1.43 (colored)

Introduce in6_selecthlim_rt to consolidate an idiom for rt->rt_ifp

It consolidates a scattered routine:
(rt = rtcache_validate(&in6p->in6p_route)) != NULL ? rt->rt_ifp : NULL

Revision 1.43 / (download) - annotate - [select for diffs], Fri Apr 24 22:32:37 2015 UTC (6 years, 5 months ago) by rtr
Branch: MAIN
Changes since 1.42: +3 -3 lines
Diff to previous 1.42 (colored)

make accept, getsockname and getpeername syscalls use sockaddr_big and modify
pr_{accept,sockname,peername} nam parameter type from mbuf * to sockaddr *.

* retained use of mbuftypes[MT_SONAME] for now.
* bump to netbsd version 7.99.12 for parameter type change.

patch posted to tech-net@ 2015/04/19

Revision 1.42 / (download) - annotate - [select for diffs], Fri Apr 3 20:01:07 2015 UTC (6 years, 5 months ago) by rtr
Branch: MAIN
CVS Tags: nick-nhusb-base-20150406
Changes since 1.41: +2 -2 lines
Diff to previous 1.41 (colored)

* change pr_bind to accept struct sockaddr * instead of struct mbuf *
* update protocol bind implementations to use/expect sockaddr *
  instead of mbuf *
* introduce sockaddr_big struct for storage of addr data passed via
  sys_bind; sockaddr_big is of sufficient size and alignment to
  accommodate all addr data sizes received.
* modify sys_bind to allocate sockaddr_big instead of using an mbuf.
* bump kernel version to 7.99.9 for change to pr_bind() parameter type.

Patch posted to tech-net@

The choice to use a new structure sockaddr_big has been retained since
changing sockaddr_storage size would lead to unnecessary ABI change. The
use of the new structure does not preclude future work that increases
the size of sockaddr_storage and at that time sockaddr_big may be
trivially replaced.

Tested by mrg@ and myself, discussed with rmind@, posted to tech-net@

Revision 1.41 / (download) - annotate - [select for diffs], Mon Mar 30 02:23:21 2015 UTC (6 years, 6 months ago) by ozaki-r
Branch: MAIN
Changes since 1.40: +2 -1 lines
Diff to previous 1.40 (colored)

Include ip6.h for ip6_hdr

Revision 1.40 / (download) - annotate - [select for diffs], Sat Oct 11 20:53:16 2014 UTC (6 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: nick-nhusb-base
Branch point for: nick-nhusb
Changes since 1.39: +2 -1 lines
Diff to previous 1.39 (colored)

Make IPV4 mapped addresses able to do IPV4 multicast. Fixes needed:

	- allow binding to mapped v4 multicast addresses
	- define v4moptions, allow setting it via ioctl, pass it to ip_output,
	  free it when killing the pcb.

Ideally we would allow the IPV6 multicast setsockopts work on mapped addresses
too, but this is a lot more work and linux does not do it either.

Revision 1.39 / (download) - annotate - [select for diffs], Tue Aug 5 05:24:27 2014 UTC (7 years, 1 month ago) by rtr
Branch: MAIN
CVS Tags: tls-maxphys-base, tls-earlyentropy-base, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7
Changes since 1.38: +1 -1 lines
Diff to previous 1.38 (colored)

revert the removal of struct lwp * parameter from bind, listen and connect
user requests.

this should resolve the issue relating to nfs client hangs presented
recently by wiz on current-users@

Revision 1.38 / (download) - annotate - [select for diffs], Thu Jul 24 15:12:03 2014 UTC (7 years, 2 months ago) by rtr
Branch: MAIN
Changes since 1.37: +2 -2 lines
Diff to previous 1.37 (colored)

split PRU_BIND and PRU_LISTEN function out of pr_generic() usrreq
switches and put into separate functions
  xxx_bind(struct socket *, struct mbuf *)
  xxx_listen(struct socket *)

  - always KASSERT(solocked(so)) even if not implemented

  - replace calls to pr_generic() with req = PRU_BIND with call to

  - replace calls to pr_generic() with req = PRU_LISTEN with call to

  - drop struct lwp * parameter from at_pcbsetaddr(), in_pcbbind() and
    unp_bind() and always use curlwp.

rename existing functions that operate on PCB for consistency (and to
free up their names for xxx_{bind,listen}() PRUs

  - l2cap_{bind,listen}() -> l2cap_{bind,listen}_pcb()
  - sco_{bind,listen}() -> sco_{bind,listen}_pcb()
  - rfcomm_{bind,listen}() -> rfcomm_{bind,listen}_pcb()

patch reviewed by rmind

welcome to netbsd 6.99.48

Revision 1.37 / (download) - annotate - [select for diffs], Mon Jun 25 15:28:39 2012 UTC (9 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, khorben-n900, agc-symver-base, agc-symver
Branch point for: tls-maxphys, tls-earlyentropy, rmind-smpnet
Changes since 1.36: +2 -2 lines
Diff to previous 1.36 (colored)

rename rfc6056 -> portalgo, requested by yamt

Revision 1.36 / (download) - annotate - [select for diffs], Sat Sep 24 17:22:14 2011 UTC (10 years ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base10, jmcneill-usbmp-base, jmcneill-usbmp, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: yamt-pagecache
Changes since 1.35: +11 -9 lines
Diff to previous 1.35 (colored)

Add inet6 part of the rfc6056 code contributed by Vlad Balan as part of
Google SoC-2011

Revision 1.35 / (download) - annotate - [select for diffs], Tue May 3 18:28:45 2011 UTC (10 years, 4 months ago) by dyoung
Branch: MAIN
CVS Tags: rmind-uvmplock-nbase, rmind-uvmplock-base, cherry-xenmp-base, cherry-xenmp
Changes since 1.34: +5 -4 lines
Diff to previous 1.34 (colored)

Reduces the resources demanded by TCP sessions in TIME_WAIT-state using
methods called Vestigial Time-Wait (VTW) and Maximum Segment Lifetime
Truncation (MSLT).

MSLT and VTW were contributed by Coyote Point Systems, Inc.

Even after a TCP session enters the TIME_WAIT state, its corresponding
socket and protocol control blocks (PCBs) stick around until the TCP
Maximum Segment Lifetime (MSL) expires.  On a host whose workload
necessarily creates and closes down many TCP sockets, the sockets & PCBs
for TCP sessions in TIME_WAIT state amount to many megabytes of dead
weight in RAM.

Maximum Segment Lifetimes Truncation (MSLT) assigns each TCP session to
a class based on the nearness of the peer.  Corresponding to each class
is an MSL, and a session uses the MSL of its class.  The classes are
loopback (local host equals remote host), local (local host and remote
host are on the same link/subnet), and remote (local host and remote
host communicate via one or more gateways).  Classes corresponding to
nearer peers have lower MSLs by default: 2 seconds for loopback, 10
seconds for local, 60 seconds for remote.  Loopback and local sessions
expire more quickly when MSLT is used.

Vestigial Time-Wait (VTW) replaces a TIME_WAIT session's PCB/socket
dead weight with a compact representation of the session, called a
"vestigial PCB".  VTW data structures are designed to be very fast and
memory-efficient: for fast insertion and lookup of vestigial PCBs,
the PCBs are stored in a hash table that is designed to minimize the
number of cacheline visits per lookup/insertion.  The memory both
for vestigial PCBs and for elements of the PCB hashtable come from
fixed-size pools, and linked data structures exploit this to conserve
memory by representing references with a narrow index/offset from the
start of a pool instead of a pointer.  When space for new vestigial PCBs
runs out, VTW makes room by discarding old vestigial PCBs, oldest first.
VTW cooperates with MSLT.

It may help to think of VTW as a "FIN cache" by analogy to the SYN

A 2.8-GHz Pentium 4 running a test workload that creates TIME_WAIT
sessions as fast as it can is approximately 17% idle when VTW is active
versus 0% idle when VTW is inactive.  It has 103 megabytes more free RAM
when VTW is active (approximately 64k vestigial PCBs are created) than
when it is inactive.

Revision 1.34 / (download) - annotate - [select for diffs], Thu Apr 30 18:18:34 2009 UTC (12 years, 5 months ago) by elad
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9, yamt-nfs-mp-base8, yamt-nfs-mp-base7, yamt-nfs-mp-base6, yamt-nfs-mp-base5, yamt-nfs-mp-base4, yamt-nfs-mp-base3, yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, uebayasi-xip-base1, uebayasi-xip-base, uebayasi-xip, matt-premerge-20091211, matt-mips64-premerge-20101231, jymxensuspend-base, jym-xensuspend-nbase, jym-xensuspend-base, jruoho-x86intr-base, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: rmind-uvmplock, jruoho-x86intr
Changes since 1.33: +2 -4 lines
Diff to previous 1.33 (colored)

- Make in6_pcbbind_{addr,port}() static

- Properly authorize port binding in in_pcbsetport() and in6_pcbsetport()

- Pass struct sockaddr_in6 to in6_pcbsetport() instead of just the address,
  so that we have a more complete context

- Adjust udp6_output() to craft a sockaddr_in6 as it calls in6_pcbsetport()

- Fix an issue in in_pcbbind() where we used the "dom_sa_any" pointer and
  not a copy of it, pointed out by bouyer@, thanks!

Mailing list reference:

Revision 1.33 / (download) - annotate - [select for diffs], Mon Apr 20 18:14:30 2009 UTC (12 years, 5 months ago) by elad
Branch: MAIN
CVS Tags: nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base
Changes since 1.32: +3 -1 lines
Diff to previous 1.32 (colored)

Extract in6_pcbbind()'s guts into two new routines: in6_pcbbind_addr() and
in6_pcbbind_port(), used for binding to an address and a port respectively.

While here, fix a possible "leak" of an in6pcb when binding to an address
succeeded but binding to an auto-assigned port failed.

Proposed and received no objections on tech-net@:

Revision 1.32 / (download) - annotate - [select for diffs], Wed May 2 20:40:26 2007 UTC (14 years, 4 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-x86pmap-base4, yamt-x86pmap-base3, yamt-x86pmap-base2, yamt-x86pmap-base, yamt-x86pmap, yamt-pf42-baseX, yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-pf42-base, yamt-pf42, yamt-nfs-mp-base2, yamt-nfs-mp-base, yamt-lazymbuf-base15, yamt-lazymbuf-base14, yamt-kmem-base3, yamt-kmem-base2, yamt-kmem-base, yamt-kmem, yamt-idlelwp-base8, wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, wrstuden-revivesa, vmlocking2-base3, vmlocking2-base2, vmlocking2-base1, vmlocking2, vmlocking-nbase, vmlocking-base, simonb-wapbl-nbase, simonb-wapbl-base, simonb-wapbl, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, nick-net80211-sync-base, nick-net80211-sync, nick-hppapmap-base2, nick-csl-alignment-base5, nick-csl-alignment-base, nick-csl-alignment, netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, mjf-ufs-trans-base, mjf-devfs2-base, mjf-devfs2, mjf-devfs-base, mjf-devfs, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2, matt-mips64-base, matt-mips64, matt-armv6-prevmlocking, matt-armv6-nbase, matt-armv6-base, matt-armv6, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, jmcneill-pm-base, jmcneill-pm, jmcneill-base, hpcarm-cleanup-nbase, hpcarm-cleanup-base, hpcarm-cleanup, haad-nbase2, haad-dm-base2, haad-dm-base1, haad-dm-base, haad-dm, cube-autoconf-base, cube-autoconf, bouyer-xeni386-nbase, bouyer-xeni386-merge1, bouyer-xeni386-base, bouyer-xeni386, bouyer-xenamd64-base2, bouyer-xenamd64-base, bouyer-xenamd64, ad-socklock-base1, ad-audiomp2-base, ad-audiomp2
Branch point for: yamt-nfs-mp, nick-hppapmap, jym-xensuspend
Changes since 1.31: +2 -2 lines
Diff to previous 1.31 (colored)

Eliminate address family-specific route caches (struct route, struct
route_in6, struct route_iso), replacing all caches with a struct

The principle benefit of this change is that all of the protocol
families can benefit from route cache-invalidation, which is
necessary for correct routing.  Route-cache invalidation fixes an
ancient PR, kern/3508, at long last; it fixes various other PRs,

Discussions with and ideas from Joerg Sonnenberger influenced this
work tremendously.  Of course, all design oversights and bugs are


1 I added to each address family a pool of sockaddrs.  I have
  introduced routines for allocating, copying, and duplicating,
  and freeing sockaddrs:

        struct sockaddr *sockaddr_alloc(sa_family_t af, int flags);
        struct sockaddr *sockaddr_copy(struct sockaddr *dst,
                                       const struct sockaddr *src);
        struct sockaddr *sockaddr_dup(const struct sockaddr *src, int flags);
        void sockaddr_free(struct sockaddr *sa);

  sockaddr_alloc() returns either a sockaddr from the pool belonging
  to the specified family, or NULL if the pool is exhausted.  The
  returned sockaddr has the right size for that family; sa_family
  and sa_len fields are initialized to the family and sockaddr
  length---e.g., sa_family = AF_INET and sa_len = sizeof(struct
  sockaddr_in).  sockaddr_free() puts the given sockaddr back into
  its family's pool.

  sockaddr_dup() and sockaddr_copy() work analogously to strdup()
  and strcpy(), respectively.  sockaddr_copy() KASSERTs that the
  family of the destination and source sockaddrs are alike.

  The 'flags' argumet for sockaddr_alloc() and sockaddr_dup() is
  passed directly to pool_get(9).

2 I added routines for initializing sockaddrs in each address
  family, sockaddr_in_init(), sockaddr_in6_init(), sockaddr_iso_init(),
  etc.  They are fairly self-explanatory.

3 structs route_in6 and route_iso are no more.  All protocol families
  use struct route.  I have changed the route cache, 'struct route',
  so that it does not contain storage space for a sockaddr.  Instead,
  struct route points to a sockaddr coming from the pool the sockaddr
  belongs to.  I added a new method to struct route, rtcache_setdst(),
  for setting the cache destination:

        int rtcache_setdst(struct route *, const struct sockaddr *);

  rtcache_setdst() returns 0 on success, or ENOMEM if no memory is
  available to create the sockaddr storage.

  It is now possible for rtcache_getdst() to return NULL if, say,
  rtcache_setdst() failed.  I check the return value for NULL
  everywhere in the kernel.

4 Each routing domain (struct domain) has a list of live route
  caches, dom_rtcache.  rtflushall(sa_family_t af) looks up the
  domain indicated by 'af', walks the domain's list of route caches
  and invalidates each one.

Revision 1.31 / (download) - annotate - [select for diffs], Sat Feb 17 22:34:13 2007 UTC (14 years, 7 months ago) by dyoung
Branch: MAIN
CVS Tags: thorpej-atomic-base, thorpej-atomic, reinoud-bufcleanup, ad-audiomp-base, ad-audiomp
Branch point for: vmlocking, mjf-ufs-trans
Changes since 1.30: +4 -4 lines
Diff to previous 1.30 (colored)

KNF: de-__P, bzero -> memset, bcmp -> memcmp.  Remove extraneous
   parentheses in return statements.

Cosmetic: don't open-code TAILQ_FOREACH().

Cosmetic: change types of variables to avoid oodles of casts: in
   in6_src.c, avoid casts by changing several route_in6 pointers
   to struct route pointers.  Remove unnecessary casts to caddr_t

Pave the way for eliminating address family-specific route caches:
   soon, struct route will not embed a sockaddr, but it will hold
   a reference to an external sockaddr, instead.  We will set the
   destination sockaddr using rtcache_setdst().  (I created a stub
   for it, but it isn't used anywhere, yet.)  rtcache_free() will
   free the sockaddr.  I have extracted from rtcache_free() a helper
   subroutine, rtcache_clear().  rtcache_clear() will "forget" a
   cached route, but it will not forget the destination by releasing
   the sockaddr.  I use rtcache_clear() instead of rtcache_free()
   in rtcache_update(), because rtcache_update() is not supposed
   to forget the destination.


   1 Introduce const accessor for route->ro_dst, rtcache_getdst().

   2 Constify the 'dst' argument to ifnet->if_output().  This
     led me to constify a lot of code called by output routines.

   3 Constify the sockaddr argument to protosw->pr_ctlinput.  This
     led me to constify a lot of code called by ctlinput routines.

   4 Introduce const macros for converting from a generic sockaddr
     to family-specific sockaddrs, e.g., sockaddr_in: satocsin6,
     satocsin, et cetera.

Revision 1.30 / (download) - annotate - [select for diffs], Sun Jul 23 22:06:13 2006 UTC (15 years, 2 months ago) by ad
Branch: MAIN
CVS Tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3, yamt-splraiseipl-base2, yamt-splraiseipl-base, yamt-splraiseipl, yamt-pdpolicy-base9, yamt-pdpolicy-base8, yamt-pdpolicy-base7, wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, rpaulo-netinet-merge-pcb-base, post-newlock2-merge, newlock2-nbase, newlock2-base, newlock2, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, netbsd-4, matt-nb4-arm-base, matt-nb4-arm, abandoned-netbsd-4-base, abandoned-netbsd-4
Branch point for: yamt-idlelwp
Changes since 1.29: +4 -4 lines
Diff to previous 1.29 (colored)

Use the LWP cached credentials where sane.

Revision 1.29 / (download) - annotate - [select for diffs], Fri May 5 00:03:22 2006 UTC (15 years, 4 months ago) by rpaulo
Branch: MAIN
CVS Tags: yamt-pdpolicy-base6, yamt-pdpolicy-base5, simonb-timecounters-base, gdamore-uart-base, gdamore-uart, elad-kernelauth-base, chap-midi-nbase, chap-midi-base, chap-midi
Changes since 1.28: +7 -6 lines
Diff to previous 1.28 (colored)

Add support for RFC 3542 Adv. Socket API for IPv6 (which obsoletes 2292).
* RFC 3542 isn't binary compatible with RFC 2292.
* RFC 2292 support is on by default but can be disabled.
* update ping6, telnet and traceroute6 to the new API.

From the KAME project (
Reviewed by core.

Revision 1.28 / (download) - annotate - [select for diffs], Thu Jan 26 18:59:18 2006 UTC (15 years, 8 months ago) by rpaulo
Branch: MAIN
CVS Tags: yamt-uio_vmspace-base5, yamt-pdpolicy-base4, yamt-pdpolicy-base3, yamt-pdpolicy-base2, yamt-pdpolicy-base, peter-altq-base
Branch point for: yamt-pdpolicy, simonb-timecounters, rpaulo-netinet-merge-pcb, peter-altq, elad-kernelauth
Changes since 1.27: +25 -25 lines
Diff to previous 1.27 (colored)


Revision 1.27 / (download) - annotate - [select for diffs], Tue Nov 15 18:39:46 2005 UTC (15 years, 10 months ago) by dsl
Branch: MAIN
CVS Tags: yamt-readahead-base3, yamt-readahead-base2, ktrace-lwp-base
Branch point for: yamt-uio_vmspace
Changes since 1.26: +2 -2 lines
Diff to previous 1.26 (colored)

Pass the current process structure to in_pcbconnect() so that it can
pass it to in_pcbbind() so that can allocate a low numbered port
if setsockopt() has been used to set IP_PORTRANGE to IP_PORTRANGE_LOW.
While there, fail in_pcbconnect() if the in_pcbbind() fails - rather
than sending the request out from a port of zero.
This has been largely broken since the socket option was added in 1998.

Revision 1.26 / (download) - annotate - [select for diffs], Sun May 29 21:43:51 2005 UTC (16 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: yamt-vop-base3, yamt-vop-base2, yamt-vop-base, yamt-vop, yamt-readahead-pervnode, yamt-readahead-perfile, yamt-readahead-base, thorpej-vnode-attr-base, thorpej-vnode-attr
Branch point for: yamt-readahead, yamt-lazymbuf
Changes since 1.25: +3 -3 lines
Diff to previous 1.25 (colored)

- avoid shadowed variables
- sprinkle const.

Revision 1.25 / (download) - annotate - [select for diffs], Fri Jun 11 04:10:10 2004 UTC (17 years, 3 months ago) by itojun
Branch: MAIN
CVS Tags: yamt-km-base4, yamt-km-base3, yamt-km-base2, yamt-km-base, yamt-km, netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3, kent-audio2-base, kent-audio2, kent-audio1-beforemerge, kent-audio1-base, kent-audio1
Changes since 1.24: +4 -2 lines
Diff to previous 1.24 (colored)

implement IPV6_USE_MIN_MTU sockopt.  needed by bind9 + EDNS0 + big receive buffer.

Revision 1.24 / (download) - annotate - [select for diffs], Thu Sep 4 09:17:07 2003 UTC (18 years ago) by itojun
Branch: MAIN
CVS Tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Changes since 1.23: +31 -30 lines
Diff to previous 1.23 (colored)

revamp inpcb/in6pcb so that they are more aligned with each other.
in6pcb lookup now uses hash(9).

Revision 1.23 / (download) - annotate - [select for diffs], Mon Aug 25 00:14:30 2003 UTC (18 years, 1 month ago) by itojun
Branch: MAIN
Changes since 1.22: +3 -10 lines
Diff to previous 1.22 (colored)

g/c unused member.  use in6p_ip6 more effectively.

Revision 1.22 / (download) - annotate - [select for diffs], Thu Aug 7 16:33:25 2003 UTC (18 years, 1 month ago) by agc
Branch: MAIN
Changes since 1.21: +2 -6 lines
Diff to previous 1.21 (colored)

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.

Revision 1.21 / (download) - annotate - [select for diffs], Mon Aug 26 14:25:00 2002 UTC (19 years, 1 month ago) by itojun
Branch: MAIN
CVS Tags: nathanw_sa_before_merge, nathanw_sa_base, kqueue-beforemerge, kqueue-base, kqueue-aftermerge, gmcgarry_ucred_base, gmcgarry_ucred, gmcgarry_ctxsw_base, gmcgarry_ctxsw, gehenna-devsw-base, fvdl_fs64_base
Branch point for: ktrace-lwp
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

pass proc * to in6_pcbsetport.  PR 18073

Revision 1.20 / (download) - annotate - [select for diffs], Sat Jun 8 21:22:31 2002 UTC (19 years, 3 months ago) by itojun
Branch: MAIN
Changes since 1.19: +1 -6 lines
Diff to previous 1.19 (colored)

sync with latest KAME in6_ifaddr/prefix/default router manipulation.
behavior changes:
- two iocts used by ndp(8) are now obsolete (backward compat provided).
  use sysctl path instead.
- lo0 does not get ::1 automatically.  it will get ::1 when lo0 comes up.

Revision 1.19 / (download) - annotate - [select for diffs], Wed Oct 24 06:36:38 2001 UTC (19 years, 11 months ago) by itojun
Branch: MAIN
CVS Tags: thorpej-mips-cache-base, newlock-base, newlock, netbsd-1-6-base, netbsd-1-6-RC1, ifpoll-base, eeh-devprop-base, eeh-devprop
Branch point for: netbsd-1-6, gehenna-devsw
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored)

more whitespace sync with kame

Revision 1.18 / (download) - annotate - [select for diffs], Mon Oct 15 09:51:16 2001 UTC (19 years, 11 months ago) by itojun
Branch: MAIN
Branch point for: thorpej-mips-cache
Changes since 1.17: +4 -1 lines
Diff to previous 1.17 (colored)

implement IPV6_V6ONLY socket option from draft-ietf-ipngwg-rfc2553bis-03.txt.
IPV6_BINDV6ONLY (netbsd only) is deprecated, but still work just like before.

Revision 1.17 / (download) - annotate - [select for diffs], Mon Jul 2 15:25:36 2001 UTC (20 years, 3 months ago) by itojun
Branch: MAIN
CVS Tags: thorpej-devvp-base3, thorpej-devvp-base2, thorpej-devvp-base, thorpej-devvp, pre-chs-ubcperf, post-chs-ubcperf
Branch point for: kqueue
Changes since 1.16: +2 -1 lines
Diff to previous 1.16 (colored)

on interface removal, remove multicast groups joined from pcb, before
removing interface addresses.  without the change, we may deref
NULL pointer in in_pcbpurgeif().  from jinmei@kame, sync with kame

Revision 1.16 / (download) - annotate - [select for diffs], Sun Feb 11 06:50:59 2001 UTC (20 years, 7 months ago) by itojun
Branch: MAIN
CVS Tags: thorpej_scsipi_nbase, thorpej_scsipi_beforemerge, thorpej_scsipi_base
Branch point for: nathanw_sa
Changes since 1.15: +3 -1 lines
Diff to previous 1.15 (colored)

wrap kernel-only #define (kame cross-bsd portability) into _KERNEL.

Revision 1.15 / (download) - annotate - [select for diffs], Sun Feb 11 06:49:52 2001 UTC (20 years, 7 months ago) by itojun
Branch: MAIN
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored)

pull latest kame pcbnotify code.  synchronizes ICMPv6 path mtu discovery
behavior with other protocols (i.e. validation, use of hiwat/lowat).

Revision 1.14 / (download) - annotate - [select for diffs], Thu Feb 8 14:56:15 2001 UTC (20 years, 7 months ago) by itojun
Branch: MAIN
Changes since 1.13: +2 -6 lines
Diff to previous 1.13 (colored)

amove in6_{embed,recover}scope prototypes to in6_var.h (kernel only).
add in6_clearscope.  sync with kame

Revision 1.13 / (download) - annotate - [select for diffs], Thu Oct 19 20:23:02 2000 UTC (20 years, 11 months ago) by itojun
Branch: MAIN
Changes since 1.12: +1 -3 lines
Diff to previous 1.12 (colored)

remove #ifdef TCP6.  it is not likely for us to bring in sys/netinet6/tcp6*.c
(separate TCP/IPv6 stack) into netbsd-current.

Revision 1.12 / (download) - annotate - [select for diffs], Fri Jul 7 15:54:18 2000 UTC (21 years, 2 months ago) by itojun
Branch: MAIN
Changes since 1.11: +9 -3 lines
Diff to previous 1.11 (colored)

sync with kame.
introduce in6_{recover,embed}scope, for in-kernel scoped-address manipulation.
improve in6_pcbnotify.

Revision 1.11 / (download) - annotate - [select for diffs], Mon Jun 5 06:38:23 2000 UTC (21 years, 3 months ago) by itojun
Branch: MAIN
CVS Tags: netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, netbsd-1-5
Changes since 1.10: +5 -4 lines
Diff to previous 1.10 (colored)

pass struct proc * down to udp6_output and in6_pcbbind.

Revision 1.10 / (download) - annotate - [select for diffs], Thu Feb 3 13:17:41 2000 UTC (21 years, 7 months ago) by itojun
Branch: MAIN
CVS Tags: minoura-xpg4dl-base, chs-ubc2-newbase
Branch point for: minoura-xpg4dl
Changes since 1.9: +3 -3 lines
Diff to previous 1.9 (colored)

use u_int16_t, not u_short, for port #.

Revision 1.9 / (download) - annotate - [select for diffs], Wed Feb 2 23:28:10 2000 UTC (21 years, 7 months ago) by thorpej
Branch: MAIN
Changes since 1.8: +2 -1 lines
Diff to previous 1.8 (colored)

PRU_PURGEADDR -> PRU_PURGEIF, per a discussion w/ itojun.  In the IPv4
and IPv6 code, also use this to traverse PCB tables, looking for cached
routes referencing the dying ifnet, forcing them to be refreshed.

Revision 1.8 / (download) - annotate - [select for diffs], Mon Jan 31 14:19:03 2000 UTC (21 years, 8 months ago) by itojun
Branch: MAIN
Changes since 1.7: +3 -4 lines
Diff to previous 1.7 (colored)

bring in latest KAME ipsec tree.
- interop issues in ipcomp is fixed
- padding type (after ESP) is configurable
- key database memory management (need more fixes)
- policy specification is revisited

XXX m->m_pkthdr.rcvif is still overloaded - hope to fix it soon

Revision 1.7 / (download) - annotate - [select for diffs], Mon Dec 27 06:38:47 1999 UTC (21 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.6: +25 -16 lines
Diff to previous 1.6 (colored)

synchronize in6pcb flags definition across kame/*bsd.
this would help us implement future COMPAT_{FREE,OPEN}BSD{,I}.

(sync with kame)

Revision 1.6 / (download) - annotate - [select for diffs], Mon Dec 13 15:17:22 1999 UTC (21 years, 9 months ago) by itojun
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221
Changes since 1.5: +7 -6 lines
Diff to previous 1.5 (colored)

sync IPv6 part with latest KAME tree.   IPsec part is left unmodified
due to massive changes in KAME side.
- IPv6 output goes through nd6_output
- faith can capture IPv4 packets as well - you can run IPv4-to-IPv6 translator
  using heavily modified DNS servers
- per-interface statistics (required for IPv6 MIB)
- interface autoconfig is revisited
- udp input handling has a big change for mapped address support.
- introduce in4_cksum() for non-overwriting checksumming
- introduce m_pulldown()
- neighbor discovery cleanups/improvements
- netinet/in.h strictly conforms to RFC2553 (no extra defs visible to userland)
- IFA_STATS is fixed a bit (not tested)
- and more more more.

- cleanup os-independency #ifdef
- avoid rcvif dual use (for IPsec) to help ifdetach

(sorry for jumbo commit, I can't separate this any more...)

Revision 1.5 / (download) - annotate - [select for diffs], Thu Jul 22 03:59:42 1999 UTC (22 years, 2 months ago) by itojun
Branch: MAIN
CVS Tags: fvdl-softdep-base, fvdl-softdep, comdex-fall-1999-base, comdex-fall-1999, chs-ubc2-base
Branch point for: wrstuden-devbsize, thorpej_scsipi
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored)

change unnecessary u_long/long into u_int32_t or something relevant.
more fixes should follow.

Revision 1.4 / (download) - annotate - [select for diffs], Sat Jul 17 07:07:09 1999 UTC (22 years, 2 months ago) by itojun
Branch: MAIN
Changes since 1.3: +3 -3 lines
Diff to previous 1.3 (colored)

fix faith interface support.  need testing.
(i understand this is a dirty hack, of course)

Revision 1.3 / (download) - annotate - [select for diffs], Sat Jul 3 21:30:18 1999 UTC (22 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.2: +2 -0 lines
Diff to previous 1.2 (colored)

RCS ID police.

Revision 1.2 / (download) - annotate - [select for diffs], Thu Jul 1 08:12:55 1999 UTC (22 years, 3 months ago) by itojun
Branch: MAIN
Branch point for: chs-ubc2
Changes since 1.1: +176 -0 lines
Diff to previous 1.1 (colored)

IPv6 kernel code, based on KAME/NetBSD 1.4, SNAP kit 19990628.
(Sorry for a big commit, I can't separate this into several pieces...)
Pls check sys/netinet6/TODO and sys/netinet6/IMPLEMENTATION for details.

- sys/kern: do not assume single mbuf, accept chained mbuf on passing
  data from userland to kernel (or other way round).
- "midway" ATM card: ATM PVC pseudo device support, like those done in ALTQ
  package (
- sys/netinet/tcp*: IPv4/v6 dual stack tcp support.
- sys/netinet/{ip6,icmp6}.h, sys/net/pfkeyv2.h: IETF document assumes those
  file to be there so we patch it up.
- sys/netinet: IPsec additions are here and there.
- sys/netinet6/*: most of IPv6 code sits here.
- sys/netkey: IPsec key management code
- dev/pci/pcidevs: regen

In my understanding no code here is subject to export control so it
should be safe.

Revision 1.1, Mon Jun 28 06:37:04 1999 UTC (22 years, 3 months ago) by itojun
Branch: MAIN
Branch point for: kame

file in6_pcb.h was initially added on branch kame.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

CVSweb <>