The NetBSD Project

CVS log for src/sys/netinet/ip_output.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / netinet

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.218 / (download) - annotate - [select for diffs], Sat Feb 2 07:00:40 2013 UTC (3 months, 2 weeks ago) by kefren
Branch: MAIN
CVS Tags: tls-maxphys-nbase, tls-maxphys-base, khorben-n900, agc-symver-base, agc-symver, HEAD
Changes since 1.217: +4 -9 lines
Diff to previous 1.217 (colored)

get rid of ip_len local variable. Use ntohs(ip->ip_len) like the rest
of the code in the two places this variable was used

Revision 1.217 / (download) - annotate - [select for diffs], Mon Jun 25 15:28:39 2012 UTC (10 months, 4 weeks ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6
Branch point for: tls-maxphys
Changes since 1.216: +5 -5 lines
Diff to previous 1.216 (colored)

rename rfc6056 -> portalgo, requested by yamt

Revision 1.216 / (download) - annotate - [select for diffs], Fri Jun 22 14:54:35 2012 UTC (11 months ago) by christos
Branch: MAIN
Changes since 1.215: +17 -4 lines
Diff to previous 1.215 (colored)

PR/46602: Move the rfc6056 port randomization to the IP layer.

Revision 1.215 / (download) - annotate - [select for diffs], Mon Apr 30 22:51:28 2012 UTC (12 months, 3 weeks ago) by rmind
Branch: MAIN
CVS Tags: yamt-pagecache-base5, jmcneill-usbmp-base10
Changes since 1.214: +10 -11 lines
Diff to previous 1.214 (colored)

- Replace some malloc(9) uses with kmem(9).
- G/C M_IPMOPTS, M_IPMADDR and M_BWMETER.

Revision 1.214 / (download) - annotate - [select for diffs], Thu Mar 22 20:34:39 2012 UTC (14 months ago) by drochner
Branch: MAIN
CVS Tags: yamt-pagecache-base4, jmcneill-usbmp-base9, jmcneill-usbmp-base8
Changes since 1.213: +5 -185 lines
Diff to previous 1.213 (colored)

remove KAME IPSEC, replaced by FAST_IPSEC

Revision 1.213 / (download) - annotate - [select for diffs], Wed Feb 15 16:11:23 2012 UTC (15 months, 1 week ago) by drochner
Branch: MAIN
CVS Tags: 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, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, 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-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2
Changes since 1.212: +3 -3 lines
Diff to previous 1.212 (colored)

fix for IPSEC tunnel + NAT-T + esp_frag:
Output packets larger than "esp_frag" are fragmented first
and then reinjected into ip_output for encapsulation
and transfer. The problem was that each packet got a new
ip_id value assigned, so that fragments couldn't be matched
by the receiver. Offset information was overwritten too.
approved by releng

Revision 1.212 / (download) - annotate - [select for diffs], Sat Dec 31 20:41:59 2011 UTC (16 months, 3 weeks ago) by christos
Branch: MAIN
Changes since 1.211: +3 -3 lines
Diff to previous 1.211 (colored)

- fix offsetof usage, and redundant defines
- kill pointer casts to 0

Revision 1.211 / (download) - annotate - [select for diffs], Mon Dec 19 11:59:57 2011 UTC (17 months ago) by drochner
Branch: MAIN
Changes since 1.210: +16 -16 lines
Diff to previous 1.210 (colored)

rename the IPSEC in-kernel CPP variable and config(8) option to
KAME_IPSEC, and make IPSEC define it so that existing kernel
config files work as before
Now the default can be easily be changed to FAST_IPSEC just by
setting the IPSEC alias to FAST_IPSEC.

Revision 1.210 / (download) - annotate - [select for diffs], Mon Oct 31 13:16:01 2011 UTC (18 months, 3 weeks ago) by yamt
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: yamt-pagecache, jmcneill-usbmp
Changes since 1.209: +22 -17 lines
Diff to previous 1.209 (colored)

redo ip_output.c rev.1.206 and 1.207 differently.  PR/43664.
ok'ed by martin@

Revision 1.209 / (download) - annotate - [select for diffs], Sun Jul 17 20:54:53 2011 UTC (22 months, 1 week ago) by joerg
Branch: MAIN
Changes since 1.208: +2 -4 lines
Diff to previous 1.208 (colored)

Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.

Revision 1.208 / (download) - annotate - [select for diffs], Thu Apr 14 15:53:36 2011 UTC (2 years, 1 month ago) by yamt
Branch: MAIN
CVS Tags: rmind-uvmplock-nbase, rmind-uvmplock-base, cherry-xenmp-base, cherry-xenmp
Changes since 1.207: +6 -2 lines
Diff to previous 1.207 (colored)

after ip_input.c rev.1.285 and 1.286, restore kernel_lock for if_output.

Revision 1.207 / (download) - annotate - [select for diffs], Sat Apr 9 21:00:53 2011 UTC (2 years, 1 month ago) by martin
Branch: MAIN
Changes since 1.206: +5 -4 lines
Diff to previous 1.206 (colored)

PR kern/43664:
mlelstv pointed out that we sometimes may use checksums on loopback
interfaces. Make the test consistent with the code path selecting
the checksum operation before invoking fragmentation.

Revision 1.206 / (download) - annotate - [select for diffs], Sat Apr 9 20:34:36 2011 UTC (2 years, 1 month ago) by martin
Branch: MAIN
Changes since 1.205: +14 -9 lines
Diff to previous 1.205 (colored)

We do not do checksums on loopback interfaces, not even if fragmenting.
Fixes PR kern/43664.

Revision 1.205 / (download) - annotate - [select for diffs], Fri Jul 17 22:02:54 2009 UTC (3 years, 10 months ago) by minskim
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9, yamt-nfs-mp-base8, yamt-nfs-mp-base7, 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, jruoho-x86intr-base, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: rmind-uvmplock, jruoho-x86intr
Changes since 1.204: +15 -2 lines
Diff to previous 1.204 (colored)

Add the IP_MINTTL socket option.

The IP_MINTTL option may be used on SOCK_STREAM sockets to discard
packets with a TTL lower than the option value.  This can be used to
implement the Generalized TTL Security Mechanism (GTSM) according to
RFC 3682.

OK'ed by christos@.

Revision 1.204 / (download) - annotate - [select for diffs], Thu Jul 16 04:09:51 2009 UTC (3 years, 10 months ago) by minskim
Branch: MAIN
CVS Tags: yamt-nfs-mp-base6
Changes since 1.203: +12 -2 lines
Diff to previous 1.203 (colored)

Add the IP_RECVTTL option support.

If the IP_RECVTTL option is enabled on a SOCK_DGRAM socket, the
recvmsg(2) call will return the TTL of the received datagram.  The
msg_control field in the msghdr structure points to a buffer that
contains a cmsghdr structure followed by the TTL value.

Modeled after FreeBSD implementation.

Revision 1.203 / (download) - annotate - [select for diffs], Wed Jul 1 14:47:54 2009 UTC (3 years, 10 months ago) by martin
Branch: MAIN
Changes since 1.202: +5 -3 lines
Diff to previous 1.202 (colored)

From Wolfgang Stukenbrock in PR kern/41659: add missing splx().

Revision 1.202 / (download) - annotate - [select for diffs], Wed May 6 21:41:59 2009 UTC (4 years ago) by elad
Branch: MAIN
CVS Tags: yamt-nfs-mp-base5, yamt-nfs-mp-base4, jym-xensuspend-base
Changes since 1.201: +3 -15 lines
Diff to previous 1.201 (colored)

Remove some usage of "priv" and "privileged" variables and instead pass
around credentials. Also push down kauth(9) calls closer to where the
operation is done.

Mailing list reference:

	http://mail-index.netbsd.org/tech-net/2009/04/30/msg001270.html

Revision 1.201 / (download) - annotate - [select for diffs], Wed Mar 18 16:00:22 2009 UTC (4 years, 2 months ago) by cegger
Branch: MAIN
CVS Tags: yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base
Changes since 1.200: +3 -3 lines
Diff to previous 1.200 (colored)

bzero -> memset

Revision 1.200 / (download) - annotate - [select for diffs], Sun Oct 12 11:15:54 2008 UTC (4 years, 7 months ago) by plunky
Branch: MAIN
CVS Tags: nick-hppapmap-base2, netbsd-5-base, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, mjf-devfs2-base, matt-mips64-base2, haad-nbase2, haad-dm-base2, haad-dm-base1, haad-dm-base, ad-audiomp2-base, ad-audiomp2
Branch point for: nick-hppapmap, netbsd-5-0, netbsd-5, jym-xensuspend
Changes since 1.199: +77 -72 lines
Diff to previous 1.199 (colored)

update ip_pcbopts() to use sockopt(9) API.

cleans up function and one small fix is that we now stop copying user
options to the mbuf when the _EOL is given, previously this function
would continue to copy options.

Revision 1.199 / (download) - annotate - [select for diffs], Sun Oct 12 10:23:18 2008 UTC (4 years, 7 months ago) by plunky
Branch: MAIN
Changes since 1.198: +11 -6 lines
Diff to previous 1.198 (colored)

do not sleep while allocating memory here as socket lock is held

Revision 1.198 / (download) - annotate - [select for diffs], Sat Aug 16 21:51:43 2008 UTC (4 years, 9 months ago) by plunky
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2
Changes since 1.197: +4 -4 lines
Diff to previous 1.197 (colored)

constify sockopt in the PRCO_SETOPT path

Revision 1.197 / (download) - annotate - [select for diffs], Wed Aug 6 15:01:23 2008 UTC (4 years, 9 months ago) by plunky
Branch: MAIN
Changes since 1.196: +141 -156 lines
Diff to previous 1.196 (colored)

Convert socket options code to use a sockopt structure
instead of laying everything into an mbuf.

approved by core

Revision 1.196 / (download) - annotate - [select for diffs], Mon Apr 28 20:24:09 2008 UTC (5 years ago) by martin
Branch: MAIN
CVS Tags: yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-nfs-mp-base2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, simonb-wapbl-nbase, simonb-wapbl-base, simonb-wapbl, hpcarm-cleanup-nbase
Branch point for: wrstuden-revivesa, haad-dm
Changes since 1.195: +2 -9 lines
Diff to previous 1.195 (colored)

Remove clause 3 and 4 from TNF licenses

Revision 1.195 / (download) - annotate - [select for diffs], Wed Apr 23 06:09:04 2008 UTC (5 years, 1 month ago) by thorpej
Branch: MAIN
CVS Tags: yamt-nfs-mp-base
Branch point for: yamt-nfs-mp
Changes since 1.194: +5 -4 lines
Diff to previous 1.194 (colored)

Make IPSEC and FAST_IPSEC stats per-cpu.  Use <net/net_stats.h> and
netstat_sysctl().

Revision 1.194 / (download) - annotate - [select for diffs], Sat Apr 12 05:58:22 2008 UTC (5 years, 1 month ago) by thorpej
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base
Branch point for: yamt-pf42
Changes since 1.193: +15 -14 lines
Diff to previous 1.193 (colored)

Make IP, TCP, UDP, and ICMP statistics per-CPU.  The stats are collated
when the user requests them via sysctl.

Revision 1.193 / (download) - annotate - [select for diffs], Mon Apr 7 06:31:28 2008 UTC (5 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.192: +14 -14 lines
Diff to previous 1.192 (colored)

Change IP stats from a structure to an array of uint64_t's.

Note: This is ABI-compatible with the old ipstat structure; old netstat
binaries will continue to work properly.

Revision 1.192 / (download) - annotate - [select for diffs], Wed Feb 6 03:20:51 2008 UTC (5 years, 3 months ago) by matt
Branch: MAIN
CVS Tags: yamt-lazymbuf-base15, yamt-lazymbuf-base14, nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-base, ad-socklock-base1
Branch point for: mjf-devfs2
Changes since 1.191: +27 -24 lines
Diff to previous 1.191 (colored)

Add a new ip_id generation scheme based on a Fisher-Yates shuffle over a
sliding window.  XXX replace use of arc4random RSN.

Revision 1.191 / (download) - annotate - [select for diffs], Mon Jan 14 04:19:09 2008 UTC (5 years, 4 months ago) by dyoung
Branch: MAIN
CVS Tags: bouyer-xeni386-nbase, bouyer-xeni386-base
Changes since 1.190: +5 -5 lines
Diff to previous 1.190 (colored)

Use rtcache_validate() instead of rtcache_getrt().  Shorten staircase
in in_losing().

Revision 1.190 / (download) - annotate - [select for diffs], Sat Jan 12 02:58:58 2008 UTC (5 years, 4 months ago) by dyoung
Branch: MAIN
Changes since 1.189: +8 -9 lines
Diff to previous 1.189 (colored)

Good-bye, rtcache_check().  Call both rtcache_validate() and
rtcache_update(,1) instead of rtcache_check().

Revision 1.189 / (download) - annotate - [select for diffs], Sat Dec 29 15:13:55 2007 UTC (5 years, 4 months ago) by degroote
Branch: MAIN
CVS Tags: matt-armv6-base
Changes since 1.188: +3 -2 lines
Diff to previous 1.188 (colored)

Restore correctly the sp level in case of FAST_IPSEC + IPSEC_NAT_T

Revision 1.188 / (download) - annotate - [select for diffs], Sat Dec 29 14:53:25 2007 UTC (5 years, 4 months ago) by degroote
Branch: MAIN
Changes since 1.187: +58 -116 lines
Diff to previous 1.187 (colored)

Simplify the FAST_IPSEC output path
Only record an IPSEC_OUT_DONE tag when we have finished the processing
In ip{,6}_output, check this tag to know if we have already processed this
packet.
Remove some dead code (IPSEC_PENDING_TDB is not used in NetBSD)

Fix pr/36870

Revision 1.187 / (download) - annotate - [select for diffs], Fri Dec 21 02:07:55 2007 UTC (5 years, 5 months ago) by matt
Branch: MAIN
CVS Tags: vmlocking2-base3
Changes since 1.186: +5 -3 lines
Diff to previous 1.186 (colored)

Add fix for ip_id information leakage.  Since the leakage information is
primarily used with TCP SYN and RST packets and such packets are less than
the smallest sized packet that an IP stack is allowed to fragment, we simply
set ip_id to 0 for all packets 68 bytes or less.

Revision 1.186 / (download) - annotate - [select for diffs], Thu Dec 20 19:53:32 2007 UTC (5 years, 5 months ago) by dyoung
Branch: MAIN
Changes since 1.185: +25 -21 lines
Diff to previous 1.185 (colored)

Poison struct route->ro_rt uses in the kernel by changing the name
to _ro_rt.  Use rtcache_getrt() to access a route cache's struct
rtentry *.

Introduce struct ifnet->if_dl that always points at the interface
identifier/link-layer address.  Make code that treated the first
ifaddr on struct ifnet->if_addrlist as the interface address use
if_dl, instead.

Remove stale debugging code from net/route.c.  Move the rtflush()
code into rtcache_clear() and delete rtflush().  Delete rtalloc(),
because nothing uses it any more.

Make ND6_HINT an inline, lowercase subroutine, nd6_hint.

I've done my best to convert IP Filter, the ISO stack, and the
AppleTalk stack to rtcache_getrt().  They compile, but I have not
tested them.  I have given the changes to PF, GRE, IPv4 and IPv6
stacks a lot of exercise.

Revision 1.185 / (download) - annotate - [select for diffs], Wed Nov 28 04:14:11 2007 UTC (5 years, 5 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-kmem-base3, yamt-kmem-base2, yamt-kmem-base, yamt-kmem, vmlocking2-base2, vmlocking2-base1, vmlocking-nbase, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, jmcneill-pm-base, cube-autoconf-base, cube-autoconf
Branch point for: vmlocking2, bouyer-xeni386
Changes since 1.184: +2 -8 lines
Diff to previous 1.184 (colored)

Move IN_NEED_CHECKSUM() to in_offload.h for re-use.

Revision 1.184 / (download) - annotate - [select for diffs], Wed Sep 19 04:33:43 2007 UTC (5 years, 8 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-x86pmap-base4, yamt-x86pmap-base3, yamt-x86pmap-base2, yamt-x86pmap-base, yamt-x86pmap, vmlocking-base, jmcneill-base, bouyer-xenamd64-base2, bouyer-xenamd64-base, bouyer-xenamd64
Branch point for: mjf-devfs
Changes since 1.183: +8 -4 lines
Diff to previous 1.183 (colored)

1) Introduce a new socket option, (SOL_SOCKET, SO_NOHEADER), that
   tells a socket that it should both add a protocol header to tx'd
   datagrams and remove the header from rx'd datagrams:

        int onoff = 1, s = socket(...);
        setsockopt(s, SOL_SOCKET, SO_NOHEADER, &onoff);

2) Add an implementation of (SOL_SOCKET, SO_NOHEADER) for raw IPv4
   sockets.

3) Reorganize the protocols' pr_ctloutput implementations a bit.
   Consistently return ENOPROTOOPT when an option is unsupported,
   and EINVAL if a supported option's arguments are incorrect.
   Reorganize the flow of code so that it's more clear how/when
   options are passed down the stack until they are handled.

   Shorten some pr_ctloutput staircases for readability.

4) Extract common mbuf code into subroutines, add new sockaddr
   methods, and introduce a new subroutine, fsocreate(), for reuse
   later; use it first in sys_socket():

struct mbuf *m_getsombuf(struct socket *so)

        Create an mbuf and make its owner the socket `so'.

struct mbuf *m_intopt(struct socket *so, int val)

        Create an mbuf, make its owner the socket `so', put the
        int `val' into it, and set its length to sizeof(int).


int fsocreate(..., int *fd)

        Create a socket, a la socreate(9), put the socket into the
        given LWP's descriptor table, return the descriptor at `fd'
        on success.

void *sockaddr_addr(struct sockaddr *sa, socklen_t *slenp)
const void *sockaddr_const_addr(const struct sockaddr *sa, socklen_t *slenp)

        Extract a pointer to the address part of a sockaddr.  Write
        the length of the address  part at `slenp', if `slenp' is
        not NULL.

socklen_t sockaddr_getlen(const struct sockaddr *sa)

        Return the length of a sockaddr.  This just evaluates to
        sa->sa_len.  I only add this for consistency with code that
        appears in a portable userland library that I am going to
        import.

const struct sockaddr *sockaddr_any(const struct sockaddr *sa)

        Return the "don't care" sockaddr in the same family as
        `sa'.  This is the address a client should sobind(9) if it
        does not care the source address and, if applicable, the
        port et cetera that it uses.

const void *sockaddr_anyaddr(const struct sockaddr *sa, socklen_t *slenp)

        Return the "don't care" sockaddr in the same family as
        `sa'.  This is the address a client should sobind(9) if it
        does not care the source address and, if applicable, the
        port et cetera that it uses.

Revision 1.183 / (download) - annotate - [select for diffs], Sun Sep 2 07:18:55 2007 UTC (5 years, 8 months ago) by dyoung
Branch: MAIN
CVS Tags: nick-csl-alignment-base5
Changes since 1.182: +3 -3 lines
Diff to previous 1.182 (colored)

m_copym(..., 0, M_COPYALL, ...) -> m_copypacket(..., ...).

Revision 1.182 / (download) - annotate - [select for diffs], Sun Sep 2 03:12:23 2007 UTC (5 years, 8 months ago) by dyoung
Branch: MAIN
Changes since 1.181: +4 -4 lines
Diff to previous 1.181 (colored)

m_copy() was deprecated, apparently, long ago.  m_copy(...) ->
m_copym(..., M_DONTWAIT).

Revision 1.181 / (download) - annotate - [select for diffs], Tue Aug 28 23:45:39 2007 UTC (5 years, 8 months ago) by cube
Branch: MAIN
Changes since 1.180: +13 -5 lines
Diff to previous 1.180 (colored)

Fix ipv4 multicast that could sometimes send packets with the wrong
Ethernet multicast address.

Reported by jmcneill@, fix discussed with dyoung@, _very_ light testing by
myself, some more money for my dealer of anxiolytics after reading
ip_output()'s twisted code maze.

Revision 1.180 / (download) - annotate - [select for diffs], Wed May 2 20:40:25 2007 UTC (6 years ago) by dyoung
Branch: MAIN
CVS Tags: yamt-idlelwp-base8, nick-csl-alignment-base, mjf-ufs-trans-base, matt-mips64-base, matt-mips64, hpcarm-cleanup
Branch point for: nick-csl-alignment, matt-armv6, jmcneill-pm
Changes since 1.179: +54 -48 lines
Diff to previous 1.179 (colored)

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

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,
also.

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

DETAILS

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.179 / (download) - annotate - [select for diffs], Sun Mar 4 06:03:21 2007 UTC (6 years, 2 months ago) by christos
Branch: MAIN
CVS Tags: thorpej-atomic-base, thorpej-atomic, reinoud-bufcleanup
Branch point for: vmlocking, mjf-ufs-trans
Changes since 1.178: +17 -17 lines
Diff to previous 1.178 (colored)

Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.

Revision 1.178 / (download) - annotate - [select for diffs], Sat Feb 17 22:34:11 2007 UTC (6 years, 3 months ago) by dyoung
Branch: MAIN
CVS Tags: ad-audiomp-base, ad-audiomp
Changes since 1.177: +5 -5 lines
Diff to previous 1.177 (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
   elsewhere.

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.

Constify:

   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.177 / (download) - annotate - [select for diffs], Sat Feb 17 05:36:29 2007 UTC (6 years, 3 months ago) by dyoung
Branch: MAIN
Branch point for: yamt-idlelwp
Changes since 1.176: +3 -4 lines
Diff to previous 1.176 (colored)

Join lines.

Revision 1.176 / (download) - annotate - [select for diffs], Mon Jan 29 06:00:11 2007 UTC (6 years, 3 months ago) by dyoung
Branch: MAIN
CVS Tags: post-newlock2-merge, newlock2-nbase, newlock2-base
Changes since 1.175: +5 -5 lines
Diff to previous 1.175 (colored)

bzero -> memset.

Revision 1.175 / (download) - annotate - [select for diffs], Mon Jan 29 05:59:30 2007 UTC (6 years, 3 months ago) by dyoung
Branch: MAIN
Changes since 1.174: +3 -7 lines
Diff to previous 1.174 (colored)

In ip_setmoptions(), don't leave a route cache (struct route) on
the stack if we exit with EADDRNOTAVAIL.

Revision 1.174 / (download) - annotate - [select for diffs], Sat Jan 13 23:13:46 2007 UTC (6 years, 4 months ago) by joerg
Branch: MAIN
Changes since 1.173: +5 -7 lines
Diff to previous 1.173 (colored)

Unconditionally zero and free iproute. Before IPsec tunnel packets e.g.
from ICMP could end up in leaking the reference in iproute, as
ipsec4_output would overwrite the ro pointer in state.

Tested by Juraj Hercek and supposed to fix PR kern/35273 and kern/35318.

Revision 1.173 / (download) - annotate - [select for diffs], Mon Jan 8 04:14:54 2007 UTC (6 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.172: +3 -2 lines
Diff to previous 1.172 (colored)

ip_output: reload ip_len after running pfil_run_hooks.
pf "fragment reassemble" rule can change it, at least.

Revision 1.172 / (download) - annotate - [select for diffs], Thu Jan 4 19:07:03 2007 UTC (6 years, 4 months ago) by elad
Branch: MAIN
Changes since 1.171: +3 -3 lines
Diff to previous 1.171 (colored)

Consistent usage of KAUTH_GENERIC_ISSUSER.

Revision 1.171 / (download) - annotate - [select for diffs], Fri Dec 15 21:18:54 2006 UTC (6 years, 5 months ago) by joerg
Branch: MAIN
CVS Tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4
Changes since 1.170: +12 -11 lines
Diff to previous 1.170 (colored)

Introduce new helper functions to abstract the route caching.
rtcache_init and rtcache_init_noclone lookup ro_dst and store
the result in ro_rt, taking care of the reference counting and
calling the domain specific route cache.
rtcache_free checks if a route was cashed and frees the reference.
rtcache_copy copies ro_dst of the given struct route, checking that
enough space is available and incrementing the reference count of the
cached rtentry if necessary.
rtcache_check validates that the cached route is still up. If it isn't,
it tries to look it up again. Afterwards ro_rt is either a valid again
or NULL.
rtcache_copy is used internally.

Adjust to callers of rtalloc/rtflush in the tree to check the sanity of
ro_dst first (if necessary). If it doesn't fit the expectations, free
the cache, otherwise check if the cached route is still valid. After
that combination, a single check for ro_rt == NULL is enough to decide
whether a new lookup needs to be done with a different ro_dst.
Make the route checking in gre stricter by repeating the loop check
after revalidation.
Remove some unused RADIX_MPATH code in in6_src.c. The logic is slightly
changed here to first validate the route and check RTF_GATEWAY
afterwards. This is sementically equivalent though.
etherip doesn't need sc_route_expire similiar to the gif changes from
dyoung@ earlier.

Based on the earlier patch from dyoung@, reviewed and discussed with
him.

Revision 1.170 / (download) - annotate - [select for diffs], Sat Dec 9 05:33:04 2006 UTC (6 years, 5 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-splraiseipl-base3
Changes since 1.169: +9 -14 lines
Diff to previous 1.169 (colored)

Here are various changes designed to protect against bad IPv4
routing caused by stale route caches (struct route).  Route caches
are sprinkled throughout PCBs, the IP fast-forwarding table, and
IP tunnel interfaces (gre, gif, stf).

Stale IPv6 and ISO route caches will be treated by separate patches.

Thank you to Christoph Badura for suggesting the general approach
to invalidating route caches that I take here.

Here are the details:

Add hooks to struct domain for tracking and for invalidating each
domain's route caches: dom_rtcache, dom_rtflush, and dom_rtflushall.

Introduce helper subroutines, rtflush(ro) for invalidating a route
cache, rtflushall(family) for invalidating all route caches in a
routing domain, and rtcache(ro) for notifying the domain of a new
cached route.

Chain together all IPv4 route caches where ro_rt != NULL.  Provide
in_rtcache() for adding a route to the chain.  Provide in_rtflush()
and in_rtflushall() for invalidating IPv4 route caches.  In
in_rtflush(), set ro_rt to NULL, and remove the route from the
chain.  In in_rtflushall(), walk the chain and remove every route
cache.

In rtrequest1(), call rtflushall() to invalidate route caches when
a route is added.

In gif(4), discard the workaround for stale caches that involves
expiring them every so often.

Replace the pattern 'RTFREE(ro->ro_rt); ro->ro_rt = NULL;' with a
call to rtflush(ro).

Update ipflow_fastforward() and all other users of route caches so
that they expect a cached route, ro->ro_rt, to turn to NULL.

Take care when moving a 'struct route' to rtflush() the source and
to rtcache() the destination.

In domain initializers, use .dom_xxx tags.

KNF here and there.

Revision 1.169 / (download) - annotate - [select for diffs], Wed Dec 6 04:29:09 2006 UTC (6 years, 5 months ago) by dyoung
Branch: MAIN
Changes since 1.168: +3 -3 lines
Diff to previous 1.168 (colored)

Remove stray curly brace.  Thanks, yamt!

Revision 1.168 / (download) - annotate - [select for diffs], Wed Dec 6 00:41:59 2006 UTC (6 years, 5 months ago) by dyoung
Branch: MAIN
Changes since 1.167: +5 -5 lines
Diff to previous 1.167 (colored)

KNF.

Revision 1.167 / (download) - annotate - [select for diffs], Sat Nov 25 18:41:36 2006 UTC (6 years, 5 months ago) by yamt
Branch: MAIN
CVS Tags: netbsd-4-base
Branch point for: netbsd-4
Changes since 1.166: +2 -34 lines
Diff to previous 1.166 (colored)

move tso-by-software code to their own files.  no functional changes.

Revision 1.166 / (download) - annotate - [select for diffs], Mon Nov 13 05:13:42 2006 UTC (6 years, 6 months ago) by dyoung
Branch: MAIN
Changes since 1.165: +13 -3 lines
Diff to previous 1.165 (colored)

Add a source-address selection policy mechanism to the kernel.

Also, add ioctls SIOCGIFADDRPREF/SIOCSIFADDRPREF to get/set preference
numbers for addresses.  Make ifconfig(8) set/display preference
numbers.

To activate source-address selection policies in your kernel, add
'options IPSELSRC' to your kernel configuration.

Miscellaneous changes in support of source-address selection:

        1 Factor out some common code, producing rt_replace_ifa().

        2 Abbreviate a for-loop with TAILQ_FOREACH().

        3 Add the predicates on IPv4 addresses IN_LINKLOCAL() and
          IN_PRIVATE(), that are true for link-local unicast
          (169.254/16) and RFC1918 private addresses, respectively.
          Add the predicate IN_ANY_LOCAL() that is true for link-local
          unicast and multicast.

        4 Add IPv4-specific interface attach/detach routines,
          in_domifattach and in_domifdetach, which build #ifdef
          IPSELSRC.

See in_getifa(9) for a more thorough description of source-address
selection policy.

Revision 1.165 / (download) - annotate - [select for diffs], Sun Jul 23 22:06:13 2006 UTC (6 years, 10 months ago) by ad
Branch: MAIN
CVS Tags: yamt-splraiseipl-base2, yamt-splraiseipl-base, yamt-pdpolicy-base9, yamt-pdpolicy-base8, yamt-pdpolicy-base7, rpaulo-netinet-merge-pcb-base, abandoned-netbsd-4-base, abandoned-netbsd-4
Branch point for: yamt-splraiseipl, newlock2
Changes since 1.164: +5 -5 lines
Diff to previous 1.164 (colored)

Use the LWP cached credentials where sane.

Revision 1.164 / (download) - annotate - [select for diffs], Wed Jul 12 14:07:02 2006 UTC (6 years, 10 months ago) by tron
Branch: MAIN
Changes since 1.163: +3 -4 lines
Diff to previous 1.163 (colored)

Remove test for M_CSUM_TSOv6 flag which is not (yet) defined in
NetBSD-current.

Revision 1.163 / (download) - annotate - [select for diffs], Wed Jul 12 13:11:27 2006 UTC (6 years, 10 months ago) by tron
Branch: MAIN
Changes since 1.162: +15 -3 lines
Diff to previous 1.162 (colored)

Add diagnostic checks for hardware-assisted checksum related flags in
the mbuf which supposed to get sent out:
- Complain in ip_output() if any of the IPv6 related flags are set.
- Complain in ip6_output() if any of the IPv4 related flags are set.
- Complain in both functions if the flags indicate that both a TCP and
  UCP checksum should be calculated by the hardware.

Revision 1.162 / (download) - annotate - [select for diffs], Mon May 15 00:05:17 2006 UTC (7 years ago) by christos
Branch: MAIN
CVS Tags: yamt-pdpolicy-base6, yamt-pdpolicy-base5, simonb-timecounters-base, gdamore-uart-base, chap-midi-nbase, chap-midi-base, chap-midi
Branch point for: gdamore-uart
Changes since 1.161: +3 -2 lines
Diff to previous 1.161 (colored)

kauth fallout

Revision 1.161 / (download) - annotate - [select for diffs], Sun May 14 21:19:34 2006 UTC (7 years ago) by elad
Branch: MAIN
Changes since 1.160: +4 -3 lines
Diff to previous 1.160 (colored)

integrate kauth.

Revision 1.160 / (download) - annotate - [select for diffs], Thu Feb 23 01:35:19 2006 UTC (7 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: yamt-uio_vmspace-base5, yamt-pdpolicy-base4, yamt-pdpolicy-base3, yamt-pdpolicy-base2, yamt-pdpolicy-base, peter-altq-base, elad-kernelauth-base
Branch point for: yamt-pdpolicy, peter-altq, elad-kernelauth
Changes since 1.159: +24 -8 lines
Diff to previous 1.159 (colored)

Handle IPSEC_NAT_T in the FAST_IPSEC case.
XXX: need to fix the FAST_IPSEC code now.

Revision 1.159 / (download) - annotate - [select for diffs], Sun Dec 11 12:24:57 2005 UTC (7 years, 5 months ago) by christos
Branch: MAIN
Branch point for: yamt-uio_vmspace, simonb-timecounters, rpaulo-netinet-merge-pcb
Changes since 1.158: +2 -2 lines
Diff to previous 1.158 (colored)

merge ktrace-lwp.

Revision 1.158 / (download) - annotate - [select for diffs], Mon Sep 19 05:28:46 2005 UTC (7 years, 8 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-vop-base3, yamt-vop-base2, yamt-vop-base, yamt-vop, yamt-readahead-pervnode, yamt-readahead-perfile, yamt-readahead-base3, yamt-readahead-base2, yamt-readahead-base, yamt-readahead, thorpej-vnode-attr-base, thorpej-vnode-attr, ktrace-lwp-base
Changes since 1.157: +2 -4 lines
Diff to previous 1.157 (colored)

People have to read this code, so I am removing the double-negative
tautology, #ifndef notdef, which is not only superfluous, but easily
misread as #ifdef notyet.

Revision 1.157 / (download) - annotate - [select for diffs], Sun Sep 11 22:15:19 2005 UTC (7 years, 8 months ago) by seb
Branch: MAIN
Changes since 1.156: +3 -3 lines
Diff to previous 1.156 (colored)

Replace plain 255 by MAXTTL.

Revision 1.156 / (download) - annotate - [select for diffs], Sun Sep 11 21:57:24 2005 UTC (7 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.155: +31 -14 lines
Diff to previous 1.155 (colored)

Allow the multicast_ttl and the multicast_loop options to be set with both
u_char and u_int option variables. Original patch from seb.

Revision 1.155 / (download) - annotate - [select for diffs], Thu Aug 18 00:30:59 2005 UTC (7 years, 9 months ago) by yamt
Branch: MAIN
Changes since 1.154: +3 -5 lines
Diff to previous 1.154 (colored)

- introduce M_MOVE_PKTHDR and use it where appropriate.
  intended to be mostly API compatible with openbsd/freebsd.
- remove a glue #define in netipsec/ipsec_osdep.h.

Revision 1.154 / (download) - annotate - [select for diffs], Wed Aug 10 13:06:49 2005 UTC (7 years, 9 months ago) by yamt
Branch: MAIN
Changes since 1.153: +2 -4 lines
Diff to previous 1.153 (colored)

move {tcp,udp}_do_loopback_cksum back to tcp/udp
so that they can be referenced by ipv6.

Revision 1.153 / (download) - annotate - [select for diffs], Sun May 29 21:41:23 2005 UTC (7 years, 11 months ago) by christos
Branch: MAIN
Branch point for: yamt-lazymbuf
Changes since 1.152: +6 -6 lines
Diff to previous 1.152 (colored)

- add const
- remove bogus casts
- avoid nested variables

Revision 1.152 / (download) - annotate - [select for diffs], Mon Apr 18 22:06:28 2005 UTC (8 years, 1 month ago) by yamt
Branch: MAIN
CVS Tags: kent-audio2-base
Changes since 1.151: +45 -3 lines
Diff to previous 1.151 (colored)

ip_output: handle the case M_CSUM_TSOv4 but !IFCAP_TSOv4.

Revision 1.151 / (download) - annotate - [select for diffs], Mon Apr 18 21:50:25 2005 UTC (8 years, 1 month ago) by yamt
Branch: MAIN
Changes since 1.150: +23 -6 lines
Diff to previous 1.150 (colored)

fix problems related to loopback interface checksum omission.  PR/29971.

- for ipv4, defer decision to ip layer as h/w checksum offloading does
  so that it can check the actual interface the packet is going to.
- for ipv6, disable it.
  (maybe will be revisited when it implements h/w checksum offloading.)

ok'ed by Jason Thorpe.

Revision 1.150 / (download) - annotate - [select for diffs], Thu Apr 7 12:22:47 2005 UTC (8 years, 1 month ago) by yamt
Branch: MAIN
Changes since 1.149: +22 -3 lines
Diff to previous 1.149 (colored)

when doing TSO, avoid to use duplicated ip_id heavily.
XXX ip_randomid

Revision 1.149 / (download) - annotate - [select for diffs], Fri Mar 11 17:07:51 2005 UTC (8 years, 2 months ago) by matt
Branch: MAIN
CVS Tags: yamt-km-base4, yamt-km-base3, netbsd-3-base
Branch point for: netbsd-3
Changes since 1.148: +3 -9 lines
Diff to previous 1.148 (colored)

Set ip_len to 0 in the wm driver when TSO is being used.

Revision 1.148 / (download) - annotate - [select for diffs], Thu Mar 10 06:03:00 2005 UTC (8 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.147: +5 -4 lines
Diff to previous 1.147 (colored)

In ip_fragment():
- Use the correct IP header length variable for other-than-first packets.
- Remove redundant setting of the original IP header length in the first
  packet's csum_data.  (It's already set before ip_fragment() is called
  in 1.147.)

Revision 1.147 / (download) - annotate - [select for diffs], Wed Mar 9 03:39:27 2005 UTC (8 years, 2 months ago) by matt
Branch: MAIN
Changes since 1.146: +29 -31 lines
Diff to previous 1.146 (colored)

Move all the hardware-assisted checksum/segment offload code together.

Revision 1.146 / (download) - annotate - [select for diffs], Sun Mar 6 00:35:07 2005 UTC (8 years, 2 months ago) by matt
Branch: MAIN
Changes since 1.145: +18 -4 lines
Diff to previous 1.145 (colored)

Add IPv4/TCP hooks for TCP Segment Offload on transmit.

Revision 1.145 / (download) - annotate - [select for diffs], Sat Mar 5 02:46:38 2005 UTC (8 years, 2 months ago) by briggs
Branch: MAIN
Changes since 1.144: +5 -3 lines
Diff to previous 1.144 (colored)

Fix checksum offload for fragmented packets.  From John Heasley
on gnats-bugs in PR kern/29544.
Tested with an NFS client using default rwsize on an NFS server
with wm(4) interface configured IP4CSUM,TCP4CSUM,UDP4CSUM.
Prior revision required the server to have checksum offload disabled.

Revision 1.144 / (download) - annotate - [select for diffs], Sat Feb 26 22:45:12 2005 UTC (8 years, 2 months ago) by perry
Branch: MAIN
Changes since 1.143: +9 -9 lines
Diff to previous 1.143 (colored)

nuke trailing whitespace

Revision 1.143 / (download) - annotate - [select for diffs], Fri Feb 18 00:52:56 2005 UTC (8 years, 3 months ago) by heas
Branch: MAIN
CVS Tags: matt-timespec
Changes since 1.142: +4 -34 lines
Diff to previous 1.142 (colored)

My last change for pseudo-header checksums was flawed.  The pseudo-header
checksum is always in the L4 header by the time we get to this point.  It
was occasionally not there due to a bug in tcp_respond, which has since
been fixed.
So, instead just stash the length of the L3 header in the high 16 bits of
csum_data.

Revision 1.142 / (download) - annotate - [select for diffs], Sat Feb 12 23:25:29 2005 UTC (8 years, 3 months ago) by heas
Branch: MAIN
Changes since 1.141: +33 -2 lines
Diff to previous 1.141 (colored)

For controllers (eg: hme & gem) that can only perform linear hardware checksums
(from an offset to the end of the packet), the pseudo-header checksum must be
calculated by software.  So, provide it in the TCP/UDP header when
M_CSUM_NO_PSEUDOHDR is set in the interface's if_csum_flags_tx.

The start offset, the end of the IP header, is also provided in the high 16
bits of pkthdr.csum_data.  Such that the driver need not examine the packet
at all.

XXX At the request of Jonathan Stone, note that sharing of if_csum_flags_tx &
    pkthdr.csum_flags for checksum quirks should be re-evaluated.

Revision 1.141 / (download) - annotate - [select for diffs], Sat Feb 12 12:31:07 2005 UTC (8 years, 3 months ago) by manu
Branch: MAIN
CVS Tags: yamt-km-base2
Changes since 1.140: +44 -7 lines
Diff to previous 1.140 (colored)

Add support for IPsec Network Address Translator traversal (NAT-T), as
described by RFC 3947 and 3948.

Revision 1.140 / (download) - annotate - [select for diffs], Thu Feb 3 23:13:20 2005 UTC (8 years, 3 months ago) by perry
Branch: MAIN
Changes since 1.139: +14 -37 lines
Diff to previous 1.139 (colored)

ANSIfy function declarations

Revision 1.139 / (download) - annotate - [select for diffs], Wed Feb 2 21:41:55 2005 UTC (8 years, 3 months ago) by perry
Branch: MAIN
Changes since 1.138: +5 -6 lines
Diff to previous 1.138 (colored)

de-__P -- will ANSIfy .c files later.

Revision 1.138 / (download) - annotate - [select for diffs], Wed Dec 15 04:25:19 2004 UTC (8 years, 5 months ago) by thorpej
Branch: MAIN
CVS Tags: yamt-km-base, kent-audio1-beforemerge
Branch point for: yamt-km, kent-audio2
Changes since 1.137: +6 -3 lines
Diff to previous 1.137 (colored)

Don't perform checksums on loopback interfaces.  They can be reenabled with
the net.inet.*.do_loopback_cksum sysctl.

Approved by: groo

Revision 1.137 / (download) - annotate - [select for diffs], Sat Dec 4 16:10:25 2004 UTC (8 years, 5 months ago) by peter
Branch: MAIN
CVS Tags: kent-audio1-base, kent-audio1
Changes since 1.136: +3 -3 lines
Diff to previous 1.136 (colored)

Convert lo(4) to a clonable device.

This also removes the loif array and changes all code to use the new
lo0ifp pointer which points to the lo0 ifnet structure.

Approved by christos.

Revision 1.136 / (download) - annotate - [select for diffs], Wed Oct 6 05:42:24 2004 UTC (8 years, 7 months ago) by thorpej
Branch: MAIN
Changes since 1.135: +11 -14 lines
Diff to previous 1.135 (colored)

Slight simplification to IFA_STATS handling.

Revision 1.135 / (download) - annotate - [select for diffs], Sat Sep 4 23:30:07 2004 UTC (8 years, 8 months ago) by manu
Branch: MAIN
Changes since 1.134: +14 -11 lines
Diff to previous 1.134 (colored)

IPv4 PIM support, based on a submission from Pavlin Radoslavov posted on
tech-net@

Revision 1.134 / (download) - annotate - [select for diffs], Tue Jul 6 04:30:27 2004 UTC (8 years, 10 months ago) by minoura
Branch: MAIN
CVS Tags: BEFORE-IPF413
Changes since 1.133: +4 -3 lines
Diff to previous 1.133 (colored)

Remove broken code for now: getsockopt(s, IPPROTO_IP, IP_IPSEC_POLICY,...).
It returned EINVAL, now returns ENOPROTOOPT.
Ok'd by itojun.

Revision 1.133 / (download) - annotate - [select for diffs], Tue Jun 1 05:06:56 2004 UTC (8 years, 11 months ago) by itojun
Branch: MAIN
Changes since 1.132: +6 -3 lines
Diff to previous 1.132 (colored)

update mtu value if outgoing interface changes with ipsec ops
(draft-touch-vpn case only?)  iij seil team

Revision 1.132 / (download) - annotate - [select for diffs], Tue May 18 16:47:08 2004 UTC (9 years ago) by christos
Branch: MAIN
Changes since 1.131: +5 -5 lines
Diff to previous 1.131 (colored)

Fix buffer overrun in in_pcbopts() (FreeBSD PR/66386)

Revision 1.131 / (download) - annotate - [select for diffs], Mon Apr 26 01:31:57 2004 UTC (9 years ago) by matt
Branch: MAIN
Changes since 1.130: +2 -8 lines
Diff to previous 1.130 (colored)

Remove #else clause of __STDC__

Revision 1.130 / (download) - annotate - [select for diffs], Tue Mar 2 02:28:28 2004 UTC (9 years, 2 months ago) by thorpej
Branch: MAIN
CVS Tags: netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-base, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2-0, netbsd-2, BEFORE-IPF411
Changes since 1.129: +11 -4 lines
Diff to previous 1.129 (colored)

Use the new IPSEC_PCB_SKIP_IPSEC() to bypass a socket policy lookup
when possible.  This shaves several cycles from the output path for
non-IPsec connections, even if the policy is cached in the PCB.

Revision 1.129 / (download) - annotate - [select for diffs], Wed Dec 10 11:46:33 2003 UTC (9 years, 5 months ago) by itojun
Branch: MAIN
Changes since 1.128: +5 -3 lines
Diff to previous 1.128 (colored)

use if_indexlim (instead of if_index) and ifindex2ifnet[x] != NULL
to check if interface exists, as (1) if_index has different meaning
(2) ifindex2ifnet could become NULL when interface gets destroyed,
since when we have introduced dynamically-created interfaces.  from kame

Revision 1.128 / (download) - annotate - [select for diffs], Wed Nov 19 18:39:34 2003 UTC (9 years, 6 months ago) by jonathan
Branch: MAIN
Changes since 1.127: +3 -2 lines
Diff to previous 1.127 (colored)

Patch back support for (badly) randomized IP ids, by request:

* Include "opt_inet.h" everywhere IP-ids are generated with ip_newid(),
  so the RANDOM_IP_ID option is visible. Also in ip_id(), to ensure
  the prototype for ip_randomid() is made visible.

* Add new sysctl to enable randomized IP-ids, provided the kernel was
  configured with RANDOM_IP_ID. (The sysctl defaults to zero, and is
  a read-only zero if RANDOM_IP_ID is not configured).

Note that the implementation of randomized IP ids is still defective,
and should not be enabled at all (even if configured) without
very careful deliberation. Caveat emptor.

Revision 1.127 / (download) - annotate - [select for diffs], Mon Nov 17 21:34:27 2003 UTC (9 years, 6 months ago) by jonathan
Branch: MAIN
Changes since 1.126: +3 -3 lines
Diff to previous 1.126 (colored)

Revert the (default) ip_id algorithm to the pre-randomid algorithm,
due to demonstrated low-period repeated IDs from the randomized IP_id
code.  Consensus is that the low-period repetition (much less than
2^15) is not suitable for general-purpose use.

Allocators of new IPv4 IDs should now call the function ip_newid().
Randomized IP_ids is now a config-time option, "options RANDOM_IP_ID".
ip_newid() can use ip_random-id()_IP_ID if and only if configured
with RANDOM_IP_ID. A sysctl knob should be  provided.

This API may be reworked in the near future to support linear ip_id
counters per (src,dst) IP-address pair.

Revision 1.126 / (download) - annotate - [select for diffs], Fri Oct 17 20:31:12 2003 UTC (9 years, 7 months ago) by enami
Branch: MAIN
Changes since 1.125: +7 -3 lines
Diff to previous 1.125 (colored)

Increment stats when packet is dropped since there is no room
to put all fragments in the interfaces's send queue.  Some large
UDP packets are dropped here and administrator may want to bump ifqmaxlen.

Revision 1.125 / (download) - annotate - [select for diffs], Tue Oct 14 06:36:48 2003 UTC (9 years, 7 months ago) by itojun
Branch: MAIN
Changes since 1.124: +3 -3 lines
Diff to previous 1.124 (colored)

more correction to ip_fragment; free mbuf correctly if ENOBUFS is raised
during fragmenting.

Revision 1.124 / (download) - annotate - [select for diffs], Tue Oct 14 03:38:49 2003 UTC (9 years, 7 months ago) by itojun
Branch: MAIN
Changes since 1.123: +15 -4 lines
Diff to previous 1.123 (colored)

avoid mbuf leak on ip_fragment(); obey 4.4bsd mbuf passing rule (mbuf passed
to a function must be freed by the called function on error).
pointed out by enami

Revision 1.123 / (download) - annotate - [select for diffs], Fri Oct 3 20:56:11 2003 UTC (9 years, 7 months ago) by itojun
Branch: MAIN
Changes since 1.122: +4 -3 lines
Diff to previous 1.122 (colored)

when dropping M_PKTHDR, need to free m_tag associated with it.

Revision 1.122 / (download) - annotate - [select for diffs], Wed Oct 1 23:54:40 2003 UTC (9 years, 7 months ago) by itojun
Branch: MAIN
Changes since 1.121: +6 -5 lines
Diff to previous 1.121 (colored)

correct ip_fragment() wrt ip->ip_off handling.
do not send out incomplete fragment due to ENOBUFS (behavior change from 4.4BSD)

Revision 1.121 / (download) - annotate - [select for diffs], Fri Sep 19 00:27:56 2003 UTC (9 years, 8 months ago) by jonathan
Branch: MAIN
Changes since 1.120: +3 -3 lines
Diff to previous 1.120 (colored)

Fast-ipsec can call ip_output() with a null 'struct socket *so'
argument.  So check so is non-NULL before doing the pointer-chasing
dance to find the PCB. (Unless and until we rework fast-ipsec and
KAME, to pass a struct in_pcbhdr * instead of the struct socket *).

Revision 1.120 / (download) - annotate - [select for diffs], Sat Sep 6 03:36:30 2003 UTC (9 years, 8 months ago) by itojun
Branch: MAIN
Changes since 1.119: +3 -3 lines
Diff to previous 1.119 (colored)

randomize IPv4/v6 fragment ID and IPv6 flowlabel.  avoids predictability
of these fields.  ip_id.c is from openbsd.  ip6_id.c is adapted by kame.

Revision 1.119 / (download) - annotate - [select for diffs], Wed Aug 27 02:09:59 2003 UTC (9 years, 8 months ago) by itojun
Branch: MAIN
Changes since 1.118: +3 -3 lines
Diff to previous 1.118 (colored)

don't intiialize m by m0, m0 is not initialized (by introduction of ip_fragment)

Revision 1.118 / (download) - annotate - [select for diffs], Sat Aug 23 01:41:10 2003 UTC (9 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.117: +5 -2 lines
Diff to previous 1.117 (colored)

need sys/domain.h for FAST_IPSEC case; jonathan

Revision 1.117 / (download) - annotate - [select for diffs], Fri Aug 22 22:00:37 2003 UTC (9 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.116: +2 -6 lines
Diff to previous 1.116 (colored)

remove ipsec_set/getsocket.  now we explicitly pass socket * to ip{,6}_output.

Revision 1.116 / (download) - annotate - [select for diffs], Fri Aug 22 21:53:04 2003 UTC (9 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.115: +12 -7 lines
Diff to previous 1.115 (colored)

change the additional arg to be passed to ip{,6}_output to struct socket *.

this fixes KAME policy lookup which was broken by the previous commit.

Revision 1.115 / (download) - annotate - [select for diffs], Fri Aug 22 20:29:00 2003 UTC (9 years, 9 months ago) by jonathan
Branch: MAIN
Changes since 1.114: +5 -4 lines
Diff to previous 1.114 (colored)

Change KAME code for ip_output()/ip6_output() to obtain struct socket*
from the explicit inpcb*/in6pcb* argument.  set_socket() becomes redundant.

Revision 1.114 / (download) - annotate - [select for diffs], Tue Aug 19 08:00:54 2003 UTC (9 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.113: +2 -4 lines
Diff to previous 1.113 (colored)

remove unneeded #ifdef __NetBSD__

Revision 1.113 / (download) - annotate - [select for diffs], Tue Aug 19 01:20:03 2003 UTC (9 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.112: +3 -4 lines
Diff to previous 1.112 (colored)

make ip_fragment public (it is for coming PF integration)

Revision 1.112 / (download) - annotate - [select for diffs], Tue Aug 19 00:54:41 2003 UTC (9 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.111: +4 -3 lines
Diff to previous 1.111 (colored)

make ip_fragment static and add prototype.

Revision 1.111 / (download) - annotate - [select for diffs], Tue Aug 19 00:17:38 2003 UTC (9 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.110: +6 -4 lines
Diff to previous 1.110 (colored)

correct ip_multicast_if fix to always set ifp (tnx Shiva)

Revision 1.110 / (download) - annotate - [select for diffs], Mon Aug 18 22:23:22 2003 UTC (9 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.109: +88 -64 lines
Diff to previous 1.109 (colored)

fix problem we can't drop membership on !IFF_UP interface.
reported by Shiva Shenoy

while we're here, fix another problem when the same interface address is
assigned to !IFF_MULTICAST and IFF_MULTICAST interface.  if ip_multicast_if()
returns the first one, join/leave will fail, which is not an desired effect.

Revision 1.109 / (download) - annotate - [select for diffs], Fri Aug 15 03:42:03 2003 UTC (9 years, 9 months ago) by jonathan
Branch: MAIN
Changes since 1.108: +150 -6 lines
Diff to previous 1.108 (colored)

(fast-ipsec): Add hooks to pass IPv4 IPsec traffic into fast-ipsec, if
configured with ``options FAST_IPSEC''.  Kernels with KAME IPsec or
with no IPsec should work as before.

All calls to ip_output() now always pass an additional compulsory
argument: the inpcb associated with the packet being sent,
or 0 if no inpcb is available.

Fast-ipsec tested with ICMP or UDP over ESP. TCP doesn't work, yet.

Revision 1.108 / (download) - annotate - [select for diffs], Thu Aug 7 16:33:14 2003 UTC (9 years, 9 months ago) by agc
Branch: MAIN
Changes since 1.107: +3 -7 lines
Diff to previous 1.107 (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.107 / (download) - annotate - [select for diffs], Mon Jun 30 02:08:28 2003 UTC (9 years, 10 months ago) by itojun
Branch: MAIN
Branch point for: ktrace-lwp
Changes since 1.106: +2 -6 lines
Diff to previous 1.106 (colored)

freebsd code somehow crept in

Revision 1.106 / (download) - annotate - [select for diffs], Mon Jun 30 01:22:51 2003 UTC (9 years, 10 months ago) by itojun
Branch: MAIN
Changes since 1.105: +4 -4 lines
Diff to previous 1.105 (colored)

after pfil_run_hooks, need to fix hlen as well

Revision 1.105 / (download) - annotate - [select for diffs], Thu Jun 26 00:43:32 2003 UTC (9 years, 11 months ago) by itojun
Branch: MAIN
Changes since 1.104: +3 -3 lines
Diff to previous 1.104 (colored)

tabify

Revision 1.104 / (download) - annotate - [select for diffs], Mon May 26 15:12:11 2003 UTC (10 years ago) by yamt
Branch: MAIN
Changes since 1.103: +22 -10 lines
Diff to previous 1.103 (colored)

- don't pass mbufs with M_CSUM_* flags which isn't supported by the interface
  to if_output.
- offload ip-checksumming for each fragmented packets as well.

Revision 1.103 / (download) - annotate - [select for diffs], Wed Feb 26 06:31:15 2003 UTC (10 years, 2 months ago) by matt
Branch: MAIN
Changes since 1.102: +10 -2 lines
Diff to previous 1.102 (colored)

Add MBUFTRACE kernel option.
Do a little mbuf rework while here.  Change all uses of MGET*(*, M_WAIT, *)
to m_get*(M_WAIT, *).  These are not performance critical and making them
call m_get saves considerable space.  Add m_clget analogue of MCLGET and
make corresponding change for M_WAIT uses.
Modify netinet, gem, fxp, tulip, nfs to support MBUFTRACE.
Begin to change netstat to use sysctl.

Revision 1.102 / (download) - annotate - [select for diffs], Tue Sep 17 13:10:59 2002 UTC (10 years, 8 months ago) by darrenr
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, fvdl_fs64_base
Changes since 1.101: +5 -3 lines
Diff to previous 1.101 (colored)

From FreeBSD (1.164) courtesy of Maxim Konovalov:
"In rare cases when there is no room for ip options ip_insertoptions()
can fail and corrupt a header length.  Initialize len and check what
ip_insertoptions() returns."

Revision 1.101 / (download) - annotate - [select for diffs], Wed Sep 11 02:46:43 2002 UTC (10 years, 8 months ago) by itojun
Branch: MAIN
Changes since 1.100: +3 -3 lines
Diff to previous 1.100 (colored)

KNF - return is not a function.  sync w/kame.

Revision 1.100 / (download) - annotate - [select for diffs], Wed Aug 14 00:23:32 2002 UTC (10 years, 9 months ago) by itojun
Branch: MAIN
CVS Tags: gehenna-devsw-base
Changes since 1.99: +17 -33 lines
Diff to previous 1.99 (colored)

avoid swapping endian of ip_len and ip_off on mbuf, to meet with M_LEADINGSPACE
optimization made last year.  should solve PR 17867 and 10195.

IP_HDRINCL behavior of raw ip socket is kept unchanged.  we may want to
provide IP_HDRINCL variant that does not swap endian.

Revision 1.99 / (download) - annotate - [select for diffs], Mon Jun 24 08:11:30 2002 UTC (10 years, 11 months ago) by itojun
Branch: MAIN
Changes since 1.98: +3 -2 lines
Diff to previous 1.98 (colored)

set ia as well

Revision 1.98 / (download) - annotate - [select for diffs], Mon Jun 24 08:01:35 2002 UTC (10 years, 11 months ago) by itojun
Branch: MAIN
Changes since 1.97: +20 -8 lines
Diff to previous 1.97 (colored)

do not consult routing table under the following condition:
- the destination is IPv4 multicast or 255.255.255.255, and
- outgoing interface is specified via socket option

this simplifies operation of routed
(no longer reqiure 224.0.0.0/4 to be set up)

Revision 1.97 / (download) - annotate - [select for diffs], Sun Jun 9 16:33:42 2002 UTC (10 years, 11 months ago) by itojun
Branch: MAIN
Changes since 1.96: +7 -7 lines
Diff to previous 1.96 (colored)

whitespace

Revision 1.96 / (download) - annotate - [select for diffs], Fri May 31 05:26:42 2002 UTC (10 years, 11 months ago) by itojun
Branch: MAIN
Changes since 1.95: +3 -3 lines
Diff to previous 1.95 (colored)

since if_mtu is u_long, use u_long for mtu.

Revision 1.95 / (download) - annotate - [select for diffs], Thu Feb 7 21:47:45 2002 UTC (11 years, 3 months ago) by thorpej
Branch: MAIN
CVS Tags: newlock-base, newlock, netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, ifpoll-base, ifpoll, eeh-devprop-base, eeh-devprop
Branch point for: netbsd-1-6, gehenna-devsw
Changes since 1.94: +5 -4 lines
Diff to previous 1.94 (colored)

IFF_POINTTOPOINT interfaces can also transmit packets to broadcast
destinations.

Revision 1.94 / (download) - annotate - [select for diffs], Wed Feb 6 18:00:01 2002 UTC (11 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.93: +3 -3 lines
Diff to previous 1.93 (colored)

ip_mloopback(): process the delayed checksum on the copy, not
the original mbuf.

Revision 1.93 / (download) - annotate - [select for diffs], Thu Jan 31 07:45:22 2002 UTC (11 years, 3 months ago) by itojun
Branch: MAIN
Changes since 1.92: +9 -2 lines
Diff to previous 1.92 (colored)

correct bad ip checksum on multicast loopback packet.  PR14597

Revision 1.92 / (download) - annotate - [select for diffs], Tue Jan 22 03:53:55 2002 UTC (11 years, 4 months ago) by itojun
Branch: MAIN
Changes since 1.91: +6 -2 lines
Diff to previous 1.91 (colored)

make sure to check address family on route cache.  with IPv4 mapped
address we can see both AF_INET/INET6.

Revision 1.91 / (download) - annotate - [select for diffs], Tue Jan 8 10:05:13 2002 UTC (11 years, 4 months ago) by itojun
Branch: MAIN
Changes since 1.90: +6 -2 lines
Diff to previous 1.90 (colored)

don't panic when there's no interface address exist for the specified multicast
outgoing interface (ia == NULL after IFP_TO_IA).

historic behavior (up to revision 1.43) was to use 0.0.0.0 as source address,
but it seems like a mistake according to RFC1112/1122.

Revision 1.90 / (download) - annotate - [select for diffs], Wed Nov 21 06:28:08 2001 UTC (11 years, 6 months ago) by itojun
Branch: MAIN
Changes since 1.89: +5 -4 lines
Diff to previous 1.89 (colored)

update outgoing ifp, only if tunnel mode ipsec is used.  this is to
honor IP_MULTICAST_IF setsockopt on ipsec-over-multicast.  sync with kame

Revision 1.89 / (download) - annotate - [select for diffs], Tue Nov 13 00:32:39 2001 UTC (11 years, 6 months ago) by lukem
Branch: MAIN
Changes since 1.88: +4 -1 lines
Diff to previous 1.88 (colored)

add RCSIDs

Revision 1.88 / (download) - annotate - [select for diffs], Mon Sep 17 17:27:00 2001 UTC (11 years, 8 months ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-mips-cache-base, thorpej-mips-cache, thorpej-devvp-base3, thorpej-devvp-base2
Changes since 1.87: +3 -3 lines
Diff to previous 1.87 (colored)

Split the pre-computed ifnet checksum flags into Tx and Rx directions.
Add capabilities bits that indicate an interface can only perform
in-bound TCPv4 or UDPv4 checksums.  There is at least one Gig-E chip
for which this is true (Level One LXT-1001), and this is also the
case for the Intel i82559 10/100 Ethernet chips.

Revision 1.87 / (download) - annotate - [select for diffs], Sat Aug 11 12:26:50 2001 UTC (11 years, 9 months ago) by yamt
Branch: MAIN
CVS Tags: thorpej-devvp-base, pre-chs-ubcperf, post-chs-ubcperf
Branch point for: thorpej-devvp
Changes since 1.86: +6 -4 lines
Diff to previous 1.86 (colored)

fix cksum error of udp and tcp packet with ip options

Revision 1.86 / (download) - annotate - [select for diffs], Sat Jun 2 16:17:10 2001 UTC (11 years, 11 months ago) by thorpej
Branch: MAIN
Branch point for: kqueue
Changes since 1.85: +77 -4 lines
Diff to previous 1.85 (colored)

Implement support for IP/TCP/UDP checksum offloading provided by
network interfaces.  This works by pre-computing the pseudo-header
checksum and caching it, delaying the actual checksum to ip_output()
if the hardware cannot perform the sum for us.  In-bound checksums
can either be fully-checked by hardware, or summed up for final
verification by software.  This method was modeled after how this
is done in FreeBSD, although the code is significantly different in
most places.

We don't delay checksums for IPv6/TCP, but we do take advantage of the
cached pseudo-header checksum.

Note: hardware-assisted checksumming defaults to "off".  It is
enabled with ifconfig(8).  See the manual page for details.

Implement hardware-assisted checksumming on the DP83820 Gigabit Ethernet,
3c90xB/3c90xC 10/100 Ethernet, and Alteon Tigon/Tigon2 Gigabit Ethernet.

Revision 1.85 / (download) - annotate - [select for diffs], Sat May 26 21:27:09 2001 UTC (12 years ago) by ragge
Branch: MAIN
Changes since 1.84: +2 -6 lines
Diff to previous 1.84 (colored)

Remove one #ifdef vax, bugfix another. Should probably be #ifdef i386 also.

Revision 1.84 / (download) - annotate - [select for diffs], Fri Apr 13 23:30:24 2001 UTC (12 years, 1 month ago) by thorpej
Branch: MAIN
CVS Tags: thorpej_scsipi_nbase, thorpej_scsipi_beforemerge, thorpej_scsipi_base
Changes since 1.83: +2 -2 lines
Diff to previous 1.83 (colored)

Remove the use of splimp() from the NetBSD kernel.  splnet()
and only splnet() is allowed for the protection of data structures
used by network devices.

Revision 1.83 / (download) - annotate - [select for diffs], Tue Feb 27 10:32:03 2001 UTC (12 years, 2 months ago) by itojun
Branch: MAIN
Branch point for: nathanw_sa
Changes since 1.82: +1 -11 lines
Diff to previous 1.82 (colored)

remove obsolete #if 0'ed section
(IPsec and DF bit interaction - the code was incorrect anyways)

Revision 1.82 / (download) - annotate - [select for diffs], Wed Jan 24 09:04:15 2001 UTC (12 years, 4 months ago) by itojun
Branch: MAIN
Changes since 1.81: +23 -15 lines
Diff to previous 1.81 (colored)

- record IPsec packet history into m_aux structure.
- let ipfilter look at wire-format packet only (not the decapsulated ones),
  so that VPN setting can work with NAT/ipfilter settings.
sync with kame.

TODO: use header history for stricter inbound validation

Revision 1.81 / (download) - annotate - [select for diffs], Sat Jan 13 07:19:33 2001 UTC (12 years, 4 months ago) by itojun
Branch: MAIN
Changes since 1.80: +41 -5 lines
Diff to previous 1.80 (colored)

allow IP_MULTICAST_IF and IP_ADD/DROP_MEMBERSHIP to specify interface
by interface index.  if the interface address specified is in 0.0.0.0/8
it will be considered as interface index in network byteorder.

getsockopt(IP_MULTICAST_IF) preserves old behavior if
setsockopt(IP_MULTICAST_IF) was done with interface address, and
returns interface index if setsockopt(IP_MULTICAST_IF) was done with
interface index (again using the form in 0.0.0.0/8).

Suggested by Dave Thaler, based on RIPv2 MIB spec (RFC1724 section 3.3).

http://mail-index.netbsd.org/tech-net/2001/01/13/0003.html

Revision 1.80 / (download) - annotate - [select for diffs], Sat Jan 13 06:01:18 2001 UTC (12 years, 4 months ago) by itojun
Branch: MAIN
Changes since 1.79: +2 -2 lines
Diff to previous 1.79 (colored)

on getsockopt(IP_IPSEC_POLICY), make sure to initialize len

Revision 1.79 / (download) - annotate - [select for diffs], Sat Nov 11 00:55:51 2000 UTC (12 years, 6 months ago) by thorpej
Branch: MAIN
Changes since 1.78: +2 -4 lines
Diff to previous 1.78 (colored)

Actually, our local ip_off variable isn't needed.

Revision 1.78 / (download) - annotate - [select for diffs], Sat Nov 11 00:52:39 2000 UTC (12 years, 6 months ago) by thorpej
Branch: MAIN
Changes since 1.77: +39 -30 lines
Diff to previous 1.77 (colored)

Restructure the PFIL_HOOKS mechanism a bit:
- All packets are passed to PFIL_HOOKS as they come off the wire, i.e.
  fields in protocol headers in network order, etc.
- Allow for multiple hooks to be registered, using a "key" and a "dlt".
  The "dlt" is a BPF data link type, indicating what type of header is
  present.
- INET and INET6 register with key == AF_INET or AF_INET6, and
  dlt == DLT_RAW.
- PFIL_HOOKS now take an argument for the filter hook, and mbuf **,
  an ifnet *, and a direction (PFIL_IN or PFIL_OUT), thus making them
  less IP (really, IP Filter) centric.

Maintain compatibility with IP Filter by adding wrapper functions for
IP Filter.

Revision 1.77 / (download) - annotate - [select for diffs], Mon Oct 23 03:42:18 2000 UTC (12 years, 7 months ago) by itojun
Branch: MAIN
Changes since 1.76: +4 -15 lines
Diff to previous 1.76 (colored)

fix IFA_STATS.
- use hashed in_ifaddr lookup.
- correct endianness.

Revision 1.76 / (download) - annotate - [select for diffs], Tue Oct 17 02:57:01 2000 UTC (12 years, 7 months ago) by thorpej
Branch: MAIN
Changes since 1.75: +9 -1 lines
Diff to previous 1.75 (colored)

Add an IP_MTUDISC flag to the flags that can be passed to
ip_output().  This flag, if set, causes ip_output() to set
DF in the IP header if the MTU in the route is not locked.

This allows a bunch of redundant code, which I was never
really all that happy about adding in the first place, to
be eliminated.

Inspired by a similar change made by provos@openbsd.org when
he integrated NetBSD's Path MTU Discovery code into OpenBSD.

Revision 1.75 / (download) - annotate - [select for diffs], Wed Jun 28 02:59:32 2000 UTC (12 years, 10 months ago) by mrg
Branch: MAIN
Changes since 1.74: +1 -3 lines
Diff to previous 1.74 (colored)

remove include of <vm/vm.h>

Revision 1.74 / (download) - annotate - [select for diffs], Wed May 10 03:31:30 2000 UTC (13 years ago) by itojun
Branch: MAIN
CVS Tags: netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, minoura-xpg4dl-base, minoura-xpg4dl
Branch point for: netbsd-1-5
Changes since 1.73: +14 -4 lines
Diff to previous 1.73 (colored)

add missing boundary checks to ip options processing.
correct timestamp option validation (len and ptr upper/lower bound
based on RFC791).
fill "pointer" field for parameter problem in timestamp option processing.

Revision 1.73 / (download) - annotate - [select for diffs], Thu Apr 13 11:48:07 2000 UTC (13 years, 1 month ago) by is
Branch: MAIN
Changes since 1.72: +3 -1 lines
Diff to previous 1.72 (colored)

Copy M_BCAST and M_MCAST flags when fragmenting a packet (else
Multicast packets won't be send to the correct link layer address
by the interface driver).
By Artur Grabowski, PR 9772.

Revision 1.72 / (download) - annotate - [select for diffs], Fri Mar 31 14:31:03 2000 UTC (13 years, 1 month ago) by jdolecek
Branch: MAIN
Changes since 1.71: +5 -1 lines
Diff to previous 1.71 (colored)

Since last duplicate prototype cleanup, we need to include
<netinet/ip_mroute.h> to get ip_mforward() prototype if MROUTING
is defined.

Revision 1.71 / (download) - annotate - [select for diffs], Thu Mar 30 13:25:02 2000 UTC (13 years, 1 month ago) by augustss
Branch: MAIN
Changes since 1.70: +29 -29 lines
Diff to previous 1.70 (colored)

Remove register declarations.

Revision 1.70 / (download) - annotate - [select for diffs], Wed Mar 22 06:10:39 2000 UTC (13 years, 2 months ago) by itojun
Branch: MAIN
Changes since 1.69: +2 -2 lines
Diff to previous 1.69 (colored)

tabify a line.

Revision 1.69 / (download) - annotate - [select for diffs], Wed Mar 1 12:49:35 2000 UTC (13 years, 2 months ago) by itojun
Branch: MAIN
Changes since 1.68: +4 -3 lines
Diff to previous 1.68 (colored)

introduce m->m_pkthdr.aux to hold random data which needs to be passed
between protocol handlers.

ipsec socket pointers, ipsec decryption/auth information, tunnel
decapsulation information are in my mind - there can be several other usage.
at this moment, we use this for ipsec socket pointer passing.  this will
avoid reuse of m->m_pkthdr.rcvif in ipsec code.

due to the change, MHLEN will be decreased by sizeof(void *) - for example,
for i386, MHLEN was 100 bytes, but is now 96 bytes.
we may want to increase MSIZE from 128 to 256 for some of our architectures.

take caution if you use it for keeping some data item for long period
of time - use extra caution on M_PREPEND() or m_adj(), as they may result
in loss of m->m_pkthdr.aux pointer (and mbuf leak).

this will bump kernel version.

(as discussed in tech-net, tested in kame tree)

Revision 1.68 / (download) - annotate - [select for diffs], Sun Feb 20 00:56:40 2000 UTC (13 years, 3 months ago) by darrenr
Branch: MAIN
Changes since 1.67: +2 -2 lines
Diff to previous 1.67 (colored)

pass "struct pfil_head *" to pfil_add_hook and pfil_remove hook rather
than "struct protosw *".

Revision 1.67 / (download) - annotate - [select for diffs], Thu Feb 17 10:59:35 2000 UTC (13 years, 3 months ago) by darrenr
Branch: MAIN
Changes since 1.66: +3 -2 lines
Diff to previous 1.66 (colored)

Change the use of pfil hooks.  There is no longer a single list of all
pfil information, instead, struct protosw now contains a structure
which caontains list heads, etc.  The per-protosw pfil struct is passed
to pfil_hook_get(), along with an in/out flag to get the head of the
relevant filter list.  This has been done for only IPv4 and IPv6, at
present, with these patches only enabling filtering for IPPROTO_IP and
IPPROTO_IPV6, although it is possible to have tcp/udp, etc, dedicated
filters now also.  The ipfilter code has been updated to only filter
IPv4 packets - next major release of ipfilter is required for ipv6.

Revision 1.66 / (download) - annotate - [select for diffs], Mon Jan 31 14:18:55 2000 UTC (13 years, 3 months ago) by itojun
Branch: MAIN
CVS Tags: chs-ubc2-newbase
Changes since 1.65: +18 -9 lines
Diff to previous 1.65 (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.65 / (download) - annotate - [select for diffs], Mon Dec 20 05:46:33 1999 UTC (13 years, 5 months ago) by itojun
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221
Changes since 1.64: +4 -1 lines
Diff to previous 1.64 (colored)

avoid shared cluster mbuf overwrite on multicast packet loopback.
(bsdi and freebsd fixed this a long time ago...)

PR: 9020
From: pavlin@catarina.usc.edu

Revision 1.64 / (download) - annotate - [select for diffs], Mon Dec 13 17:04:11 1999 UTC (13 years, 5 months ago) by is
Branch: MAIN
Changes since 1.63: +9 -4 lines
Diff to previous 1.63 (colored)

Handle packets to 255.255.255.255 like multicast packets. Fixes PR 7682 by
Darren Reed.

Revision 1.63 / (download) - annotate - [select for diffs], Mon Dec 13 15:17:20 1999 UTC (13 years, 5 months ago) by itojun
Branch: MAIN
Changes since 1.62: +31 -16 lines
Diff to previous 1.62 (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.

TODO:
- 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.62 / (download) - annotate - [select for diffs], Fri Jul 9 22:57:19 1999 UTC (13 years, 10 months ago) by thorpej
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.61: +2 -1 lines
Diff to previous 1.61 (colored)

defopt IPSEC and IPSEC_ESP (both into opt_ipsec.h).

Revision 1.61 / (download) - annotate - [select for diffs], Thu Jul 1 08:12:51 1999 UTC (13 years, 10 months ago) by itojun
Branch: MAIN
Changes since 1.60: +222 -1 lines
Diff to previous 1.60 (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 (ftp://ftp.csl.sony.co.jp/pub/kjc/).
- 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.60 / (download) - annotate - [select for diffs], Mon Jun 7 01:26:04 1999 UTC (13 years, 11 months ago) by mrg
Branch: MAIN
Changes since 1.59: +2 -2 lines
Diff to previous 1.59 (colored)

oops.  move sendit: above the PFIL_HOOKS so that multicast traffic is filtered.  from darren reed.

Revision 1.59 / (download) - annotate - [select for diffs], Tue May 4 19:50:23 1999 UTC (14 years ago) by hwr
Branch: MAIN
Changes since 1.58: +12 -1 lines
Diff to previous 1.58 (colored)

Don't let packets with a Class-D source address escape the host.
Fixes second half of kern/7003 by Jonathan Stone <jonathan@DSG.Stanford.EDU>.

Revision 1.58 / (download) - annotate - [select for diffs], Sat Mar 27 01:24:50 1999 UTC (14 years, 2 months ago) by aidan
Branch: MAIN
CVS Tags: netbsd-1-4-base, netbsd-1-4-RELEASE
Branch point for: netbsd-1-4, kame, chs-ubc2
Changes since 1.57: +17 -1 lines
Diff to previous 1.57 (colored)

Added per-addr input/output statistics.  Currently just support netatalk
and netinet, currently only tested under netinet.

Disabled by default, enabled by compiling the kernel with option
IFA_STATS.  Enabling this feature seems to make the ip_output function
take 13% longer than before, which should be OK for people that need
this feature.

Revision 1.57 / (download) - annotate - [select for diffs], Fri Mar 12 22:42:31 1999 UTC (14 years, 2 months ago) by perry
Branch: MAIN
Changes since 1.56: +5 -6 lines
Diff to previous 1.56 (colored)

exterminate ovbcopy. patches provided by Erik Bertelsen, pr-7145

Revision 1.56 / (download) - annotate - [select for diffs], Tue Jan 19 23:39:57 1999 UTC (14 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.55: +1 -2 lines
Diff to previous 1.55 (colored)

There's just no plausible reason to byte-swap ip_id internally.  It's opaque.

Revision 1.55 / (download) - annotate - [select for diffs], Mon Jan 11 22:35:06 1999 UTC (14 years, 4 months ago) by thorpej
Branch: MAIN
Changes since 1.54: +9 -7 lines
Diff to previous 1.54 (colored)

Fix byte order and ip_len inconsistencies in ICMP reply code.  Also, fix
some formatting and HTONS(foo) vs. foo = htons(foo) inconsistencies.

PR #6602, Darren Reed.

Revision 1.54 / (download) - annotate - [select for diffs], Sat Dec 19 02:46:12 1998 UTC (14 years, 5 months ago) by thorpej
Branch: MAIN
Changes since 1.53: +38 -38 lines
Diff to previous 1.53 (colored)

Reverse the copyright-notice-swap.  It went against existing practice.

Revision 1.53 / (download) - annotate - [select for diffs], Mon Oct 26 17:31:01 1998 UTC (14 years, 7 months ago) by ws
Branch: MAIN
CVS Tags: kenh-if-detach-base, chs-ubc-base, chs-ubc
Branch point for: kenh-if-detach
Changes since 1.52: +2 -1 lines
Diff to previous 1.52 (colored)

Fix a buglet when looking up an interface for multicast:
Zero out the routing structure before calling the route lookup code
in order to correctly match addresses.

Revision 1.52 / (download) - annotate - [select for diffs], Tue Oct 20 01:46:27 1998 UTC (14 years, 7 months ago) by matt
Branch: MAIN
Changes since 1.51: +2 -2 lines
Diff to previous 1.51 (colored)

vax -> __vax__ (and mips to __mips__ in ultrix_misc.c)

Revision 1.51 / (download) - annotate - [select for diffs], Wed Sep 30 21:52:25 1998 UTC (14 years, 7 months ago) by tls
Branch: MAIN
Changes since 1.50: +38 -38 lines
Diff to previous 1.50 (colored)

Switch order of TNF and UCB copyrights so UCB copyright is first; this seems more appropriate since UCB wrote the original code, after all.

Revision 1.50 / (download) - annotate - [select for diffs], Sun Aug 9 08:58:19 1998 UTC (14 years, 9 months ago) by mrg
Branch: MAIN
Changes since 1.49: +2 -1 lines
Diff to previous 1.49 (colored)

defopt PFIL_HOOKS.

Revision 1.49 / (download) - annotate - [select for diffs], Fri Jul 17 00:28:01 1998 UTC (14 years, 10 months ago) by sommerfe
Branch: MAIN
CVS Tags: eeh-paddr_t-base, eeh-paddr_t
Changes since 1.48: +5 -2 lines
Diff to previous 1.48 (colored)

Fix PR5508: ipfil cut-through forwarding causes panic

Revision 1.48 / (download) - annotate - [select for diffs], Tue Apr 28 15:26:00 1998 UTC (15 years ago) by matt
Branch: MAIN
Changes since 1.47: +23 -6 lines
Diff to previous 1.47 (colored)

Only transmit fragments if the send queue of interface can actually hold
all of the fragments.  Use the mtu of route in preference of the MTU of the
interface when doing fragmentation decisions.  (ie. Fragment to the path
mtu if it is available).

Revision 1.47 / (download) - annotate - [select for diffs], Tue Mar 24 03:10:02 1998 UTC (15 years, 2 months ago) by kml
Branch: MAIN
Changes since 1.46: +19 -1 lines
Diff to previous 1.46 (colored)

Ensure that we take the IP option length into account when we calculate
the effective maximum send size for TCP.  ip_optlen() and tcp_optlen()
should probably be inlined for efficiency.

Revision 1.46 / (download) - annotate - [select for diffs], Thu Mar 19 15:46:43 1998 UTC (15 years, 2 months ago) by mrg
Branch: MAIN
Changes since 1.45: +2 -2 lines
Diff to previous 1.45 (colored)

convert pfil(9) in and out lists from <sys/queue.h> LISTs to TAILQs, and
change pfil_add_hook to put output filters at the tail of the queue,
while continuing to place input filters at the head of the queue.  update
the two users of these functions, and document these changes.

fixes PR#4593.

Revision 1.45 / (download) - annotate - [select for diffs], Sun Feb 15 18:24:28 1998 UTC (15 years, 3 months ago) by tls
Branch: MAIN
Changes since 1.44: +38 -1 lines
Diff to previous 1.44 (colored)

Add correct copyright notice for IP address hash change.  This code is donated to TNF by the original copyright holder, Panix.

Revision 1.44 / (download) - annotate - [select for diffs], Fri Feb 13 18:21:45 1998 UTC (15 years, 3 months ago) by tls
Branch: MAIN
Changes since 1.43: +4 -7 lines
Diff to previous 1.43 (colored)

Change list of interface IP addresses to a hash.  Improves performance on hosts with a large number of IP addresses significantly.

Revision 1.43 / (download) - annotate - [select for diffs], Fri Feb 13 10:23:49 1998 UTC (15 years, 3 months ago) by kleink
Branch: MAIN
Changes since 1.42: +2 -2 lines
Diff to previous 1.42 (colored)

Fix variable declarations:  register -> register int.

Revision 1.42 / (download) - annotate - [select for diffs], Mon Jan 12 03:02:52 1998 UTC (15 years, 4 months ago) by scottr
Branch: MAIN
Changes since 1.41: +3 -1 lines
Diff to previous 1.41 (colored)

Use option header file for MROUTING

Revision 1.41 / (download) - annotate - [select for diffs], Wed Jan 7 22:51:25 1998 UTC (15 years, 4 months ago) by lukem
Branch: MAIN
Changes since 1.40: +37 -1 lines
Diff to previous 1.40 (colored)

add the following, derived from FreeBSD:
* IP_PORTRANGE socket option, which controls how the ephemeral ports
  are allocated. it takes the following settings:
	IP_PORTRANGE_DEFAULT	use anonportmin (49152) -> anonportmax (65535)
	IP_PORTRANGE_HIGH	as IP_PORTRANGE_DEFAULT (retained for FreeBSD
				compat reasons, where these are separate)
	IP_PORTRANGE_LOW	use 600 -> 1023. only works if uid==0.
* in_pcb flag INP_ANONPORT. set if port was allocated ephmerally

Revision 1.40 / (download) - annotate - [select for diffs], Tue Oct 14 00:52:59 1997 UTC (15 years, 7 months ago) by matt
Branch: MAIN
CVS Tags: netbsd-1-3-base, netbsd-1-3-RELEASE, netbsd-1-3-PATCH001, netbsd-1-3-BETA, marc-pcmcia-base
Branch point for: netbsd-1-3
Changes since 1.39: +13 -1 lines
Diff to previous 1.39 (colored)

Add support for returning maximum supported MTU when ip_output fails with
EMSGSIZE.

Revision 1.39 / (download) - annotate - [select for diffs], Tue Apr 15 00:41:53 1997 UTC (16 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: thorpej-signal-base, thorpej-signal, marc-pcmcia-bp, bouyer-scsipi
Branch point for: marc-pcmcia
Changes since 1.38: +2 -2 lines
Diff to previous 1.38 (colored)

Move the mtod calls *after* we've made sure that the packet has passed the
filter successfully. Otherwise it can be NULL if the filter blocked it,
and we die. How did this ever work?

Revision 1.38 / (download) - annotate - [select for diffs], Tue Feb 18 20:49:36 1997 UTC (16 years, 3 months ago) by mrg
Branch: MAIN
CVS Tags: is-newarp-before-merge
Changes since 1.37: +2 -5 lines
Diff to previous 1.37 (colored)

pseudo-device ipfilter brings in PFIL_HOOKS.

Revision 1.37 / (download) - annotate - [select for diffs], Sat Jan 11 05:21:11 1997 UTC (16 years, 4 months ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-setroot, mrg-vm-swap, is-newarp-base
Branch point for: is-newarp
Changes since 1.36: +11 -1 lines
Diff to previous 1.36 (colored)

Implement the IP_RECVIF socket option: supply a datagram packet's incoming
interface using a sockaddr_dl in a control mbuf.

Implement SO_TIMESTAMP for IP datagrams.

Move packet information option processing into a generic function
so that they work with multicast UDP and raw IP as well as unicast UDP.

Contributed by Bill Fenner <fenner@parc.xerox.com>.

Revision 1.36 / (download) - annotate - [select for diffs], Fri Dec 20 09:08:16 1996 UTC (16 years, 5 months ago) by mrg
Branch: MAIN
Changes since 1.35: +5 -4 lines
Diff to previous 1.35 (colored)

always reassign ip after calling function.

Revision 1.35 / (download) - annotate - [select for diffs], Fri Dec 20 08:39:29 1996 UTC (16 years, 5 months ago) by mrg
Branch: MAIN
Changes since 1.34: +1 -9 lines
Diff to previous 1.34 (colored)

in pfil_hooks:  always reassign ip after calling hook.

Revision 1.34 / (download) - annotate - [select for diffs], Tue Oct 22 11:27:07 1996 UTC (16 years, 7 months ago) by veego
Branch: MAIN
Changes since 1.33: +4 -3 lines
Diff to previous 1.33 (colored)

Fix a panic from the pfil_hooks.

Revision 1.33 / (download) - annotate - [select for diffs], Fri Oct 11 18:19:08 1996 UTC (16 years, 7 months ago) by is
Branch: MAIN
Changes since 1.32: +2 -2 lines
Diff to previous 1.32 (colored)

Fix a mbuf leak in ip_output().

Scenario: If ip_insertoptions() prepends a new mbuf to the chain, the
bad: label's m_freem(m0) still would free only the original mbuf chain
if the transmission failed for, e.g., no route to host; resulting in
one lost mbuf per failed packet. (The original posting included a
demonstration program).

Original report of this bug was by jinmei@isl.rdc.toshiba.co.jp
(JINMEI Tatuya) on comp.bugs.4bsd.

Revision 1.32 / (download) - annotate - [select for diffs], Sat Sep 14 14:40:27 1996 UTC (16 years, 8 months ago) by mrg
Branch: MAIN
Changes since 1.31: +11 -7 lines
Diff to previous 1.31 (colored)

move the packet filter hooks in to a saner location.  while i'm here, rename
PACKET_FILTER to PFIL_HOOKS.

Revision 1.31 / (download) - annotate - [select for diffs], Mon Sep 9 14:51:19 1996 UTC (16 years, 8 months ago) by mycroft
Branch: MAIN
Changes since 1.30: +21 -22 lines
Diff to previous 1.30 (colored)

Add in_nullhost() and in_hosteq() macros, to hide some protocol
details.  Also, fix a bug in TCP wrt SYN+URG packets.

Revision 1.30 / (download) - annotate - [select for diffs], Fri Sep 6 05:07:45 1996 UTC (16 years, 8 months ago) by mrg
Branch: MAIN
Changes since 1.29: +27 -1 lines
Diff to previous 1.29 (colored)

add packet filter interface code.  see pfil(9) for more details.  you
need the PACKET_FILTER option to enable this code.  currently, ipfilter
version 3.1.1-beta has been converted to use this new interface.

Revision 1.29 / (download) - annotate - [select for diffs], Mon Feb 26 23:17:12 1996 UTC (17 years, 2 months ago) by mrg
Branch: MAIN
CVS Tags: netbsd-1-2-base, netbsd-1-2-RELEASE, netbsd-1-2-BETA
Branch point for: netbsd-1-2
Changes since 1.28: +2 -3 lines
Diff to previous 1.28 (colored)

two more local addr changes, all done differently now (idea from charles)

Revision 1.28 / (download) - annotate - [select for diffs], Tue Feb 13 23:43:07 1996 UTC (17 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.27: +25 -7 lines
Diff to previous 1.27 (colored)

netinet prototypes

Revision 1.27 / (download) - annotate - [select for diffs], Sat Jul 1 03:44:55 1995 UTC (17 years, 10 months ago) by cgd
Branch: MAIN
CVS Tags: netbsd-1-1-base, netbsd-1-1-RELEASE, netbsd-1-1-PATCH001, netbsd-1-1
Changes since 1.26: +2 -2 lines
Diff to previous 1.26 (colored)

null mbuf pointer could cause system crash; avoid it.  From
Torsten Duwe <duwe@immd4.informatik.uni-erlangen.de>.

Revision 1.26 / (download) - annotate - [select for diffs], Mon Jun 12 00:47:44 1995 UTC (17 years, 11 months ago) by mycroft
Branch: MAIN
Changes since 1.25: +2 -2 lines
Diff to previous 1.25 (colored)

Various cleanup, including:
* Convert several data structures to use queue.h.
* Split in_pcbnotify() into two parts; one for notifying a specific PCB, and
one for notifying all PCBs for a particular foreign address.

Revision 1.25 / (download) - annotate - [select for diffs], Sun Jun 4 05:58:28 1995 UTC (17 years, 11 months ago) by mycroft
Branch: MAIN
Changes since 1.24: +4 -4 lines
Diff to previous 1.24 (colored)

Don't cast things unnecessarily.

Revision 1.24 / (download) - annotate - [select for diffs], Sun Jun 4 05:07:08 1995 UTC (17 years, 11 months ago) by mycroft
Branch: MAIN
Changes since 1.23: +9 -12 lines
Diff to previous 1.23 (colored)

Clean up many more casts.

Revision 1.23 / (download) - annotate - [select for diffs], Thu Jun 1 21:36:40 1995 UTC (17 years, 11 months ago) by mycroft
Branch: MAIN
Changes since 1.22: +5 -6 lines
Diff to previous 1.22 (colored)

Avoid byte-swapping IP addresses at run time.

Revision 1.22 / (download) - annotate - [select for diffs], Mon May 15 01:24:53 1995 UTC (18 years ago) by cgd
Branch: MAIN
Changes since 1.21: +5 -5 lines
Diff to previous 1.21 (colored)

simplify ip_output() out-of-memory condition slightly, and style nits.

Revision 1.21 / (download) - annotate - [select for diffs], Thu Apr 13 06:35:38 1995 UTC (18 years, 1 month ago) by cgd
Branch: MAIN
Changes since 1.20: +17 -17 lines
Diff to previous 1.20 (colored)

be a bit more careful and explicit with types.  (basically a large no-op.)

Revision 1.20 / (download) - annotate - [select for diffs], Tue Apr 11 04:30:56 1995 UTC (18 years, 1 month ago) by mycroft
Branch: MAIN
Changes since 1.19: +2 -3 lines
Diff to previous 1.19 (colored)

Remove some explicit references to loif.

Revision 1.19 / (download) - annotate - [select for diffs], Wed Jun 29 06:38:27 1994 UTC (18 years, 10 months ago) by cgd
Branch: MAIN
CVS Tags: netbsd-1-0-base, netbsd-1-0-RELEASE, netbsd-1-0-PATCH1, netbsd-1-0-PATCH06, netbsd-1-0-PATCH05, netbsd-1-0-PATCH04, netbsd-1-0-PATCH03, netbsd-1-0-PATCH02, netbsd-1-0-PATCH0, netbsd-1-0
Changes since 1.18: +3 -2 lines
Diff to previous 1.18 (colored)

New RCS ID's, take two.  they're more aesthecially pleasant, and use 'NetBSD'

Revision 1.18 / (download) - annotate - [select for diffs], Fri May 13 06:06:26 1994 UTC (19 years ago) by mycroft
Branch: MAIN
Changes since 1.17: +63 -58 lines
Diff to previous 1.17 (colored)

Update to 4.4-Lite networking code, with a few local changes.

Revision 1.17 / (download) - annotate - [select for diffs], Wed Feb 2 05:59:06 1994 UTC (19 years, 3 months ago) by hpeyerl
Branch: MAIN
Changes since 1.16: +1 -11 lines
Diff to previous 1.16 (colored)

Multicast is no longer optional.

Revision 1.16 / (download) - annotate - [select for diffs], Wed Jan 19 21:36:56 1994 UTC (19 years, 4 months ago) by brezak
Branch: MAIN
Changes since 1.15: +16 -16 lines
Diff to previous 1.15 (colored)

Fix arguments to ip_getmoptions.

Revision 1.15 / (download) - annotate - [select for diffs], Tue Jan 18 03:26:53 1994 UTC (19 years, 4 months ago) by brezak
Branch: MAIN
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored)

Fix some prototype detected warnings/errors.

Revision 1.14 / (download) - annotate - [select for diffs], Tue Jan 18 02:36:53 1994 UTC (19 years, 4 months ago) by brezak
Branch: MAIN
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

Patch for ip-multicast bugs from mccanne@ee.lbl.gov (Steven McCanne)

Revision 1.13 / (download) - annotate - [select for diffs], Mon Jan 10 20:14:23 1994 UTC (19 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.12: +3 -9 lines
Diff to previous 1.12 (colored)

Should compile now with or without `options MULTICAST'.

Revision 1.12 / (download) - annotate - [select for diffs], Sun Jan 9 01:06:18 1994 UTC (19 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.11: +11 -5 lines
Diff to previous 1.11 (colored)

Prototype the rest.

Revision 1.11 / (download) - annotate - [select for diffs], Sat Jan 8 21:21:52 1994 UTC (19 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.10: +12 -12 lines
Diff to previous 1.10 (colored)

Fix some inconsistent spacing; spaces at the end of lines, etc.

Revision 1.10 / (download) - annotate - [select for diffs], Fri Jan 7 22:16:11 1994 UTC (19 years, 4 months ago) by cgd
Branch: MAIN
Changes since 1.9: +1 -10 lines
Diff to previous 1.9 (colored)

kill COMPAT_OLDSOCKOPT

Revision 1.9 / (download) - annotate - [select for diffs], Thu Jan 6 23:00:22 1994 UTC (19 years, 4 months ago) by ws
Branch: MAIN
Changes since 1.8: +3 -3 lines
Diff to previous 1.8 (colored)

Apparently noone ever tested the COMPAT_OLDSOCKOPT flag...

Revision 1.8 / (download) - annotate - [select for diffs], Sat Dec 18 00:41:59 1993 UTC (19 years, 5 months ago) by mycroft
Branch: MAIN
Changes since 1.7: +17 -17 lines
Diff to previous 1.7 (colored)

Canonicalize all #includes.

Revision 1.7 / (download) - annotate - [select for diffs], Mon Dec 6 07:14:45 1993 UTC (19 years, 5 months ago) by cgd
Branch: MAIN
Changes since 1.6: +2 -2 lines
Diff to previous 1.6 (colored)

oops; fix that last...

Revision 1.6 / (download) - annotate - [select for diffs], Mon Dec 6 06:46:28 1993 UTC (19 years, 5 months ago) by cgd
Branch: MAIN
Changes since 1.5: +10 -1 lines
Diff to previous 1.5 (colored)

the ugliest compatibility hack i think i've ever seen...
define COMPAT_OLDSOCKOPT to get new kernels to work with the
old args to [sg]sockopt.  this is going to go away "soon".
note that this option only has effect if MULTICAST is not defined.

Revision 1.5 / (download) - annotate - [select for diffs], Mon Dec 6 04:59:40 1993 UTC (19 years, 5 months ago) by hpeyerl
Branch: MAIN
Changes since 1.4: +458 -2 lines
Diff to previous 1.4 (colored)

multicast support.
>From Chris Maeda, cmaeda@cs.washington.edu
These patches are derived from the IP Multicast patches for BSDI.

Revision 1.4 / (download) - annotate - [select for diffs], Fri Nov 5 23:06:26 1993 UTC (19 years, 6 months ago) by cgd
Branch: MAIN
Changes since 1.3: +12 -1 lines
Diff to previous 1.3 (colored)

fix from david greenman, davidg@freefall.cdrom.com:
fixed bug where large amounts of unidirectional UDP traffic would fill
the interface output queue and further udp packets would be fragmented
and only partially sent - keeping the output queue full and jamming the
network, but not actually getting any real work done (because you can't
send just 'part' of a udp packet - if you fragment it, you must send
the whole thing). The fix involves adding a check to make sure that the
output queue has sufficient space for all of the fragments.

Revision 1.3 / (download) - annotate - [select for diffs], Sat May 22 11:42:35 1993 UTC (20 years ago) by cgd
Branch: MAIN
CVS Tags: netbsd-0-9-patch-001, netbsd-0-9-base, netbsd-0-9-RELEASE, netbsd-0-9-BETA, netbsd-0-9-ALPHA2, netbsd-0-9-ALPHA, netbsd-0-9, magnum-base
Branch point for: magnum
Changes since 1.2: +1 -2 lines
Diff to previous 1.2 (colored)

add include of select.h if necessary for protos, or delete if extraneous

Revision 1.2 / (download) - annotate - [select for diffs], Tue May 18 18:20:11 1993 UTC (20 years ago) by cgd
Branch: MAIN
Changes since 1.1: +3 -1 lines
Diff to previous 1.1 (colored)

make kernel select interface be one-stop shopping & clean it all up.

Revision 1.1 / (download) - annotate - [select for diffs], Sun Mar 21 09:45:37 1993 UTC (20 years, 2 months ago) by cgd
Branch: MAIN

Initial revision

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 <webmaster@jp.NetBSD.org>