The NetBSD Project

CVS log for src/sys/netinet6/raw_ip6.c

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

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.184 / (download) - annotate - [select for diffs], Sat Feb 24 21:41:13 2024 UTC (4 weeks, 4 days ago) by mlelstv
Branch: MAIN
CVS Tags: HEAD
Changes since 1.183: +4 -3 lines
Diff to previous 1.183 (colored) to selected 1.49 (colored)

Deliver timestamps also to raw sockets.
Fixes PR 57955

Revision 1.183 / (download) - annotate - [select for diffs], Wed Mar 22 03:17:18 2023 UTC (12 months, 1 week ago) by ozaki-r
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation
Changes since 1.182: +13 -4 lines
Diff to previous 1.182 (colored) to selected 1.49 (colored)

in6: make sure a user-specified checksum field is within a packet

From OpenBSD

Revision 1.182 / (download) - annotate - [select for diffs], Fri Nov 4 09:01:53 2022 UTC (16 months, 3 weeks ago) by ozaki-r
Branch: MAIN
CVS Tags: netbsd-10-base
Branch point for: netbsd-10
Changes since 1.181: +14 -14 lines
Diff to previous 1.181 (colored) to selected 1.49 (colored)

inpcb: rename functions to in6pcb_*

Revision 1.181 / (download) - annotate - [select for diffs], Fri Nov 4 09:00:58 2022 UTC (16 months, 3 weeks ago) by ozaki-r
Branch: MAIN
Changes since 1.180: +4 -4 lines
Diff to previous 1.180 (colored) to selected 1.49 (colored)

inpcb: rename functions to inpcb_*

Inspired by rmind-smpnet patches.

Revision 1.180 / (download) - annotate - [select for diffs], Fri Oct 28 05:25:36 2022 UTC (17 months ago) by ozaki-r
Branch: MAIN
Changes since 1.179: +35 -35 lines
Diff to previous 1.179 (colored) to selected 1.49 (colored)

inpcb: separate inpcb again to reduce the size of PCB for IPv4

The data size of PCB for IPv4 increased because of the merge of
struct in6pcb.  The change decreases the size to the original size by
separating struct inpcb (again).  struct in4pcb and in6pcb that embed
struct inpcb are introduced.

Even after the separation, users don't need to realize the separation
and only have to use some macros to access dedicated data.  For example,
inp->inp_laddr is now accessed through in4p_laddr(inp).

Revision 1.179 / (download) - annotate - [select for diffs], Fri Oct 28 05:18:39 2022 UTC (17 months ago) by ozaki-r
Branch: MAIN
Changes since 1.178: +74 -76 lines
Diff to previous 1.178 (colored) to selected 1.49 (colored)

inpcb: integrate data structures of PCB into one

Data structures of network protocol control blocks (PCBs), i.e.,
struct inpcb, in6pcb and inpcb_hdr, are not organized well.  Users of
the data structures have to handle them separately and thus the code
is cluttered and duplicated.

The commit integrates the data structures into one, struct inpcb.  As a
result, users of PCBs only have to handle just one data structure, so
the code becomes simple.

One drawback is that the data size of PCB for IPv4 increases by 40 bytes
(from 248 bytes to 288 bytes).

Revision 1.178 / (download) - annotate - [select for diffs], Sat May 28 10:36:23 2022 UTC (22 months ago) by andvar
Branch: MAIN
CVS Tags: bouyer-sunxi-drm-base, bouyer-sunxi-drm
Changes since 1.177: +3 -3 lines
Diff to previous 1.177 (colored) to selected 1.49 (colored)

fix various typos, mainly in comments.

Revision 1.177 / (download) - annotate - [select for diffs], Wed Feb 23 21:54:41 2022 UTC (2 years, 1 month ago) by andvar
Branch: MAIN
Changes since 1.176: +3 -3 lines
Diff to previous 1.176 (colored) to selected 1.49 (colored)

fix various typos in comments, mainly immediatly/immediately/,
as well shared and recently fixed typos in OpenBSD code by Jonathan Grey.

Revision 1.176 / (download) - annotate - [select for diffs], Tue Sep 21 15:08:44 2021 UTC (2 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.175: +3 -3 lines
Diff to previous 1.175 (colored) to selected 1.49 (colored)

don't opencode kauth_cred_get()

Revision 1.175 / (download) - annotate - [select for diffs], Mon Feb 25 06:49:44 2019 UTC (5 years, 1 month ago) by maxv
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-futex, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, isaki-audio2-base, isaki-audio2, is-mlppp-base, is-mlppp, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh, ad-namecache-base3, ad-namecache-base2, ad-namecache-base1, ad-namecache-base, ad-namecache
Branch point for: netbsd-9
Changes since 1.174: +6 -2 lines
Diff to previous 1.174 (colored) to selected 1.49 (colored)

RIP6, CAN, SCTP and SCTP6 lack a length check in their _send() functions.
Fix RIP6 and CAN, add a big XXX in the SCTP ones.

Found by KASAN, triggered by SyzKaller.

Reported-by: syzbot+0b9692ae0f49f93b7dc7@syzkaller.appspotmail.com

Revision 1.174 / (download) - annotate - [select for diffs], Sun Feb 24 07:20:33 2019 UTC (5 years, 1 month ago) by maxv
Branch: MAIN
Changes since 1.173: +4 -2 lines
Diff to previous 1.173 (colored) to selected 1.49 (colored)

RIP, RIP6, DDP, SCTP and SCTP6 lack a length check in their _connect()
functions. Fix the first three, and add a big XXX in the SCTP ones.

Found by KASAN, triggered by SyzKaller.

Reported-by: syzbot+9eaf98dad6ca738c250d@syzkaller.appspotmail.com

Revision 1.173 / (download) - annotate - [select for diffs], Mon Jan 28 12:53:01 2019 UTC (5 years, 2 months ago) by martin
Branch: MAIN
Changes since 1.172: +4 -4 lines
Diff to previous 1.172 (colored) to selected 1.49 (colored)

Fix memory leaks pointed out by Ilja Van Sprundel: all
sendoob() functions are expted to free both passed
mbuf chains.

Revision 1.172 / (download) - annotate - [select for diffs], Fri May 11 14:25:50 2018 UTC (5 years, 10 months ago) by maxv
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521
Branch point for: phil-wifi
Changes since 1.171: +29 -32 lines
Diff to previous 1.171 (colored) to selected 1.49 (colored)

Dedup: introduce rip6_sbappendaddr. Same as IPv4.

Revision 1.171 / (download) - annotate - [select for diffs], Sun Apr 29 07:05:13 2018 UTC (5 years, 11 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-0502
Changes since 1.170: +3 -3 lines
Diff to previous 1.170 (colored) to selected 1.49 (colored)

Replace
	m_copym(m, 0, M_COPYALL, M_DONTWAIT)
by
	m_copypacket(m, M_DONTWAIT)
when it is obvious that 'm' has M_PKTHDR set.

Revision 1.170 / (download) - annotate - [select for diffs], Sat Apr 28 13:26:57 2018 UTC (5 years, 11 months ago) by maxv
Branch: MAIN
Changes since 1.169: +2 -3 lines
Diff to previous 1.169 (colored) to selected 1.49 (colored)

Remove unused ipsec_var.h includes.

Revision 1.169 / (download) - annotate - [select for diffs], Thu Apr 26 19:50:09 2018 UTC (5 years, 11 months ago) by maxv
Branch: MAIN
Changes since 1.168: +3 -3 lines
Diff to previous 1.168 (colored) to selected 1.49 (colored)

Stop using m_copy(), use m_copym() directly. m_copy is useless,
undocumented and confusing.

Revision 1.168 / (download) - annotate - [select for diffs], Thu Apr 12 07:28:10 2018 UTC (5 years, 11 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-0422, pgoyette-compat-0415
Changes since 1.167: +25 -21 lines
Diff to previous 1.167 (colored) to selected 1.49 (colored)

Synchronize the code between raw_ip6.c<->icmp6.c<->raw_ip.c, so that it is
the same everywhere.

Revision 1.167 / (download) - annotate - [select for diffs], Thu Apr 12 06:49:39 2018 UTC (5 years, 11 months ago) by maxv
Branch: MAIN
Changes since 1.166: +2 -5 lines
Diff to previous 1.166 (colored) to selected 1.49 (colored)

Remove misleading comment; we're just checking the SP, not verifying the
AH/ESP payload. While here style a bit.

Revision 1.166 / (download) - annotate - [select for diffs], Wed Mar 21 14:23:54 2018 UTC (6 years ago) by roy
Branch: MAIN
CVS Tags: pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322
Changes since 1.165: +4 -3 lines
Diff to previous 1.165 (colored) to selected 1.49 (colored)

Sprinkle more soroverflow().

Revision 1.165 / (download) - annotate - [select for diffs], Wed Feb 28 11:23:24 2018 UTC (6 years ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-base, pgoyette-compat-0315
Branch point for: pgoyette-compat
Changes since 1.164: +2 -3 lines
Diff to previous 1.164 (colored) to selected 1.49 (colored)

Remove unused ipsec_private.h includes.

Revision 1.164 / (download) - annotate - [select for diffs], Mon Feb 26 09:13:00 2018 UTC (6 years, 1 month ago) by maxv
Branch: MAIN
Changes since 1.163: +3 -4 lines
Diff to previous 1.163 (colored) to selected 1.49 (colored)

Remove redundant condition (harmless). PR/53030.

Revision 1.163 / (download) - annotate - [select for diffs], Mon Feb 26 09:04:29 2018 UTC (6 years, 1 month ago) by maxv
Branch: MAIN
Changes since 1.162: +4 -4 lines
Diff to previous 1.162 (colored) to selected 1.49 (colored)

Dedup: merge ipsec4_in_reject and ipsec6_in_reject into ipsec_in_reject.
While here fix misleading comment.

ok ozaki-r@

Revision 1.162 / (download) - annotate - [select for diffs], Thu Feb 8 19:58:05 2018 UTC (6 years, 1 month ago) by maxv
Branch: MAIN
Changes since 1.161: +2 -10 lines
Diff to previous 1.161 (colored) to selected 1.49 (colored)

Remove the IN6_IS_ADDR_V4MAPPED checks in the protocol functions. They
are useless, because the IPv6 entry point (ip6_input) already performs
them.

The checks were first added in the protocol functions:

	Wed Dec 22 04:03:02 1999 UTC (18 years, 1 month ago) by itojun

"drop IPv6 packets with v4 mapped address on src/dst.  they are illegal
and may be used to fool IPv6 implementations (by using ::ffff:127.0.0.1 as
source you may be able to pretend the packet is from local node)"

Shortly afterwards they were also added in the IPv6 entry point, but
where not removed from the protocol functions:

	Mon Jan 31 10:33:22 2000 UTC (18 years ago) by itojun

"be proactive about malicious packet on the wire.  we fear that v4 mapped
address to be used as a tool to hose security filters (like bypassing
"local host only" filter by using ::ffff:127.0.0.1)."

OpenBSD did the same a few months ago. FreeBSD has never had these checks.

Revision 1.161 / (download) - annotate - [select for diffs], Thu Feb 1 15:53:16 2018 UTC (6 years, 1 month ago) by maxv
Branch: MAIN
Changes since 1.160: +4 -3 lines
Diff to previous 1.160 (colored) to selected 1.49 (colored)

Fix use-after-free, the first m_copyback_cow may have freed the mbuf, so
it is wrong to read ip6->ip6_nxt.

Revision 1.160 / (download) - annotate - [select for diffs], Tue Jan 30 14:49:25 2018 UTC (6 years, 1 month ago) by maxv
Branch: MAIN
Changes since 1.159: +4 -4 lines
Diff to previous 1.159 (colored) to selected 1.49 (colored)

Fix a buffer overflow in ip6_get_prevhdr. Doing

	mtod(m, char *) + len

is wrong, an option is allowed to be located in another mbuf of the chain.
If the offset of an option within the chain is bigger than the length of
the first mbuf in that chain, we are reading/writing one byte of packet-
controlled data beyond the end of the first mbuf.

The length of this first mbuf depends on the layout the network driver
chose. In the most difficult case, it will allocate a 2KB cluster, which
is bigger than the Ethernet MTU.

But there is at least one way of exploiting this case: by sending a
special combination of nested IPv6 fragments, the packet can control a
good bunch of 'len'. By luck, the memory pool containing clusters does not
embed the pool header in front of the items, so it is not straightforward
to predict what is located at 'mtod(m, char *) + len'.

However, by sending offending fragments in a loop, it is possible to
crash the kernel - at some point we will hit important data structures.

As far as I can tell, PF protects against this difficult case, because
it kicks nested fragments. NPF does not protect against this. IPF I don't
know.

Then there are the more easy cases, if the MTU is bigger than a cluster,
or if the network driver did not allocate a cluster, or perhaps if the
fragments are received via a tunnel; I haven't investigated these cases.

Change ip6_get_prevhdr so that it returns an offset in the chain, and
always use IP6_EXTHDR_GET to get a writable pointer. IP6_EXTHDR_GET
leaves M_PKTHDR untouched.

This place is still fragile.

Revision 1.159 / (download) - annotate - [select for diffs], Tue Jan 23 09:21:59 2018 UTC (6 years, 2 months ago) by maxv
Branch: MAIN
Changes since 1.158: +8 -14 lines
Diff to previous 1.158 (colored) to selected 1.49 (colored)

Fix twice the same mistake: 'last' can't be null, so there's no point in
having this misleading branch.

Revision 1.158 / (download) - annotate - [select for diffs], Sun Nov 5 07:03:37 2017 UTC (6 years, 4 months ago) by ozaki-r
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202
Changes since 1.157: +4 -3 lines
Diff to previous 1.157 (colored) to selected 1.49 (colored)

Fix usages of ipsec_used

If IPsec isn't used, we must go back to the normal path.

PR kern/52659

Revision 1.157 / (download) - annotate - [select for diffs], Thu Jun 1 02:45:14 2017 UTC (6 years, 9 months ago) by chs
Branch: MAIN
CVS Tags: perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, netbsd-8-base, matt-nb8-mediatek-base, matt-nb8-mediatek
Branch point for: netbsd-8
Changes since 1.156: +2 -6 lines
Diff to previous 1.156 (colored) to selected 1.49 (colored)

remove checks for failure after memory allocation calls that cannot fail:

  kmem_alloc() with KM_SLEEP
  kmem_zalloc() with KM_SLEEP
  percpu_alloc()
  pserialize_create()
  psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.

Revision 1.156 / (download) - annotate - [select for diffs], Fri Mar 3 07:13:06 2017 UTC (7 years ago) by ozaki-r
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, pgoyette-localcount-20170320, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1
Changes since 1.155: +3 -3 lines
Diff to previous 1.155 (colored) to selected 1.49 (colored)

Pass inpcb/in6pcb instead of socket to ip_output/ip6_output

- Passing a socket to Layer 3 is layer violation and even unnecessary
- The change makes codes of callers and IPsec a bit simple

Revision 1.155 / (download) - annotate - [select for diffs], Tue Jan 24 07:09:25 2017 UTC (7 years, 2 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20170204
Changes since 1.154: +8 -6 lines
Diff to previous 1.154 (colored) to selected 1.49 (colored)

Tweak softnet_lock and NET_MPSAFE

- Don't hold softnet_lock in some functions if NET_MPSAFE
- Add softnet_lock to sysctl_net_inet_icmp_redirtimeout
- Add softnet_lock to expire_upcalls of ip_mroute.c
- Restore softnet_lock for in{,6}_pcbpurgeif{,0} if NET_MPSAFE
- Mark some softnet_lock for future work

Revision 1.154 / (download) - annotate - [select for diffs], Tue Dec 13 08:29:03 2016 UTC (7 years, 3 months ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-localcount-20170107, bouyer-socketcan-base
Branch point for: bouyer-socketcan
Changes since 1.153: +2 -3 lines
Diff to previous 1.153 (colored) to selected 1.49 (colored)

Remove unnecessary inclusions of nd6.h

Revision 1.153 / (download) - annotate - [select for diffs], Fri Nov 18 06:50:04 2016 UTC (7 years, 4 months ago) by knakahara
Branch: MAIN
CVS Tags: nick-nhusb-base-20161204
Changes since 1.152: +7 -2 lines
Diff to previous 1.152 (colored) to selected 1.49 (colored)

fix: "ifconfig destory" can stalls when "ifconfig" is done parallel.
This problem occurs only if NET_MPSAFE on.

ifconfig destroy side:
    kernel entry point is ifioctl => if_clone_destroy.
    pr_purgeif() acquires softnet_lock, and then ifa_remove() calls
    pserialize_perform() holding softnet_lock.
ifconfig side:
    kernel entry point is socreate.
    pr_attach()(udp_attach_wrapper()) calls sosetlock(). In this call path,
    sosetlock() try to acquire softnet_lock.
These can cause dead lock.

Revision 1.152 / (download) - annotate - [select for diffs], Mon Oct 31 04:16:25 2016 UTC (7 years, 4 months ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-localcount-20161104
Changes since 1.151: +10 -17 lines
Diff to previous 1.151 (colored) to selected 1.49 (colored)

Fix race condition of in6_selectsrc

in6_selectsrc returned a pointer to in6_addr that wan't guaranteed to be
safe by pserialize (or psref), which was racy. Let callers pass a pointer
to in6_addr and in6_selectsrc copy a result to it inside pserialize
critical sections.

Revision 1.151 / (download) - annotate - [select for diffs], Thu Sep 29 12:19:47 2016 UTC (7 years, 5 months ago) by roy
Branch: MAIN
CVS Tags: nick-nhusb-base-20161004
Changes since 1.150: +3 -3 lines
Diff to previous 1.150 (colored) to selected 1.49 (colored)

Now that we disallow sending or receiving from invalid addresses,
allow binding to tentative addresses.

Revision 1.150 / (download) - annotate - [select for diffs], Fri Aug 26 19:53:07 2016 UTC (7 years, 7 months ago) by roy
Branch: MAIN
CVS Tags: localcount-20160914
Changes since 1.149: +3 -4 lines
Diff to previous 1.149 (colored) to selected 1.49 (colored)

Allow explicit binding to detached addresss.
Fixes PR kern/51435.

Revision 1.149 / (download) - annotate - [select for diffs], Mon Aug 1 03:15:31 2016 UTC (7 years, 7 months ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-localcount-20160806
Changes since 1.148: +19 -9 lines
Diff to previous 1.148 (colored) to selected 1.49 (colored)

Apply pserialize and psref to struct ifaddr and its variants

This change makes struct ifaddr and its variants (in_ifaddr and in6_ifaddr)
MP-safe by using pserialize and psref. At this moment, pserialize_perform
and psref_target_destroy are disabled because (1) we don't need them
because of softnet_lock (2) they cause a deadlock because of softnet_lock.
So we'll enable them when we remove softnet_lock in the future.

Revision 1.148 / (download) - annotate - [select for diffs], Fri Jul 15 07:40:09 2016 UTC (7 years, 8 months ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-localcount-20160726
Changes since 1.147: +6 -6 lines
Diff to previous 1.147 (colored) to selected 1.49 (colored)

Use sin6tosa and sin6tocsa macros

No functional change.

Revision 1.147 / (download) - annotate - [select for diffs], Fri Jul 15 07:33:41 2016 UTC (7 years, 8 months ago) by ozaki-r
Branch: MAIN
Changes since 1.146: +3 -3 lines
Diff to previous 1.146 (colored) to selected 1.49 (colored)

Use ifatoia6 macro

No functional change.

Revision 1.146 / (download) - annotate - [select for diffs], Tue Jun 21 10:25:27 2016 UTC (7 years, 9 months ago) by ozaki-r
Branch: MAIN
CVS Tags: pgoyette-localcount-base, nick-nhusb-base-20160907
Branch point for: pgoyette-localcount
Changes since 1.145: +14 -4 lines
Diff to previous 1.145 (colored) to selected 1.49 (colored)

Make sure returning ifp from in6_select* functions psref-ed

To this end, callers need to pass struct psref to the functions
and the fuctions acquire a reference of ifp with it. In some cases,
we can simply use if_get_byindex, however, in other cases
(say rt->rt_ifp and ia->ifa_ifp), we have no MP-safe way for now.
In order to take a reference anyway we use non MP-safe function
if_acquire_NOMPSAFE for the latter cases. They should be fixed in
the future somehow.

Revision 1.145 / (download) - annotate - [select for diffs], Thu Jun 16 02:38:40 2016 UTC (7 years, 9 months ago) by ozaki-r
Branch: MAIN
Changes since 1.144: +4 -6 lines
Diff to previous 1.144 (colored) to selected 1.49 (colored)

Use curlwp_bind and curlwp_bindx instead of open-coding LP_BOUND

Revision 1.144 / (download) - annotate - [select for diffs], Fri Jun 10 13:31:44 2016 UTC (7 years, 9 months ago) by ozaki-r
Branch: MAIN
Changes since 1.143: +27 -16 lines
Diff to previous 1.143 (colored) to selected 1.49 (colored)

Avoid storing a pointer of an interface in a mbuf

Having a pointer of an interface in a mbuf isn't safe if we remove big
kernel locks; an interface object (ifnet) can be destroyed anytime in any
packet processing and accessing such object via a pointer is racy. Instead
we have to get an object from the interface collection (ifindex2ifnet) via
an interface index (if_index) that is stored to a mbuf instead of an
pointer.

The change provides two APIs: m_{get,put}_rcvif_psref that use psref(9)
for sleep-able critical sections and m_{get,put}_rcvif that use
pserialize(9) for other critical sections. The change also adds another
API called m_get_rcvif_NOMPSAFE, that is NOT MP-safe and for transition
moratorium, i.e., it is intended to be used for places where are not
planned to be MP-ified soon.

The change adds some overhead due to psref to performance sensitive paths,
however the overhead is not serious, 2% down at worst.

Proposed on tech-kern and tech-net.

Revision 1.143 / (download) - annotate - [select for diffs], Thu May 12 02:24:17 2016 UTC (7 years, 10 months ago) by ozaki-r
Branch: MAIN
CVS Tags: nick-nhusb-base-20160529
Changes since 1.142: +4 -4 lines
Diff to previous 1.142 (colored) to selected 1.49 (colored)

Protect ifnet list with psz and psref

The change ensures that ifnet objects in the ifnet list aren't freed during
list iterations by using pserialize(9) and psref(9).

Note that the change adds a pslist(9) for ifnet but doesn't remove the
original ifnet list (ifnet_list) to avoid breaking kvm(3) users. We
shouldn't use the original list in the kernel anymore.

Revision 1.142 / (download) - annotate - [select for diffs], Tue Apr 26 08:44:45 2016 UTC (7 years, 11 months ago) by ozaki-r
Branch: MAIN
Changes since 1.141: +2 -3 lines
Diff to previous 1.141 (colored) to selected 1.49 (colored)

Sweep unnecessary route.h inclusions

Revision 1.141 / (download) - annotate - [select for diffs], Mon Aug 24 22:21:27 2015 UTC (8 years, 7 months ago) by pooka
Branch: MAIN
CVS Tags: nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226, nick-nhusb-base-20150921
Changes since 1.140: +4 -2 lines
Diff to previous 1.140 (colored) to selected 1.49 (colored)

sprinkle _KERNEL_OPT

Revision 1.140 / (download) - annotate - [select for diffs], Sat May 2 17:18:03 2015 UTC (8 years, 10 months ago) by rtr
Branch: MAIN
CVS Tags: nick-nhusb-base-20150606
Changes since 1.139: +6 -15 lines
Diff to previous 1.139 (colored) to selected 1.49 (colored)

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

final commit for parameter type changes to protocol user requests

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

Revision 1.139 / (download) - annotate - [select for diffs], Sun Apr 26 21:40:49 2015 UTC (8 years, 11 months ago) by rtr
Branch: MAIN
Changes since 1.138: +2 -32 lines
Diff to previous 1.138 (colored) to selected 1.49 (colored)

remove pr_generic from struct pr_usrreqs and all implementations of
pr_generic in protocols.

bump to 7.99.13

approved by rmind@

Revision 1.138 / (download) - annotate - [select for diffs], Fri Apr 24 22:32:37 2015 UTC (8 years, 11 months ago) by rtr
Branch: MAIN
Changes since 1.137: +7 -7 lines
Diff to previous 1.137 (colored) to selected 1.49 (colored)

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

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

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

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

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

Patch posted to tech-net@
  http://mail-index.netbsd.org/tech-net/2015/03/15/msg005004.html

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

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

Revision 1.136 / (download) - annotate - [select for diffs], Sat Aug 9 05:33:01 2014 UTC (9 years, 7 months ago) by rtr
Branch: MAIN
CVS Tags: tls-maxphys-base, tls-earlyentropy-base, nick-nhusb-base, netbsd-7-nhusb-base, netbsd-7-base, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE
Branch point for: nick-nhusb, netbsd-7-nhusb, netbsd-7-0, netbsd-7
Changes since 1.135: +31 -22 lines
Diff to previous 1.135 (colored) to selected 1.49 (colored)

split PRU_CONNECT2 & PRU_PURGEIF function out of pr_generic() usrreq
switches and put into separate functions

  - always KASSERT(solocked(so)) even if not implemented
    (for PRU_CONNECT2 only)

  - replace calls to pr_generic() with req = PRU_CONNECT2 with calls to
    pr_connect2()

  - replace calls to pr_generic() with req = PRU_PURGEIF with calls to
    pr_purgeif()

put common code from unp_connect2() (used by unp_connect() into
unp_connect1() and call out to it when needed

patch only briefly reviewed by rmind@

Revision 1.135 / (download) - annotate - [select for diffs], Fri Aug 8 03:05:45 2014 UTC (9 years, 7 months ago) by rtr
Branch: MAIN
Changes since 1.134: +13 -9 lines
Diff to previous 1.134 (colored) to selected 1.49 (colored)

split PRU_RCVD function out of pr_generic() usrreq switches and put into
separate functions

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

  - replace calls to pr_generic() with req = PRU_RCVD with calls to
    pr_rcvd()

Revision 1.134 / (download) - annotate - [select for diffs], Tue Aug 5 07:55:32 2014 UTC (9 years, 7 months ago) by rtr
Branch: MAIN
Changes since 1.133: +60 -44 lines
Diff to previous 1.133 (colored) to selected 1.49 (colored)

split PRU_SEND function out of pr_generic() usrreq switches and put into
separate functions

   xxx_send(struct socket *, struct mbuf *, struct mbuf *,
       struct mbuf *, struct lwp *)

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

  - replace calls to pr_generic() with req = PRU_SEND with calls to
    pr_send()

rename existing functions that operate on PCB for consistency (and to
free up their names for xxx_send() PRUs

  - l2cap_send() -> l2cap_send_pcb()
  - sco_send() -> sco_send_pcb()
  - rfcomm_send() -> rfcomm_send_pcb()

patch reviewed by rmind

Revision 1.133 / (download) - annotate - [select for diffs], Tue Aug 5 05:24:27 2014 UTC (9 years, 7 months ago) by rtr
Branch: MAIN
Changes since 1.132: +5 -5 lines
Diff to previous 1.132 (colored) to selected 1.49 (colored)

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

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

Revision 1.132 / (download) - annotate - [select for diffs], Thu Jul 31 03:39:35 2014 UTC (9 years, 8 months ago) by rtr
Branch: MAIN
Changes since 1.131: +49 -22 lines
Diff to previous 1.131 (colored) to selected 1.49 (colored)

split PRU_DISCONNECT, PRU_SHUTDOWN and PRU_ABORT function out of
pr_generic() usrreq switches and put into separate functions

   xxx_disconnect(struct socket *)
   xxx_shutdown(struct socket *)
   xxx_abort(struct socket *)

   - always KASSERT(solocked(so)) even if not implemented
   - replace calls to pr_generic() with req =
PRU_{DISCONNECT,SHUTDOWN,ABORT}
     with calls to pr_{disconnect,shutdown,abort}() respectively

rename existing internal functions used to implement above functionality
to permit use of the names for xxx_{disconnect,shutdown,abort}().

   - {l2cap,sco,rfcomm}_disconnect() ->
{l2cap,sco,rfcomm}_disconnect_pcb()
   - {unp,rip,tcp}_disconnect() -> {unp,rip,tcp}_disconnect1()
   - unp_shutdown() -> unp_shutdown1()

patch reviewed by rmind

Revision 1.131 / (download) - annotate - [select for diffs], Thu Jul 31 02:21:51 2014 UTC (9 years, 8 months ago) by ozaki-r
Branch: MAIN
Changes since 1.130: +4 -4 lines
Diff to previous 1.130 (colored) to selected 1.49 (colored)

Define IFNET_EMPTY() and replace !IFNET_FIRST() with it

No functional change.

Revision 1.130 / (download) - annotate - [select for diffs], Wed Jul 30 10:04:26 2014 UTC (9 years, 8 months ago) by rtr
Branch: MAIN
Changes since 1.129: +61 -55 lines
Diff to previous 1.129 (colored) to selected 1.49 (colored)

split PRU_CONNECT function out of pr_generic() usrreq switches and put
into seaparate functions

  xxx_listen(struct socket *, struct mbuf *)

  - always KASSERT(solocked(so)) and KASSERT(nam != NULL)
  - replace calls to pr_generic() with req = PRU_CONNECT with
    pr_connect()
  - rename existin {l2cap,sco,rfcomm}_connect() to
    {l2cap,sco,rfcomm}_connect_pcb() respectively to permit
    naming consistency with other protocols functions.
  - drop struct lwp * parameter from unp_connect() and at_pcbconnect()
    and use curlwp instead where appropriate.

patch reviewed by rmind

Revision 1.129 / (download) - annotate - [select for diffs], Thu Jul 24 15:12:03 2014 UTC (9 years, 8 months ago) by rtr
Branch: MAIN
Changes since 1.128: +54 -42 lines
Diff to previous 1.128 (colored) to selected 1.49 (colored)

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

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

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

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

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

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

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

patch reviewed by rmind

welcome to netbsd 6.99.48

Revision 1.128 / (download) - annotate - [select for diffs], Wed Jul 23 13:17:18 2014 UTC (9 years, 8 months ago) by rtr
Branch: MAIN
Changes since 1.127: +27 -4 lines
Diff to previous 1.127 (colored) to selected 1.49 (colored)

split PRU_SENDOOB and PRU_RCVOOB function out of pr_generic() usrreq
switches and put into separate functions
  xxx_sendoob(struct socket *, struct mbuf *, struct mbuf *)
  xxx_recvoob(struct socket *, struct mbuf *, int)

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

  - replace calls to pr_generic() with req = PRU_{SEND,RCV}OOB with
    calls to pr_{send,recv}oob() respectively.

there is still some tweaking of m_freem(m) and m_freem(control) to come
for consistency.  not performed with this commit for clarity.

reviewed by rmind

Revision 1.127 / (download) - annotate - [select for diffs], Wed Jul 9 14:41:42 2014 UTC (9 years, 8 months ago) by rtr
Branch: MAIN
Changes since 1.126: +13 -3 lines
Diff to previous 1.126 (colored) to selected 1.49 (colored)

* split PRU_ACCEPT function out of pr_generic() usrreq switches and put
  into a separate function xxx_accept(struct socket *, struct mbuf *)

note: future cleanup will take place to remove struct mbuf parameter
type and replace it with a more appropriate type.

patch reviewed by rmind

Revision 1.126 / (download) - annotate - [select for diffs], Wed Jul 9 04:54:04 2014 UTC (9 years, 8 months ago) by rtr
Branch: MAIN
Changes since 1.125: +30 -10 lines
Diff to previous 1.125 (colored) to selected 1.49 (colored)

* split PRU_PEERADDR and PRU_SOCKADDR function out of pr_generic()
  usrreq switches and put into separate functions
  xxx_{peer,sock}addr(struct socket *, struct mbuf *).

    - KASSERT(solocked(so)) always in new functions even if request
      is not implemented

    - KASSERT(pcb != NULL) and KASSERT(nam) if the request is
      implemented and not for tcp.

* for tcp roll #ifdef KPROF and #ifdef DEBUG code from tcp_usrreq() into
  easier to cut & paste functions tcp_debug_capture() and
tcp_debug_trace()

    - functions provided by rmind
    - remaining use of PRU_{PEER,SOCK}ADDR #define to be removed in a
      future commit.

* rename netbt functions to permit consistency of pru function names
  (as has been done with other requests already split out).

    - l2cap_{peer,sock}addr()  -> l2cap_{peer,sock}_addr_pcb()
    - rfcomm_{peer,sock}addr() -> rfcomm_{peer,sock}_addr_pcb()
    - sco_{peer,sock}addr()    -> sco_{peer,sock}_addr_pcb()

* split/refactor do_sys_getsockname(lwp, fd, which, nam) into
  two functions do_sys_get{peer,sock}name(fd, nam).

    - move PRU_PEERADDR handling into do_sys_getpeername() from
      do_sys_getsockname()
    - have svr4_stream directly call do_sys_get{sock,peer}name()
      respectively instead of providing `which' & fix a DPRINTF string
      that incorrectly wrote "getpeername" when it meant "getsockname"
    - fix sys_getpeername() and sys_getsockname() to call
      do_sys_get{sock,peer}name() without `which' and `lwp' & adjust
      comments
    - bump kernel version for removal of lwp & which parameters from
      do_sys_getsockname()

note: future cleanup to remove struct mbuf * abuse in
xxx_{peer,sock}name()
still to come, not done in this commit since it is easier to do post
split.

patch reviewed by rmind

welcome to 6.99.47

Revision 1.125 / (download) - annotate - [select for diffs], Mon Jul 7 17:13:56 2014 UTC (9 years, 8 months ago) by rtr
Branch: MAIN
Changes since 1.124: +4 -2 lines
Diff to previous 1.124 (colored) to selected 1.49 (colored)

* sprinkle KASSERT(solocked(so)); in all pr_stat() functions.
* fix remaining inconsistent struct socket parameter names.

Revision 1.124 / (download) - annotate - [select for diffs], Mon Jul 7 15:13:21 2014 UTC (9 years, 8 months ago) by rtr
Branch: MAIN
Changes since 1.123: +4 -3 lines
Diff to previous 1.123 (colored) to selected 1.49 (colored)

backout change that made pr_stat return EOPNOTSUPP for protocols that
were not filling in struct stat.

decision made after further discussion with rmind and investigation of
how other operating systems behave.  soo_stat() is doing just enough to
be able to call what gets returned valid and thus justifys a return of
success.

additional review will be done to determine of the pr_stat functions
that were already returning EOPNOTSUPP can be considered successful with
what soo_stat() is doing.

Revision 1.123 / (download) - annotate - [select for diffs], Mon Jul 7 07:09:59 2014 UTC (9 years, 8 months ago) by rtr
Branch: MAIN
Changes since 1.122: +3 -4 lines
Diff to previous 1.122 (colored) to selected 1.49 (colored)

* have pr_stat return EOPNOTSUPP consistently for all protocols that do
  not fill in struct stat instead of returning success.

* in pr_stat remove all checks for non-NULL so->so_pcb except where the
  pcb is actually used (i.e. cases where we don't return EOPNOTSUPP).

proposed on tech-net@

Revision 1.122 / (download) - annotate - [select for diffs], Sun Jul 6 03:33:33 2014 UTC (9 years, 8 months ago) by rtr
Branch: MAIN
Changes since 1.121: +12 -7 lines
Diff to previous 1.121 (colored) to selected 1.49 (colored)

* split PRU_SENSE functionality out of xxx_usrreq() switches and place into
  separate xxx_stat(struct socket *, struct stat *) functions.
* replace calls using pr_generic with req == PRU_SENSE with pr_stat().

further change will follow that cleans up the pattern used to extract the
pcb and test for its presence.

reviewed by rmind

Revision 1.121 / (download) - annotate - [select for diffs], Tue Jul 1 05:49:19 2014 UTC (9 years, 8 months ago) by rtr
Branch: MAIN
Changes since 1.120: +4 -6 lines
Diff to previous 1.120 (colored) to selected 1.49 (colored)

fix parameter types in pr_ioctl, called xx_control() functions and remove
abuse of pointer to struct mbuf type.

param2 changed to u_long type and uses parameter name 'cmd' (ioctl command)
param3 changed to void * type and uses parameter name 'data'
param4 changed to struct ifnet * and uses parameter name 'ifp'
param5 has been removed (formerly struct lwp *) and uses of 'l' have been
       replaced with curlwp from curproc(9).

callers have had (now unnecessary) casts to struct mbuf * removed, called
code has had (now unnecessary) casts to u_long, void * and struct ifnet *
respectively removed.

reviewed by rmind@

Revision 1.120 / (download) - annotate - [select for diffs], Mon Jun 23 17:18:45 2014 UTC (9 years, 9 months ago) by rtr
Branch: MAIN
Changes since 1.119: +4 -4 lines
Diff to previous 1.119 (colored) to selected 1.49 (colored)

where appropriate rename xxx_ioctl() struct mbuf * parameters from
`control' to `ifp' after split from xxx_usrreq().

sys_socket.c
    fix wrapping of arguments to be consistent with other function calls
    in the file after replacing pr_usrreq() call with pr_ioctl() which
    required one less argument.

link_proto.c
    fix indentation of parameters in link_ioctl() prototype to be
    consistent with the rest of the file.

discussed with rmind@

Revision 1.119 / (download) - annotate - [select for diffs], Sun Jun 22 08:10:19 2014 UTC (9 years, 9 months ago) by rtr
Branch: MAIN
Changes since 1.118: +13 -5 lines
Diff to previous 1.118 (colored) to selected 1.49 (colored)

* split PRU_CONTROL functionality out of xxx_userreq() switches and place
  into separate xxx_ioctl() functions.
* place KASSERT(req != PRU_CONTROL) inside xxx_userreq() as it is now
  inappropriate for req = PRU_CONTROL in xxx_userreq().
* replace calls to pr_generic() with req = PRU_CONTROL with pr_ioctl().
* remove & fixup references to PRU_CONTROL xxx_userreq() function comments.
* fix various comments references for xxx_userreq() that mentioned
  PRU_CONTROL as xxx_userreq() no longer handles the request.

a further change will follow to fix parameter and naming inconsistencies
retained from original code.

Reviewed by rmind@

Revision 1.118 / (download) - annotate - [select for diffs], Fri May 30 01:39:03 2014 UTC (9 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.117: +4 -4 lines
Diff to previous 1.117 (colored) to selected 1.49 (colored)

Introduce 2 new variables: ipsec_enabled and ipsec_used.
Ipsec enabled is controlled by sysctl and determines if is allowed.
ipsec_used is set automatically based on ipsec being enabled, and
rules existing.

Revision 1.117 / (download) - annotate - [select for diffs], Tue May 20 19:04:00 2014 UTC (9 years, 10 months ago) by rmind
Branch: MAIN
Changes since 1.116: +5 -4 lines
Diff to previous 1.116 (colored) to selected 1.49 (colored)

Adjust PR_WRAP_USRREQS() to include the attach/detach functions.
We still need the kernel-lock for some corner cases.

Revision 1.116 / (download) - annotate - [select for diffs], Mon May 19 02:51:25 2014 UTC (9 years, 10 months ago) by rmind
Branch: MAIN
Changes since 1.115: +67 -54 lines
Diff to previous 1.115 (colored) to selected 1.49 (colored)

- Split off PRU_ATTACH and PRU_DETACH logic into separate functions.
- Replace malloc with kmem and eliminate M_PCB while here.
- Sprinkle more asserts.

Revision 1.115 / (download) - annotate - [select for diffs], Sun May 18 14:46:16 2014 UTC (9 years, 10 months ago) by rmind
Branch: MAIN
CVS Tags: rmind-smpnet-nbase, rmind-smpnet-base
Changes since 1.114: +10 -2 lines
Diff to previous 1.114 (colored) to selected 1.49 (colored)

Add struct pr_usrreqs with a pr_generic function and prepare for the
dismantling of pr_usrreq in the protocols; no functional change intended.
PRU_ATTACH/PRU_DETACH changes will follow soon.

Bump for struct protosw.  Welcome to 6.99.62!

Revision 1.114 / (download) - annotate - [select for diffs], Sun May 18 00:10:11 2014 UTC (9 years, 10 months ago) by rmind
Branch: MAIN
Changes since 1.113: +4 -4 lines
Diff to previous 1.113 (colored) to selected 1.49 (colored)

Use IFNET_FIRST() rather than open coding ifnet access.

Revision 1.113 / (download) - annotate - [select for diffs], Tue Feb 25 18:30:12 2014 UTC (10 years, 1 month ago) by pooka
Branch: MAIN
CVS Tags: yamt-pagecache-base9, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3
Branch point for: tls-earlyentropy
Changes since 1.112: +2 -7 lines
Diff to previous 1.112 (colored) to selected 1.49 (colored)

Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.

Revision 1.112 / (download) - annotate - [select for diffs], Sat Nov 23 14:20:22 2013 UTC (10 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.111: +3 -3 lines
Diff to previous 1.111 (colored) to selected 1.49 (colored)

convert from CIRCLEQ to TAILQ.

Revision 1.111 / (download) - annotate - [select for diffs], Wed Jun 5 19:01:26 2013 UTC (10 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Branch point for: rmind-smpnet
Changes since 1.110: +7 -7 lines
Diff to previous 1.110 (colored) to selected 1.49 (colored)

IPSEC has not come in two speeds for a long time now (IPSEC == kame,
FAST_IPSEC). Make everything refer to IPSEC to avoid confusion.

Revision 1.110 / (download) - annotate - [select for diffs], Thu Mar 22 20:34:41 2012 UTC (12 years ago) by drochner
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, khorben-n900, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base10, agc-symver-base, agc-symver
Branch point for: tls-maxphys
Changes since 1.109: +2 -27 lines
Diff to previous 1.109 (colored) to selected 1.49 (colored)

remove KAME IPSEC, replaced by FAST_IPSEC

Revision 1.109 / (download) - annotate - [select for diffs], Mon Dec 19 11:59:58 2011 UTC (12 years, 3 months 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-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, 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
Branch point for: netbsd-6-1, netbsd-6-0, netbsd-6
Changes since 1.108: +8 -8 lines
Diff to previous 1.108 (colored) to selected 1.49 (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.108 / (download) - annotate - [select for diffs], Tue May 3 18:28:45 2011 UTC (12 years, 10 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, rmind-uvmplock-nbase, rmind-uvmplock-base, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base, jmcneill-audiomp3-base, jmcneill-audiomp3, cherry-xenmp-base, cherry-xenmp
Branch point for: yamt-pagecache, jmcneill-usbmp
Changes since 1.107: +6 -4 lines
Diff to previous 1.107 (colored) to selected 1.49 (colored)

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

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

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

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

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

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

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

Revision 1.107 / (download) - annotate - [select for diffs], Thu Jul 8 01:22:28 2010 UTC (13 years, 8 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, matt-mips64-premerge-20101231, jruoho-x86intr-base, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: jruoho-x86intr
Changes since 1.106: +4 -4 lines
Diff to previous 1.106 (colored) to selected 1.49 (colored)

Remove unnecessary casts from struct route * to struct route *.

Revision 1.106 / (download) - annotate - [select for diffs], Thu Jul 8 01:13:01 2010 UTC (13 years, 8 months ago) by dyoung
Branch: MAIN
Changes since 1.105: +4 -4 lines
Diff to previous 1.105 (colored) to selected 1.49 (colored)

Sprinkle const to prevent rip6_output() from re-assigning all but one of
its arguments.

Revision 1.105 / (download) - annotate - [select for diffs], Wed Sep 16 15:23:05 2009 UTC (14 years, 6 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9, uebayasi-xip-base1, uebayasi-xip-base, matt-premerge-20091211, jym-xensuspend-nbase
Branch point for: uebayasi-xip, rmind-uvmplock
Changes since 1.104: +7 -3 lines
Diff to previous 1.104 (colored) to selected 1.49 (colored)

Replace a large number of link set based sysctl node creations with
calls from subsystem constructors.  Benefits both future kernel
modules and rump.

no change to sysctl nodes on i386/MONOLITHIC & build tested i386/ALL

Revision 1.104 / (download) - annotate - [select for diffs], Wed May 6 21:41:59 2009 UTC (14 years, 10 months ago) by elad
Branch: MAIN
CVS Tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7, yamt-nfs-mp-base6, yamt-nfs-mp-base5, yamt-nfs-mp-base4, jymxensuspend-base, jym-xensuspend-base
Changes since 1.103: +7 -17 lines
Diff to previous 1.103 (colored) to selected 1.49 (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.103 / (download) - annotate - [select for diffs], Sun Mar 15 21:26:09 2009 UTC (15 years ago) by cegger
Branch: MAIN
CVS Tags: yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base
Changes since 1.102: +3 -3 lines
Diff to previous 1.102 (colored) to selected 1.49 (colored)

ansify function definitions

Revision 1.102 / (download) - annotate - [select for diffs], Sat Jan 3 03:43:23 2009 UTC (15 years, 2 months ago) by yamt
Branch: MAIN
CVS Tags: nick-hppapmap-base2, mjf-devfs2-base
Branch point for: jym-xensuspend
Changes since 1.101: +5 -5 lines
Diff to previous 1.101 (colored) to selected 1.49 (colored)

remove extra semicolons.

Revision 1.101 / (download) - annotate - [select for diffs], Wed Dec 17 20:51:37 2008 UTC (15 years, 3 months ago) by cegger
Branch: MAIN
Changes since 1.100: +5 -5 lines
Diff to previous 1.100 (colored) to selected 1.49 (colored)

kill MALLOC and FREE macros.

Revision 1.100 / (download) - annotate - [select for diffs], Wed Aug 6 15:01:23 2008 UTC (15 years, 7 months ago) by plunky
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2, haad-nbase2, haad-dm-base2, haad-dm-base1, haad-dm-base, ad-audiomp2-base, ad-audiomp2
Branch point for: nick-hppapmap
Changes since 1.99: +25 -22 lines
Diff to previous 1.99 (colored) to selected 1.49 (colored)

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

approved by core

Revision 1.99 / (download) - annotate - [select for diffs], Sun May 4 07:22:15 2008 UTC (15 years, 10 months ago) by thorpej
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.98: +3 -8 lines
Diff to previous 1.98 (colored) to selected 1.49 (colored)

Simplify the interface to netstat_sysctl() and allocate space for
the collated counters using kmem_alloc().

PR kern/38577

Revision 1.98 / (download) - annotate - [select for diffs], Thu Apr 24 11:38:38 2008 UTC (15 years, 11 months ago) by ad
Branch: MAIN
CVS Tags: yamt-nfs-mp-base
Branch point for: yamt-nfs-mp
Changes since 1.97: +10 -6 lines
Diff to previous 1.97 (colored) to selected 1.49 (colored)

Merge the socket locking patch:

- Socket layer becomes MP safe.
- Unix protocols become MP safe.
- Allows protocol processing interrupts to safely block on locks.
- Fixes a number of race conditions.

With much feedback from matt@ and plunky@.

Revision 1.97 / (download) - annotate - [select for diffs], Wed Apr 23 06:09:05 2008 UTC (15 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.96: +15 -38 lines
Diff to previous 1.96 (colored) to selected 1.49 (colored)

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

Revision 1.96 / (download) - annotate - [select for diffs], Tue Apr 15 05:23:33 2008 UTC (15 years, 11 months ago) by thorpej
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base
Branch point for: yamt-pf42
Changes since 1.95: +3 -2 lines
Diff to previous 1.95 (colored) to selected 1.49 (colored)

Explicitly include <sys/percpu.h>.

Revision 1.95 / (download) - annotate - [select for diffs], Tue Apr 15 05:13:37 2008 UTC (15 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.94: +53 -12 lines
Diff to previous 1.94 (colored) to selected 1.49 (colored)

Make raw6 stats per-cpu.

Revision 1.94 / (download) - annotate - [select for diffs], Tue Apr 15 03:57:04 2008 UTC (15 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.93: +8 -6 lines
Diff to previous 1.93 (colored) to selected 1.49 (colored)

Make ip6 and icmp6 stats per-cpu.

Revision 1.93 / (download) - annotate - [select for diffs], Tue Apr 8 23:37:43 2008 UTC (15 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.92: +5 -5 lines
Diff to previous 1.92 (colored) to selected 1.49 (colored)

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

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

Revision 1.92 / (download) - annotate - [select for diffs], Tue Apr 8 15:04:35 2008 UTC (15 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.91: +3 -3 lines
Diff to previous 1.91 (colored) to selected 1.49 (colored)

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

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

Revision 1.91 / (download) - annotate - [select for diffs], Tue Nov 27 22:45:30 2007 UTC (16 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: yamt-lazymbuf-base15, yamt-lazymbuf-base14, yamt-kmem-base3, yamt-kmem-base2, yamt-kmem-base, yamt-kmem, vmlocking2-base3, vmlocking2-base2, vmlocking2-base1, vmlocking2, vmlocking-nbase, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, matt-armv6-nbase, matt-armv6-base, keiichi-mipv6-nbase, keiichi-mipv6-base, jmcneill-pm-base, hpcarm-cleanup-base, cube-autoconf-base, cube-autoconf, bouyer-xeni386-nbase, bouyer-xeni386-merge1, bouyer-xeni386-base, bouyer-xeni386, ad-socklock-base1
Branch point for: mjf-devfs2, keiichi-mipv6
Changes since 1.90: +3 -3 lines
Diff to previous 1.90 (colored) to selected 1.49 (colored)

require that the options argument is the right size, not that it is greater
or equal to the requested size. Suggested by Matt Thomas.

Revision 1.90 / (download) - annotate - [select for diffs], Tue Nov 6 23:50:41 2007 UTC (16 years, 4 months ago) by dyoung
Branch: MAIN
CVS Tags: bouyer-xenamd64-base2, bouyer-xenamd64-base
Changes since 1.89: +3 -5 lines
Diff to previous 1.89 (colored) to selected 1.49 (colored)

Delete dead code that I accidentally introduced before.  Thanks
Arnaud Lacombe for pointing out to me Coverity CID 4562.

Revision 1.89 / (download) - annotate - [select for diffs], Tue Nov 6 23:40:38 2007 UTC (16 years, 4 months ago) by dyoung
Branch: MAIN
Changes since 1.88: +4 -11 lines
Diff to previous 1.88 (colored) to selected 1.49 (colored)

Use sockaddr_in6_init().

Revision 1.88 / (download) - annotate - [select for diffs], Thu Nov 1 20:33:58 2007 UTC (16 years, 4 months ago) by dyoung
Branch: MAIN
CVS Tags: jmcneill-base
Branch point for: mjf-devfs
Changes since 1.87: +3 -3 lines
Diff to previous 1.87 (colored) to selected 1.49 (colored)

De-__P().

Revision 1.87 / (download) - annotate - [select for diffs], Wed Sep 19 04:33:44 2007 UTC (16 years, 6 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-x86pmap-base4, yamt-x86pmap-base3, yamt-x86pmap-base2, yamt-x86pmap-base, yamt-x86pmap, vmlocking-base
Branch point for: bouyer-xenamd64
Changes since 1.86: +38 -36 lines
Diff to previous 1.86 (colored) to selected 1.49 (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.86 / (download) - annotate - [select for diffs], Thu Jul 19 20:48:58 2007 UTC (16 years, 8 months ago) by dyoung
Branch: MAIN
CVS Tags: nick-csl-alignment-base5, matt-mips64-base, hpcarm-cleanup
Branch point for: matt-mips64, matt-armv6, jmcneill-pm
Changes since 1.85: +4 -21 lines
Diff to previous 1.85 (colored) to selected 1.49 (colored)

Take steps to hide the radix_node implementation of the forwarding table
from the forwarding table's users:

        Introduce rt_walktree() for walking the routing table and
        applying a function to each rtentry.  Replace most
        rn_walktree() calls with it.

        Use rt_getkey()/rt_setkey() to get/set a route's destination.
        Keep a pointer to the sockaddr key in the rtentry, so that
        rtentry users do not have to grovel in the radix_node for
        the key.

        Add a RTM_GET method to rtrequest.  Use that instead of
        radix_node lookups in, e.g., carp(4).

Add sys/net/link_proto.c, which supplies sockaddr routines for
link-layer socket addresses (sockaddr_dl).

Cosmetic:

        Constify.  KNF.  Stop open-coding LIST_FOREACH, TAILQ_FOREACH,
        et cetera.  Use NULL instead of 0 for null pointers.  Use
        __arraycount().  Reduce gratuitous parenthesization.

        Stop using variadic arguments for rip6_output(), it is
        unnecessary.

        Remove the unnecessary rtentry member rt_genmask and the
        code to maintain it, since nothing actually used it.

        Make rt_maskedcopy() easier to read by using meaningful variable
        names.

        Extract a subroutine intern_netmask() for looking up a netmask in
        the masks table.

        Start converting backslash-ridden IPv6 macros in
        sys/netinet6/in6_var.h into inline subroutines that one
        can read without special eyeglasses.

One functional change: when the kernel serves an RTM_GET, RTM_LOCK,
or RTM_CHANGE request, it applies the netmask (if supplied) to a
destination before searching for it in the forwarding table.

I have changed sys/netinet/ip_carp.c, carp_setroute(), to remove
the unlawful radix_node knowledge.

Apart from the changes to carp(4), netiso, ATM, and strip(4), I
have run the changes on three nodes in my wireless routing testbed,
which involves IPv4 + IPv6 dynamic routing acrobatics, and it's
working beautifully so far.

Revision 1.85 / (download) - annotate - [select for diffs], Wed May 23 17:15:04 2007 UTC (16 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: nick-csl-alignment-base, mjf-ufs-trans-base
Branch point for: nick-csl-alignment
Changes since 1.84: +5 -10 lines
Diff to previous 1.84 (colored) to selected 1.49 (colored)

Ansify + add a few comments, from Karl Sjödahl

Revision 1.84 / (download) - annotate - [select for diffs], Sun Mar 4 06:03:28 2007 UTC (17 years ago) by christos
Branch: MAIN
CVS Tags: yamt-idlelwp-base8, thorpej-atomic-base, thorpej-atomic, reinoud-bufcleanup
Branch point for: vmlocking, mjf-ufs-trans
Changes since 1.83: +5 -5 lines
Diff to previous 1.83 (colored) to selected 1.49 (colored)

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

Revision 1.83 / (download) - annotate - [select for diffs], Thu Feb 22 09:30:33 2007 UTC (17 years, 1 month ago) by dyoung
Branch: MAIN
CVS Tags: ad-audiomp-base, ad-audiomp
Changes since 1.82: +19 -19 lines
Diff to previous 1.82 (colored) to selected 1.49 (colored)

Cosmetic: remove extraneous () on return statements, break a line
in two, join lines, compare pointers with NULL instead of testing
their "truth."

Revision 1.82 / (download) - annotate - [select for diffs], Sat Feb 17 22:34:15 2007 UTC (17 years, 1 month ago) by dyoung
Branch: MAIN
Changes since 1.81: +9 -14 lines
Diff to previous 1.81 (colored) to selected 1.49 (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.81 / (download) - annotate - [select for diffs], Sat Feb 10 09:43:05 2007 UTC (17 years, 1 month ago) by degroote
Branch: MAIN
Branch point for: yamt-idlelwp
Changes since 1.80: +28 -2 lines
Diff to previous 1.80 (colored) to selected 1.49 (colored)

Commit my SoC work
Add ipv6 support for fast_ipsec
Note that currently, packet with extensions headers are not correctly
supported
Change the ipcomp logic

Revision 1.80 / (download) - annotate - [select for diffs], Thu Jan 4 19:07:04 2007 UTC (17 years, 2 months ago) by elad
Branch: MAIN
CVS Tags: post-newlock2-merge, newlock2-nbase, newlock2-base
Changes since 1.79: +4 -4 lines
Diff to previous 1.79 (colored) to selected 1.49 (colored)

Consistent usage of KAUTH_GENERIC_ISSUSER.

Revision 1.79 / (download) - annotate - [select for diffs], Sat Dec 2 18:59:17 2006 UTC (17 years, 3 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3
Changes since 1.78: +4 -5 lines
Diff to previous 1.78 (colored) to selected 1.49 (colored)

Use the queue(3) macros instead of open-coding them.  Shorten
staircases.  Remove unnecessary casts.  Where appropriate, s/8/NBBY/.
De-__P().  KNF.

No functional changes intended.

Revision 1.78 / (download) - annotate - [select for diffs], Sun Jul 23 22:06:13 2006 UTC (17 years, 8 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, netbsd-4-base, abandoned-netbsd-4-base, abandoned-netbsd-4
Branch point for: yamt-splraiseipl, wrstuden-fixsa, newlock2, netbsd-4
Changes since 1.77: +7 -9 lines
Diff to previous 1.77 (colored) to selected 1.49 (colored)

Use the LWP cached credentials where sane.

Revision 1.77 / (download) - annotate - [select for diffs], Sun May 14 21:19:34 2006 UTC (17 years, 10 months ago) by elad
Branch: MAIN
CVS Tags: yamt-pdpolicy-base6, yamt-pdpolicy-base5, simonb-timecounters-base, gdamore-uart-base, gdamore-uart, chap-midi-nbase, chap-midi-base, chap-midi
Changes since 1.76: +7 -4 lines
Diff to previous 1.76 (colored) to selected 1.49 (colored)

integrate kauth.

Revision 1.76 / (download) - annotate - [select for diffs], Fri May 5 00:03:22 2006 UTC (17 years, 10 months ago) by rpaulo
Branch: MAIN
CVS Tags: elad-kernelauth-base
Changes since 1.75: +14 -16 lines
Diff to previous 1.75 (colored) to selected 1.49 (colored)

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

From the KAME project (www.kame.net).
Reviewed by core.

Revision 1.75 / (download) - annotate - [select for diffs], Sat Jan 21 00:15:37 2006 UTC (18 years, 2 months ago) by rpaulo
Branch: MAIN
CVS Tags: yamt-uio_vmspace-base5, yamt-pdpolicy-base4, yamt-pdpolicy-base3, yamt-pdpolicy-base2, yamt-pdpolicy-base, peter-altq-base
Branch point for: yamt-pdpolicy, simonb-timecounters, rpaulo-netinet-merge-pcb, peter-altq, elad-kernelauth
Changes since 1.74: +68 -67 lines
Diff to previous 1.74 (colored) to selected 1.49 (colored)

Better support of IPv6 scoped addresses.

- most of the kernel code will not care about the actual encoding of
  scope zone IDs and won't touch "s6_addr16[1]" directly.
- similarly, most of the kernel code will not care about link-local
  scoped addresses as a special case.
- scope boundary check will be stricter.  For example, the current
  *BSD code allows a packet with src=::1 and dst=(some global IPv6
  address) to be sent outside of the node, if the application do:
    s = socket(AF_INET6);
    bind(s, "::1");
    sendto(s, some_global_IPv6_addr);
  This is clearly wrong, since ::1 is only meaningful within a single
  node, but the current implementation of the *BSD kernel cannot
  reject this attempt.
- and, while there, don't try to remove the ff02::/32 interface route
  entry in in6_ifdetach() as it's already gone.

This also includes some level of support for the standard source
address selection algorithm defined in RFC3484, which will be
completed on in the future.

From the KAME project via JINMEI Tatuya.
Approved by core@.

Revision 1.74 / (download) - annotate - [select for diffs], Sun Dec 11 12:25:02 2005 UTC (18 years, 3 months ago) by christos
Branch: MAIN
Branch point for: yamt-uio_vmspace
Changes since 1.73: +6 -4 lines
Diff to previous 1.73 (colored) to selected 1.49 (colored)

merge ktrace-lwp.

Revision 1.73 / (download) - annotate - [select for diffs], Sun Aug 28 21:04:09 2005 UTC (18 years, 7 months ago) by rpaulo
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.72: +9 -2 lines
Diff to previous 1.72 (colored) to selected 1.49 (colored)

Implement net.inet6.raw6.stats sysctl.

Reviewed by Elad Efrat.

Revision 1.72 / (download) - annotate - [select for diffs], Sun May 29 21:43:51 2005 UTC (18 years, 10 months ago) by christos
Branch: MAIN
Branch point for: yamt-lazymbuf
Changes since 1.71: +4 -4 lines
Diff to previous 1.71 (colored) to selected 1.49 (colored)

- avoid shadowed variables
- sprinkle const.

Revision 1.71 / (download) - annotate - [select for diffs], Fri Mar 11 06:16:16 2005 UTC (19 years ago) by atatat
Branch: MAIN
CVS Tags: yamt-km-base4, yamt-km-base3, netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3, kent-audio2-base
Changes since 1.70: +3 -3 lines
Diff to previous 1.70 (colored) to selected 1.49 (colored)

Revert the change that made kern.file2 and net.*.*.pcblist into nodes
instead of structs.  It had other deleterious side-effects that are
rather nasty.  Another solution must be found.

Revision 1.70 / (download) - annotate - [select for diffs], Thu Mar 10 05:43:28 2005 UTC (19 years ago) by atatat
Branch: MAIN
Changes since 1.69: +3 -3 lines
Diff to previous 1.69 (colored) to selected 1.49 (colored)

Change types of kern.file2 and net.*.*.pcblist to NODE

Revision 1.69 / (download) - annotate - [select for diffs], Wed Mar 9 05:07:19 2005 UTC (19 years ago) by atatat
Branch: MAIN
Changes since 1.68: +32 -2 lines
Diff to previous 1.68 (colored) to selected 1.49 (colored)

Add the following nodes to the sysctl tree:

	net.local.stream.pcblist
	net.local.dgram.pcblist
	net.inet.tcp.pcblist
	net.inet.udp.pcblist
	net.inet.raw.pcblist
	net.inet6.tcp6.pcblist
	net.inet6.udp6.pcblist
	net.inet6.raw6.pcblist

which allow retrieval of the pcbs in use for those protocols.  The
struct involved is 32/64 bit clean and incorporates parts of struct
inpcb, struct unpcb, a bit of struct tcpcb, and two socket addresses.

Revision 1.68 / (download) - annotate - [select for diffs], Mon Sep 6 10:05:14 2004 UTC (19 years, 6 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-km-base2, yamt-km-base, kent-audio1-beforemerge, kent-audio1-base, kent-audio1
Branch point for: yamt-km, kent-audio2
Changes since 1.67: +12 -11 lines
Diff to previous 1.67 (colored) to selected 1.49 (colored)

rip6_output: redo raw_ip6.c 1.67-1.67, using m_copyback_cow.

Revision 1.67 / (download) - annotate - [select for diffs], Fri Jul 23 09:53:10 2004 UTC (19 years, 8 months ago) by yamt
Branch: MAIN
Changes since 1.66: +6 -4 lines
Diff to previous 1.66 (colored) to selected 1.49 (colored)

rip6_output: redo the previous (raw_ip6.c 1.66)
with less assumptions about alignment.

Revision 1.66 / (download) - annotate - [select for diffs], Thu Jul 22 05:26:46 2004 UTC (19 years, 8 months ago) by yamt
Branch: MAIN
Changes since 1.65: +14 -7 lines
Diff to previous 1.65 (colored) to selected 1.49 (colored)

rip6_output: make sure that the mbuf is writable
before write a checksum into it.
otherwise "ping6 -s50000" causes a panic.

ok'ed by itojun.

Revision 1.65 / (download) - annotate - [select for diffs], Fri Jun 11 04:10:10 2004 UTC (19 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.64: +2 -4 lines
Diff to previous 1.64 (colored) to selected 1.49 (colored)

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

Revision 1.64 / (download) - annotate - [select for diffs], Thu Apr 22 17:58:59 2004 UTC (19 years, 11 months ago) by itojun
Branch: MAIN
Changes since 1.63: +3 -3 lines
Diff to previous 1.63 (colored) to selected 1.49 (colored)

correct parameter to in6_cksum.  keiichi@kame

Revision 1.63 / (download) - annotate - [select for diffs], Thu Oct 30 01:43:10 2003 UTC (20 years, 5 months ago) by simonb
Branch: MAIN
CVS Tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Changes since 1.62: +2 -7 lines
Diff to previous 1.62 (colored) to selected 1.49 (colored)

Remove some assigned-to but otherwise unused variables.

Revision 1.62 / (download) - annotate - [select for diffs], Sat Oct 25 08:26:14 2003 UTC (20 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.61: +5 -2 lines
Diff to previous 1.61 (colored) to selected 1.49 (colored)

fix uninitialized variables

Revision 1.61 / (download) - annotate - [select for diffs], Sat Sep 6 03:12:54 2003 UTC (20 years, 6 months ago) by itojun
Branch: MAIN
Changes since 1.60: +2 -5 lines
Diff to previous 1.60 (colored) to selected 1.49 (colored)

clarify flowlabel handling

Revision 1.60 / (download) - annotate - [select for diffs], Fri Sep 5 23:20:49 2003 UTC (20 years, 6 months ago) by itojun
Branch: MAIN
Changes since 1.59: +3 -3 lines
Diff to previous 1.59 (colored) to selected 1.49 (colored)

u_short -> u_int16_t.  sync w/ kame.
don't set ip6_plen where unneeded (i.e. before calling ip6_output)

Revision 1.59 / (download) - annotate - [select for diffs], Thu Sep 4 09:17:08 2003 UTC (20 years, 6 months ago) by itojun
Branch: MAIN
Changes since 1.58: +16 -13 lines
Diff to previous 1.58 (colored) to selected 1.49 (colored)

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

Revision 1.58 / (download) - annotate - [select for diffs], Fri Aug 22 22:00:41 2003 UTC (20 years, 7 months ago) by itojun
Branch: MAIN
Changes since 1.57: +2 -9 lines
Diff to previous 1.57 (colored) to selected 1.49 (colored)

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

Revision 1.57 / (download) - annotate - [select for diffs], Fri Aug 22 21:53:10 2003 UTC (20 years, 7 months ago) by itojun
Branch: MAIN
Changes since 1.56: +3 -3 lines
Diff to previous 1.56 (colored) to selected 1.49 (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.56 / (download) - annotate - [select for diffs], Fri Aug 22 20:20:10 2003 UTC (20 years, 7 months ago) by jonathan
Branch: MAIN
Changes since 1.55: +3 -3 lines
Diff to previous 1.55 (colored) to selected 1.49 (colored)

Replace the set_socket() method of passing an extra struct socket*
argument to ip6_output() with a new explicit struct in6pcb* argument.
(The underlying socket can be obtained via in6pcb->inp6_socket.)

In preparation for fast-ipsec.  Reviewed by itojun.

Revision 1.55 / (download) - annotate - [select for diffs], Thu Aug 7 16:33:30 2003 UTC (20 years, 7 months ago) by agc
Branch: MAIN
Changes since 1.54: +3 -7 lines
Diff to previous 1.54 (colored) to selected 1.49 (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.54 / (download) - annotate - [select for diffs], Sun Jun 29 22:32:02 2003 UTC (20 years, 9 months ago) by fvdl
Branch: MAIN
Branch point for: ktrace-lwp
Changes since 1.53: +2 -4 lines
Diff to previous 1.53 (colored) to selected 1.49 (colored)

Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.

Revision 1.53 / (download) - annotate - [select for diffs], Sat Jun 28 14:22:12 2003 UTC (20 years, 9 months ago) by darrenr
Branch: MAIN
Changes since 1.52: +6 -4 lines
Diff to previous 1.52 (colored) to selected 1.49 (colored)

Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V

Revision 1.52 / (download) - annotate - [select for diffs], Tue May 27 22:36:39 2003 UTC (20 years, 10 months ago) by itojun
Branch: MAIN
Changes since 1.51: +7 -3 lines
Diff to previous 1.51 (colored) to selected 1.49 (colored)

can't use M_WAIT here, i believe.

Revision 1.51 / (download) - annotate - [select for diffs], Wed Sep 11 02:46:47 2002 UTC (21 years, 6 months ago) by itojun
Branch: MAIN
CVS Tags: nathanw_sa_before_merge, nathanw_sa_base, kqueue-beforemerge, kqueue-base, kqueue-aftermerge, gmcgarry_ucred_base, gmcgarry_ucred, gmcgarry_ctxsw_base, gmcgarry_ctxsw, fvdl_fs64_base
Changes since 1.50: +5 -5 lines
Diff to previous 1.50 (colored) to selected 1.49 (colored)

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

Revision 1.50 / (download) - annotate - [select for diffs], Wed Sep 11 02:41:28 2002 UTC (21 years, 6 months ago) by itojun
Branch: MAIN
Changes since 1.49: +4 -4 lines
Diff to previous 1.49 (colored)

correct signedness mixup in pointer passing.  sync w/kame

Revision 1.49 / (download) - annotate - [selected], Sat Jul 20 21:11:55 2002 UTC (21 years, 8 months ago) by itojun
Branch: MAIN
CVS Tags: gehenna-devsw-base
Changes since 1.48: +2 -3 lines
Diff to previous 1.48 (colored)

remove unneeded extern decl (commented out).  sync w/kame

Revision 1.48 / (download) - annotate - [select for diffs], Sun Jun 9 14:43:14 2002 UTC (21 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.47: +4 -4 lines
Diff to previous 1.47 (colored) to selected 1.49 (colored)

whitespace cleanup

Revision 1.47 / (download) - annotate - [select for diffs], Fri Jun 7 22:08:41 2002 UTC (21 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.46: +3 -2 lines
Diff to previous 1.46 (colored) to selected 1.49 (colored)

some KNF

Revision 1.46 / (download) - annotate - [select for diffs], Fri Jun 7 22:07:38 2002 UTC (21 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.45: +6 -7 lines
Diff to previous 1.45 (colored) to selected 1.49 (colored)

some KNF

Revision 1.45 / (download) - annotate - [select for diffs], Fri Jun 7 22:06:48 2002 UTC (21 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.44: +2 -4 lines
Diff to previous 1.44 (colored) to selected 1.49 (colored)

no need for offsetof()

Revision 1.44 / (download) - annotate - [select for diffs], Fri Jun 7 22:05:37 2002 UTC (21 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.43: +3 -3 lines
Diff to previous 1.43 (colored) to selected 1.49 (colored)

typo

Revision 1.43 / (download) - annotate - [select for diffs], Fri Jun 7 22:03:02 2002 UTC (21 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.42: +16 -58 lines
Diff to previous 1.42 (colored) to selected 1.49 (colored)

sync IPV6_CHECKSUM handling with kame.

Revision 1.42 / (download) - annotate - [select for diffs], Tue Mar 19 01:21:19 2002 UTC (22 years ago) by itojun
Branch: MAIN
CVS Tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001, eeh-devprop-base, eeh-devprop
Branch point for: netbsd-1-6, gehenna-devsw
Changes since 1.41: +12 -2 lines
Diff to previous 1.41 (colored) to selected 1.49 (colored)

check sa_len and sa_family strictly.  (NOTE: rtsol/rtsold older than Nov2001
will stop working, upgrade them first)

Revision 1.41 / (download) - annotate - [select for diffs], Thu Dec 20 07:26:37 2001 UTC (22 years, 3 months ago) by itojun
Branch: MAIN
CVS Tags: newlock-base, newlock, ifpoll-base
Changes since 1.40: +3 -3 lines
Diff to previous 1.40 (colored) to selected 1.49 (colored)

centralize multicast group management (in6_join/leavegroup).
have a flag for ip6_output() to fragment to minimum MTU.
sync with kame

Revision 1.40 / (download) - annotate - [select for diffs], Tue Dec 18 03:04:05 2001 UTC (22 years, 3 months ago) by itojun
Branch: MAIN
Changes since 1.39: +8 -8 lines
Diff to previous 1.39 (colored) to selected 1.49 (colored)

reduce white space/cosmetic diffs w/kame.

Revision 1.39 / (download) - annotate - [select for diffs], Tue Nov 13 00:57:06 2001 UTC (22 years, 4 months ago) by lukem
Branch: MAIN
Changes since 1.38: +4 -1 lines
Diff to previous 1.38 (colored) to selected 1.49 (colored)

add RCSIDs

Revision 1.38 / (download) - annotate - [select for diffs], Wed Oct 24 06:36:39 2001 UTC (22 years, 5 months ago) by itojun
Branch: MAIN
CVS Tags: thorpej-mips-cache-base
Changes since 1.37: +5 -5 lines
Diff to previous 1.37 (colored) to selected 1.49 (colored)

more whitespace sync with kame

Revision 1.37 / (download) - annotate - [select for diffs], Thu Oct 18 09:12:14 2001 UTC (22 years, 5 months ago) by itojun
Branch: MAIN
Branch point for: thorpej-mips-cache
Changes since 1.36: +22 -9 lines
Diff to previous 1.36 (colored) to selected 1.49 (colored)

gather stats on raw ip6 socket.  sync with kame

Revision 1.36 / (download) - annotate - [select for diffs], Thu Oct 18 07:44:35 2001 UTC (22 years, 5 months ago) by itojun
Branch: MAIN
Changes since 1.35: +55 -25 lines
Diff to previous 1.35 (colored) to selected 1.49 (colored)

reduce diffs with kame (mostly cosmetic).
move IPV6_CHECKSUM processing to sys/netinet6/raw_ip6.c.
constify a couple of places.

Revision 1.35 / (download) - annotate - [select for diffs], Wed Jul 25 23:28:03 2001 UTC (22 years, 8 months ago) by itojun
Branch: MAIN
CVS Tags: thorpej-devvp-base3, thorpej-devvp-base2, thorpej-devvp-base, thorpej-devvp, pre-chs-ubcperf, post-chs-ubcperf
Changes since 1.34: +1 -8 lines
Diff to previous 1.34 (colored) to selected 1.49 (colored)

allocate ipsec policy buffer attached to pcb in in*_pcballoc, before
giving anyone accesses to pcb (do not reveal an inconsistent ones).
sync with kame

Revision 1.34 / (download) - annotate - [select for diffs], Mon Jul 23 19:29:53 2001 UTC (22 years, 8 months ago) by itojun
Branch: MAIN
Changes since 1.33: +9 -2 lines
Diff to previous 1.33 (colored) to selected 1.49 (colored)

repair scoped address handling in PRU_BIND.  sync with kame.

Revision 1.33 / (download) - annotate - [select for diffs], Tue Jul 3 08:06:20 2001 UTC (22 years, 9 months ago) by itojun
Branch: MAIN
Branch point for: kqueue
Changes since 1.32: +2 -1 lines
Diff to previous 1.32 (colored) to selected 1.49 (colored)

call in{,6}_pcbpurgeif0() before in{,6}_purgeif().

Revision 1.32 / (download) - annotate - [select for diffs], Tue May 8 10:15:15 2001 UTC (22 years, 10 months ago) by itojun
Branch: MAIN
Changes since 1.31: +9 -8 lines
Diff to previous 1.31 (colored) to selected 1.49 (colored)

correct faith prefix determination.  use sys/netinet/if_faith.c:faithprefix()
to determine.  sync with kame.
(without this change, non-faith socket may mistakenly accept for-faith traffic)

Revision 1.31 / (download) - annotate - [select for diffs], Sun Mar 4 16:49:17 2001 UTC (23 years ago) by itojun
Branch: MAIN
CVS Tags: thorpej_scsipi_nbase, thorpej_scsipi_beforemerge, thorpej_scsipi_base
Branch point for: nathanw_sa
Changes since 1.30: +7 -14 lines
Diff to previous 1.30 (colored) to selected 1.49 (colored)

avoid possible alignment issue.  sync with kame

Revision 1.30 / (download) - annotate - [select for diffs], Mon Feb 26 07:20:45 2001 UTC (23 years, 1 month ago) by itojun
Branch: MAIN
Changes since 1.29: +23 -2 lines
Diff to previous 1.29 (colored) to selected 1.49 (colored)

make sure to validate packet against ipsec policy.

Revision 1.29 / (download) - annotate - [select for diffs], Sun Feb 11 06:49:52 2001 UTC (23 years, 1 month ago) by itojun
Branch: MAIN
Changes since 1.28: +62 -20 lines
Diff to previous 1.28 (colored) to selected 1.49 (colored)

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

Revision 1.28 / (download) - annotate - [select for diffs], Sat Feb 10 04:14:29 2001 UTC (23 years, 1 month ago) by itojun
Branch: MAIN
Changes since 1.27: +3 -2 lines
Diff to previous 1.27 (colored) to selected 1.49 (colored)

to sync with kame better, (1) remove register declaration for variables,
(2) sync whitespaces, (3) update comments. (4) bring in some of portability
and logging enhancements.  no functional changes here.

Revision 1.27 / (download) - annotate - [select for diffs], Thu Feb 8 18:43:17 2001 UTC (23 years, 1 month ago) by itojun
Branch: MAIN
Changes since 1.26: +57 -45 lines
Diff to previous 1.26 (colored) to selected 1.49 (colored)

sync with kame better.  cosmetic/stat changes only.

Revision 1.26 / (download) - annotate - [select for diffs], Wed Jan 24 09:04:17 2001 UTC (23 years, 2 months ago) by itojun
Branch: MAIN
Changes since 1.25: +6 -3 lines
Diff to previous 1.25 (colored) to selected 1.49 (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.25 / (download) - annotate - [select for diffs], Thu Oct 19 00:40:45 2000 UTC (23 years, 5 months ago) by itojun
Branch: MAIN
Changes since 1.24: +3 -3 lines
Diff to previous 1.24 (colored) to selected 1.49 (colored)

memcpy -> bcopy, for sync with kame tree

Revision 1.24 / (download) - annotate - [select for diffs], Fri Jul 7 15:54:19 2000 UTC (23 years, 8 months ago) by itojun
Branch: MAIN
Changes since 1.23: +69 -57 lines
Diff to previous 1.23 (colored) to selected 1.49 (colored)

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

Revision 1.23 / (download) - annotate - [select for diffs], Mon May 29 00:03:18 2000 UTC (23 years, 10 months 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
Branch point for: netbsd-1-5
Changes since 1.22: +12 -2 lines
Diff to previous 1.22 (colored) to selected 1.49 (colored)

disallow bind(2) with IPv4 mapped address for now.  port number check is
insufficient at this moment and we can bind(2) two sockets listen on same
port number.

for real fix, we need to check inpcb table with in6pcb.  we can't
find inpcb chain from particular in6pcb chain (like finding tcbtable from tcb6)
luckily RFC2553 does not talk about bind(2) behavior for IPv4 mapped.
IPv4 mapped brings in too much complexities...

Revision 1.22 / (download) - annotate - [select for diffs], Wed Mar 1 12:49:50 2000 UTC (24 years, 1 month ago) by itojun
Branch: MAIN
CVS Tags: minoura-xpg4dl-base
Branch point for: minoura-xpg4dl
Changes since 1.21: +1 -5 lines
Diff to previous 1.21 (colored) to selected 1.49 (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.21 / (download) - annotate - [select for diffs], Mon Feb 28 16:10:52 2000 UTC (24 years, 1 month ago) by itojun
Branch: MAIN
Changes since 1.20: +12 -6 lines
Diff to previous 1.20 (colored) to selected 1.49 (colored)

make ICMPv6 redirect actually flush route cache in udp6/raw6 socket.

Revision 1.20 / (download) - annotate - [select for diffs], Sat Feb 26 09:09:18 2000 UTC (24 years, 1 month ago) by itojun
Branch: MAIN
Changes since 1.19: +61 -4 lines
Diff to previous 1.19 (colored) to selected 1.49 (colored)

implement rip6_ctlinput, to cope with routing changes correctly.
(IMHO we need rip_ctlinput as well)

Revision 1.19 / (download) - annotate - [select for diffs], Sun Feb 6 12:49:49 2000 UTC (24 years, 1 month ago) by itojun
Branch: MAIN
CVS Tags: chs-ubc2-newbase
Changes since 1.18: +3 -3 lines
Diff to previous 1.18 (colored) to selected 1.49 (colored)

fix include pathname for better rfc2292 compliance.

Revision 1.18 / (download) - annotate - [select for diffs], Wed Feb 2 23:28:10 2000 UTC (24 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.17: +4 -3 lines
Diff to previous 1.17 (colored) to selected 1.49 (colored)

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

Revision 1.17 / (download) - annotate - [select for diffs], Tue Feb 1 22:52:12 2000 UTC (24 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.16: +6 -1 lines
Diff to previous 1.16 (colored) to selected 1.49 (colored)

First-draft if_detach() implementation, originally from Bill Studnemund,
although this version has been changed somewhat:
- reference counting on ifaddrs isn't as complete as Bill's original
  work was.  This is hard to get right, and we should attack one
  protocol at a time.
- This doesn't do reference counting or dynamic allocation of ifnets yet.
- This version introduces a new PRU -- PRU_PURGEADDR, which is used to
  purge an ifaddr from a protocol.  The old method Bill used didn't work
  on all protocols, and it only worked on some because it was Very Lucky.

This mostly works ... i.e. works for my USB Ethernet, except for a dangling
ifaddr reference left by the IPv6 code; have not yet tracked this down.

Revision 1.16 / (download) - annotate - [select for diffs], Mon Jan 31 14:19:06 2000 UTC (24 years, 2 months ago) by itojun
Branch: MAIN
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored) to selected 1.49 (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.15 / (download) - annotate - [select for diffs], Thu Jan 6 15:46:11 2000 UTC (24 years, 2 months ago) by itojun
Branch: MAIN
Changes since 1.14: +1 -5 lines
Diff to previous 1.14 (colored) to selected 1.49 (colored)

remove extra portability #ifdef (like #ifdef __FreeBSD__) in KAME IPv6/IPsec
code, from netbsd-current repository.
#ifdef'ed version is always available from ftp.kame.net.

XXX please do not make too many diff-unfriendly changes, we'll need to take
bunch of diffs on upgrade...

Revision 1.14 / (download) - annotate - [select for diffs], Wed Dec 22 04:03:04 1999 UTC (24 years, 3 months ago) by itojun
Branch: MAIN
Changes since 1.13: +10 -1 lines
Diff to previous 1.13 (colored) to selected 1.49 (colored)

drop IPv6 packets with v4 mapped address on src/dst.  they are illegal
and may be used to fool IPv6 implementations (by using ::ffff:127.0.0.1 as
source you may be able to pretend the packet is from local node)

Revision 1.13 / (download) - annotate - [select for diffs], Wed Dec 15 06:28:44 1999 UTC (24 years, 3 months ago) by itojun
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221
Changes since 1.12: +3 -2 lines
Diff to previous 1.12 (colored) to selected 1.49 (colored)

do not overwrite traffic class field when we write IPv6 version field.

Revision 1.12 / (download) - annotate - [select for diffs], Mon Dec 13 15:17:24 1999 UTC (24 years, 3 months ago) by itojun
Branch: MAIN
Changes since 1.11: +68 -32 lines
Diff to previous 1.11 (colored) to selected 1.49 (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.11 / (download) - annotate - [select for diffs], Mon Sep 13 12:15:56 1999 UTC (24 years, 6 months ago) by itojun
Branch: MAIN
CVS Tags: fvdl-softdep-base, fvdl-softdep, comdex-fall-1999-base, comdex-fall-1999
Branch point for: wrstuden-devbsize, thorpej_scsipi
Changes since 1.10: +4 -2 lines
Diff to previous 1.10 (colored) to selected 1.49 (colored)

- Call in{,6}_pcbdetach if ipsec initialization is failed during PRU_ATTACH.
  This situation happens on severe memory shortage.  We may need more
  improvements here and there.
- Grab IEEE802 address from IFT_ETHER card, even if the card is
  inserted after bootup time.  Is there any other card that can be
  inserted afterwards?  pcmcia fddi card? :-P
- RFC2373 u bit handling suggests that we SHOULD NOT copy interface id from
  ethernet card to pseudo interface, when ethernet card has IEEE802/EUI64
  with u bit != 0 (this means that IEEE802/EUI64 is not universally unique).
  Do not use such address as, for example, interface id for gif interface.
  (I have such an ethernet card myself)
  This may change interface id for your gif interface.  be careful upgrading
  rc files.

(sync with recent KAME)

Revision 1.10 / (download) - annotate - [select for diffs], Thu Aug 5 16:01:07 1999 UTC (24 years, 7 months ago) by itojun
Branch: MAIN
Changes since 1.9: +2 -1 lines
Diff to previous 1.9 (colored) to selected 1.49 (colored)

import recent kAME fixes.
- initialize hoplimit for raw6 socket properly.
- respect SO_TIMESTAMP on udp6.
- more sanity checks.

Revision 1.9 / (download) - annotate - [select for diffs], Sat Jul 31 18:41:17 1999 UTC (24 years, 8 months ago) by itojun
Branch: MAIN
CVS Tags: chs-ubc2-base
Changes since 1.8: +3 -1 lines
Diff to previous 1.8 (colored) to selected 1.49 (colored)

sync with recent KAME.
- loosen ipsec restriction on packet diredtion.
- revise icmp6 redirect handling on IsRouter bit.
- tcp/udp notification processing (link-local address case)
- cosmetic fixes (better code share across *BSD).

Revision 1.8 / (download) - annotate - [select for diffs], Fri Jul 30 10:35:38 1999 UTC (24 years, 8 months ago) by itojun
Branch: MAIN
Changes since 1.7: +1 -2 lines
Diff to previous 1.7 (colored) to selected 1.49 (colored)

remove reference to in6_systm.h (file itself will be removed afterwords)

Revision 1.7 / (download) - annotate - [select for diffs], Mon Jul 19 18:37:19 1999 UTC (24 years, 8 months ago) by itojun
Branch: MAIN
Changes since 1.6: +3 -3 lines
Diff to previous 1.6 (colored) to selected 1.49 (colored)

fix IPV6_CHECKSUM socket option (length computation was wrong).

Revision 1.6 / (download) - annotate - [select for diffs], Fri Jul 9 22:57:30 1999 UTC (24 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.5: +3 -1 lines
Diff to previous 1.5 (colored) to selected 1.49 (colored)

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

Revision 1.5 / (download) - annotate - [select for diffs], Tue Jul 6 08:55:56 1999 UTC (24 years, 8 months ago) by itojun
Branch: MAIN
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored) to selected 1.49 (colored)

checked build on alpha and i386, with GENERIC.v6.
fixed several sizeof(void *) and sizeof(size_t) issues on alpha.

Thanks to: Dave Huang and Tim Rightnour

Revision 1.4 / (download) - annotate - [select for diffs], Sun Jul 4 02:01:15 1999 UTC (24 years, 9 months ago) by itojun
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored) to selected 1.49 (colored)

s/splnet/splsoftnet/ in IPv6/IPsec part.
hope I made no mistake (the kernel works fine but I need a regress test)

Suggested by: thorpej

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

RCS ID police.

Revision 1.2 / (download) - annotate - [select for diffs], Thu Jul 1 08:12:58 1999 UTC (24 years, 9 months ago) by itojun
Branch: MAIN
Branch point for: chs-ubc2
Changes since 1.1: +643 -0 lines
Diff to previous 1.1 (colored) to selected 1.49 (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.1, Mon Jun 28 06:37:07 1999 UTC (24 years, 9 months ago) by itojun
Branch: MAIN
Branch point for: kame
FILE REMOVED

file raw_ip6.c was initially added on branch kame.

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




CVSweb <webmaster@jp.NetBSD.org>