Commit Graph

1521 Commits

Author SHA1 Message Date
itojun e0395ac8f0 make TCP MD5 signature work with KAME IPSEC (#define IPSEC).
support IPv6 if KAME IPSEC (RFC is not explicit about how we make data stream
for checksum with IPv6, but i'm pretty sure using normal pseudo-header is the
right thing).

XXX
current TCP MD5 signature code has giant flaw:
it does not validate signature on input (can't believe it! what is the point?)
2004-04-26 03:54:28 +00:00
matt 5413745100 Remove #else clause of __STDC__ 2004-04-26 01:31:56 +00:00
jonathan 887b782b0b Initial commit of a port of the FreeBSD implementation of RFC 2385
(MD5 signatures for TCP, as used with BGP).  Credit for original
FreeBSD code goes to Bruce M. Simpson, with FreeBSD sponsorship
credited to sentex.net.  Shortening of the setsockopt() name
attributed to Vincent Jardin.

This commit is a minimal, working version of the FreeBSD code, as
MFC'ed to FreeBSD-4. It has received minimal testing with a ttcp
modified to set the TCP-MD5 option; BMS's additions to tcpdump-current
(tcpdump -M) confirm that the MD5 signatures are correct.  Committed
as-is for further testing between a NetBSD BGP speaker (e.g., quagga)
and industry-standard BGP speakers (e.g., Cisco, Juniper).


NOTE: This version has two potential flaws. First, I do see any code
that verifies recieved TCP-MD5 signatures.  Second, the TCP-MD5
options are internally padded and assumed to be 32-bit aligned. A more
space-efficient scheme is to pack all TCP options densely (and
possibly unaligned) into the TCP header ; then do one final padding to
a 4-byte boundary.  Pre-existing comments note that accounting for
TCP-option space when we add SACK is yet to be done. For now, I'm
punting on that; we can solve it properly, in a way that will handle
SACK blocks, as a separate exercise.

In case a pullup to NetBSD-2 is requested, this adds sys/netipsec/xform_tcp.c
,and modifies:

sys/net/pfkeyv2.h,v 1.15
sys/netinet/files.netinet,v 1.5
sys/netinet/ip.h,v 1.25
sys/netinet/tcp.h,v 1.15
sys/netinet/tcp_input.c,v 1.200
sys/netinet/tcp_output.c,v 1.109
sys/netinet/tcp_subr.c,v 1.165
sys/netinet/tcp_usrreq.c,v 1.89
sys/netinet/tcp_var.h,v 1.109
sys/netipsec/files.netipsec,v 1.3
sys/netipsec/ipsec.c,v 1.11
sys/netipsec/ipsec.h,v 1.7
sys/netipsec/key.c,v 1.11
share/man/man4/tcp.4,v 1.16
lib/libipsec/pfkey.c,v 1.20
lib/libipsec/pfkey_dump.c,v 1.17
lib/libipsec/policy_token.l,v 1.8
sbin/setkey/parse.y,v 1.14
sbin/setkey/setkey.8,v 1.27
sbin/setkey/token.l,v 1.15

Note that the preceding two revisions to tcp.4 will be
required to cleanly apply this diff.
2004-04-25 22:25:03 +00:00
simonb b5d0e6bf06 Initialise (most) pools from a link set instead of explicit calls
to pool_init.  Untouched pools are ones that either in arch-specific
code, or aren't initialiased during initial system startup.

 Convert struct session, ucred and lockf to pools.
2004-04-25 16:42:40 +00:00
itojun 22bdfd729d fix how we send RST against ACK. markus@openbsd 2004-04-25 03:29:11 +00:00
itojun 8a0aba4304 indent for little bit better readability 2004-04-25 00:08:54 +00:00
itojun 3b87628cfb fix comment; we no longer move ip+tcp into the same mbuf 2004-04-24 23:59:13 +00:00
matt 41478e7f33 Always include <sys/param.h> first! 2004-04-24 19:59:19 +00:00
ragge febf637b17 Avoid performance problem in tcp_reass() when appending mbufs to a chain
by keeping a pointer to the last mbuf in the chain.
2004-04-22 15:05:33 +00:00
tls 7eb2f214d5 Change the default state of two tunables; bring our TCP a little bit
closer to normal behaviour for the current century.

New Reno is now on by default (which is really the only reasonable
choice, since we don't do SACK); instead of an initial window of 1
for non-local nets, we now use Sally Floyd's magic 4K rule.
2004-04-22 02:19:39 +00:00
matt e50668c7fa Constify protosw arrays. This can reduce the kernel .data section by
over 4K (if all the network protocols) are loaded.
2004-04-22 01:01:40 +00:00
itojun d2f1c029b9 kill sprintf, use snprintf 2004-04-21 18:40:37 +00:00
itojun e133d13e80 kill some strcpy 2004-04-21 18:16:14 +00:00
itojun 0f06e31eb6 no space between function name and paren: foo (blah) -> foo(blah) 2004-04-21 17:49:46 +00:00
matt e3b919c754 Constify if.c radix.c and route.c (and fix related fallout). 2004-04-21 04:17:28 +00:00
matt 30e63c6236 export tcpstates for _KERNEL and remove tcp_usrreq.c's incorrect
declartion.
2004-04-20 22:54:31 +00:00
itojun 6a16706746 follow draft-ietf-tcpm-tcpsecure-00.txt 3.2 (B):
if SYN is coming and RCV.NXT == SEG.SEQ, then ACK with value - 1.
2004-04-20 19:49:15 +00:00
itojun f2e796b13f - respond to RST by ACK, as suggested in NISCC recommendation
- rate-limit ACKs against RSTs and SYNs
2004-04-20 16:52:12 +00:00
matt 5060b3b780 ANSI'fy and de __P 2004-04-18 23:35:56 +00:00
matt db6a0b431a De __P() 2004-04-18 21:00:35 +00:00
matt 35b9f3ec72 If a segment is received with RST set and the segment is completely to the
left of the receive window, ignore it.  Add some additional comments to
the code that deals with received segemnts that are completely to the right
of the receive window.  If an invalid SYN is received, force an ACK and
drop it; if the other side really sent the SYN; it'll respond with a reset.
2004-04-17 23:35:37 +00:00
christos 90e1f431ca adjust to the sbreserve prototype change. 2004-04-17 15:18:53 +00:00
ragge 0a7fe37708 Add back one line which was accidentially removed (by me) a while ago.
Spotted by Markus Friedl (markus at openbsd.org).
2004-04-14 18:07:52 +00:00
christos 99d2bc9467 PR/22551: Invoking tcpcb's get erroneously free'd resulting in to_ticks <= 0
assertion. Approved by he.
2004-04-05 21:49:21 +00:00
matt efc47093e2 In ip_reass_ttl_descr, make i signed since it's compared to >= 0 2004-04-01 22:47:55 +00:00
martin 8afe56f1c5 A few more ioctl vs. copyin changes, spotted by Bill Studenmund. 2004-04-01 21:54:41 +00:00
martin 9d16150a8e Untangle ioctl copyin/copyout confusion. IP-Filter now actually works
on sparc64 (and probably everywhere else).
2004-04-01 09:24:58 +00:00
dyoung 957f9ce691 Only #define COPYIN copyin, et cetera, in the kernel. That is, only
when when _KERNEL is defined.
2004-03-31 20:58:15 +00:00
darrenr 077337039d COPYIN/COPYOUT macros need to call copyin/out on NetBSD rather than just use
bcopy.
2004-03-31 11:41:45 +00:00
itojun 7cd01f1c20 clean previous commit (uh_sum != 0 check in IPv6) 2004-03-31 07:57:06 +00:00
itojun 8d81738de0 drop packet if IPv6 udp packet does not have checksum (checksum is mandatory
in IPv6).
2004-03-31 07:54:00 +00:00
christos dc9378460c Make sure we disarm the persist timer before we arm the rexmit
timer, otherwise there is a tiny window where both timers are
active, and this is not correct according to the comments in the
code. I believe that this is the cause of the to_ticks <= 0 assertion
failure in callout_schedule() that I've been getting.
2004-03-30 19:58:14 +00:00
atatat 83b193a052 Make these compile without INET. tcp_input probably needs a lot more
work...
2004-03-29 04:59:02 +00:00
martin 665588c20c Cast 64 bit pointers only with (intptr_t) care. 2004-03-28 12:12:28 +00:00
martti 621e9bac7f Sync with official IPFilter 2004-03-28 09:01:26 +00:00
martti 24d567d60d Upgraded IPFilter to 4.1.1 2004-03-28 09:00:53 +00:00
martti ad9b29ed97 Import IPFilter 4.1.1 2004-03-28 08:55:20 +00:00
atatat 19af35fd0d Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.
2004-03-24 15:34:46 +00:00
itojun 3811eef49d typo 2004-03-23 05:31:54 +00:00
drochner 6a4fbf616c fix tcp/udp checksum test in the M_CSUM_NO_PSEUDOHDR case
(this can never have worked)
now I can use a "bge" gigabit interface with hw checksumming
ttcp-t: 2147483648 bytes in 18.31 real seconds = 114527.11 KB/sec +++
woow!
2004-03-10 18:50:45 +00:00
wiz e8f4f5ba76 No need to include netinet/ip_mroute.h twice.
Closes PR 24652 by Kailash Sethuraman.
2004-03-04 15:15:06 +00:00
thorpej 8387ab32c5 Use IPSEC_PCB_SKIP_IPSEC() to short-circuit calls to ipsec{4,6}_hdrsiz_tcp(). 2004-03-03 05:59:38 +00:00
thorpej 2803ff0955 Use the new IPSEC_PCB_SKIP_IPSEC() to bypass a socket policy lookup
when possible.  This shaves several cycles from the output path for
non-IPsec connections, even if the policy is cached in the PCB.
2004-03-02 02:28:28 +00:00
thorpej 00f100daae Call ipsec_pcbconn() and ipsec_pcbdisconn() for FAST_IPSEC, too. 2004-03-02 02:26:28 +00:00
thorpej 979f197a86 Define a sotoinpcb_hdr() macro (a'la sotoinpcb()). 2004-03-02 02:11:14 +00:00
itojun 8ef33296ff KNF 2004-02-26 02:34:59 +00:00
wiz 73e1501b98 parameter with two es. From Peter Postma. 2004-02-24 15:22:01 +00:00
wiz f05e6f1a3a occured -> occurred. From Peter Postma. 2004-02-24 15:12:51 +00:00
itojun d334411bcd deal with IPv6 path MTU < 1280 (RFC2460 section 5 last paragraph).
check if there really is room for TCP data.
2004-02-04 05:36:03 +00:00
abs c02c2d8844 Allow DEF_NAT_AGE to be set in kernel config. 2004-01-16 09:01:22 +00:00
itojun 0146a277ba correct typo in 1.94 -> 1.95. pointed out by Shiva Shenoy 2004-01-15 05:13:17 +00:00
itojun 3ffdb9507a avoid deref-after-free.
http://sources.zabbadoz.net/freebsd/patchset/106-ipsec-pcb-discon.diff
2004-01-13 06:17:14 +00:00
matt 9196bdd1f8 When accepting a peer's MSS, never let it drop below 256 (SLIP + TCP will
be the lowest MSS we should ever enounter).
2004-01-07 19:15:43 +00:00
tron 784a553ad1 Remove extra tokens at end of #undef directive. 2004-01-03 22:34:38 +00:00
itojun 4fc59b19d5 no need for tmp = arc4randomid here 2004-01-02 20:51:51 +00:00
itojun 7cddb2827b whitespace 2004-01-02 15:51:45 +00:00
itojun 344b08b44b some corrections from markus@openbsd;
- callout_ack() was called with wrong argument
2004-01-02 15:51:04 +00:00
itojun 5377ace199 some corrections from markus@openbsd;
- callout_ack() was called with wrong argument
- no need for xor with timestamp as we are using arc4random()
- minor typo/cleanup
2004-01-02 12:01:39 +00:00
wiz d46bc94200 Niels Provos kindly agreed to drop clauses 3 and 4 from the
license -- thanks.
Based on OpenBSD commit and hints by itojun.
2003-12-26 19:04:55 +00:00
abs 8724ebf7f9 Comment out #undef LARGE_NAT so LARGE_NAT can be set in a kernel config file
without having to edit this file as well.
2003-12-16 12:15:04 +00:00
thorpej 0c4c58a70b Fix syntax errors in CHECK_NMBCLUSTER_PARAMS(). 2003-12-14 01:14:24 +00:00
jonathan 9c1a5c5570 Second part of hashed IP_reassembly changes:
When under pressure for mbufs or we have too many fragments in the IP
reassembly queue, drop half of all fragments. This multiplicative-drop
strategy ensures we return to a healthy state, even under borderline
denial-of-service from extremely lossy NFS-over-UDP peers.
The multiplicative-drop phase currently drops 50% of fragments, but
has pre-placed support for implementing drop-fractions other than 50%

The threshhold for the `drop-half' phase is the new variable,
ip_maxfrags which is calculated as nmbclusters/4.

ip_input.c now keeps ip_nmbclusters, a cached copy of nmbclusters.
Before using limits derived from nmbclusters, we check if nmbclusters
and ip_nmclusters are equal. If not, we recompute Ip parameters
derived from nmbclusters.  Based on a suggestion by Jason Thorpe.
ip_maxfrags is currently auto-recalcuated.

The counters ip_nfrags and ip_nfragpacketsr are now declared static
and uninitialized (bss), to discourage tampering with them.
2003-12-14 00:09:24 +00:00
scw 6aec1d6812 Make fast-ipsec and ipflow (Fast Forwarding) interoperate.
The idea is that we only clear M_CANFASTFWD if an SPD exists
for the packet. Otherwise, it's safe to add a fast-forward
cache entry for the route.

To make this work properly, we invalidate the entire ipflow
cache if a fast-ipsec key is added or changed.
2003-12-12 21:17:59 +00:00
itojun aa8a6718f0 use if_indexlim (instead of if_index) and ifindex2ifnet[x] != NULL
to check if interface exists, as (1) if_index has different meaning
(2) ifindex2ifnet could become NULL when interface gets destroyed,
since when we have introduced dynamically-created interfaces.  from kame
2003-12-10 11:46:33 +00:00
itojun c81f32fe6c comment from niels provos;
- seed2 is necessary, but use it as "seed2 + x" not "seed2 ^ x".
- skipping number is not needed, so disable it for 16bit generator (makes
  the repetition period to 30000)
2003-12-10 05:22:18 +00:00
jonathan 626b230d59 Add new field ipq_nfrags to struct ipq. Maintain count of fragments
(fragments, not fragmented packets) in each queue entry.
Use ipq_nfrags to maintain a count of total fragments in reassembly queue.
2003-12-08 02:23:27 +00:00
jonathan 27171efb6d KNF: s/unsigned/u_int/, in a couple of places I missed. 2003-12-07 01:18:26 +00:00
jonathan c56097abb8 Replace the single global IP reassembly list/listhead, with a
hashtable of list-heads. Independently re-invented, then reworked to
match similar code in FreeBSD.
2003-12-06 23:56:10 +00:00
atatat 13f8d2ce5f Dynamic sysctl.
Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al.  Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded.  Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment.  I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.
2003-12-04 19:38:21 +00:00
christos 0aac876eae fix unused variable warnings when LARGE_NAT is defined. 2003-12-04 15:32:01 +00:00
scw 7ef39665ff ipflow (IP fast forwarding) is not compatible with FAST_IPSEC either.
XXX: The decision whether or not to fast forward should be made
XXX: dynamically. Using the current approach seriously reduces
XXX: routing performance on gateways with IPsec enabled.
2003-12-04 10:02:35 +00:00
itojun a748550c99 always compile ip_id.c 2003-11-26 21:26:56 +00:00
itojun 326cfe57d2 define RANDOM_IP_ID by default (unifdef -DRANDOM_IP_ID).
one use remains in sys/netipsec, which is kept for freebsd source code compat.
2003-11-26 21:15:47 +00:00
itojun 0864b4939d "seed2" was ruining non-repeating property, so remove it. discussed on tech-net 2003-11-25 18:13:55 +00:00
itojun f51095cf7c knf 2003-11-25 14:44:13 +00:00
scw fd11abcb03 For FAST_IPSEC, ipfilter gets to see wire-format IPsec-encapsulated packets
only. Decapsulated packets bypass ipfilter. This mimics current behaviour
for Kame IPsec.
2003-11-24 20:54:59 +00:00
yamt bba8d5af45 comments on tcp_outflags. 2003-11-20 16:21:48 +00:00
fvdl f2fdecfc92 Correct number of arguments to sysctl_rdint. 2003-11-19 22:40:55 +00:00
jonathan b6e73d53fb Footwork for fast-ipsec and IPv6: when compiling sys/netinet/tcp_input.c
for both FAST_IPSEC and INET6, include <netipsec/ipsec6.h>.
2003-11-19 20:47:00 +00:00
jonathan 130f3bfc26 Patch back support for (badly) randomized IP ids, by request:
* Include "opt_inet.h" everywhere IP-ids are generated with ip_newid(),
  so the RANDOM_IP_ID option is visible. Also in ip_id(), to ensure
  the prototype for ip_randomid() is made visible.

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

Note that the implementation of randomized IP ids is still defective,
and should not be enabled at all (even if configured) without
very careful deliberation. Caveat emptor.
2003-11-19 18:39:34 +00:00
jonathan de80d1419e Diff to netinet/ip_input.c (restore ip_id, initialize) for ip_id fix:
Revert the (default) ip_id algorithm to the pre-randomid algorithm,
due to demonstrated low-period repeated IDs from the randomized IP_id
code.  Consensus is that the low-period repetition (much less than
2^15) is not suitable for general-purpose use.

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

This API may be reworked in the near future to support linear ip_id
counters per (src,dst) IP-address pair.
2003-11-17 22:34:16 +00:00
jonathan 995c532c33 Revert the (default) ip_id algorithm to the pre-randomid algorithm,
due to demonstrated low-period repeated IDs from the randomized IP_id
code.  Consensus is that the low-period repetition (much less than
2^15) is not suitable for general-purpose use.

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

This API may be reworked in the near future to support linear ip_id
counters per (src,dst) IP-address pair.
2003-11-17 21:34:27 +00:00
jonathan fa24e6f3f8 Add m_tag_delete_nonpesrsistent(), for deleting all packet tags on
mbuf chains which are recycled (e.g., ICMP reflection, loopback
interface).  A consensus was reached that such recycled packets should
behave (more-or-less) the same way if a new chain had been allocated
and the contents copied to that chain.

Some packet tags may in future be marked as "persistent" (e.g., for
mandatory access controls) and should persist across such deletion.
NetBSD as yet hos no persistent tags, so m_tag_delete_nonpersistent()
just deletes all tags. This should not be relied upon.
2003-11-13 01:48:12 +00:00
itojun d46ad3421a KNF 2003-11-12 15:00:05 +00:00
ragge 4a9b211e76 Remove the FAST_MBSEARCH ifdef, send packet prediction is now default. 2003-11-12 10:48:04 +00:00
jonathan 79bf8521a5 Change global head-of-local-IP-address list from in_ifaddr to
in_ifaddrhead. Recent changes in struct names caused a namespace
collision in fast-ipsec, which are most cleanly fixed by using
"in_ifaddrhead" as the listhead name.
2003-11-11 20:25:26 +00:00
jonathan b86d07f435 Allocate sysctl oid for ipv4 sysctl node "ifq", define symbolic name, and
bump IPCTL_MAXID. (Should have been committed with other ifq sysctl changes).
2003-11-10 20:50:29 +00:00
jonathan 88ba77e705 Make per-protocol network input queue stats visible to userland via
sysctl. Add a protocol-independent sysctl handler to show the per-protocol
"struct ifq' statistics. Add IP(v4) specific call to the handler.
Other protocols can show their per-protocol input statistics by
allocating a sysclt node and calling sysctl_ifq() with their own struct ifq *.

As posted to tech-kern plus improvements/cleanup suggested by Andrew Brown.
2003-11-10 20:03:29 +00:00
simonb a2facef339 Remove some assigned-to but otherwise unused variables. 2003-10-30 01:43:08 +00:00
mycroft d7f0f6de8f Do the previous differently. 2003-10-28 20:27:22 +00:00
provos 57755c156a use a hash table to bind to local ports; suggested by markus friedl
approved: fvdl@
2003-10-28 17:18:37 +00:00
thorpej db71356cd1 - Change callout_setfunc() to require that the callout handle is already
initialized.  Update the txp(4) to compensate.
- Statically initialize the TCP timer callout handles in the tcpcb
  template.  We still use callout_setfunc(), but that call is now much
  less expensive.  Add a comment that the compiler is likely to unroll
  the loop (so don't sweat that it's there).
2003-10-27 16:52:01 +00:00
itojun 3fef2ba893 make it compilable with TCP_DEBUG defined 2003-10-27 07:43:01 +00:00
christos 2017bf9a94 Fix uninitialized variable warning 2003-10-25 18:31:59 +00:00
christos 649137925e initialize off 2003-10-25 08:13:28 +00:00
ragge da20a11a23 Fix the bug in the tcp transmit prediction code.
During testing the prediction counters show a hit-rate on about 85% for
packets sent on a local LAN, and better than 99% for intercontinental
high-speed bulk traffic (!).
2003-10-24 10:25:40 +00:00
enami 935b3c7ad5 Make this file compile again when TCP_OUTPUT_COUNTERS defined. 2003-10-24 03:12:53 +00:00
mycroft 5a8b331f54 Remove all the code to maintain ia_inpcbs. This information was only used to
close sockets on address changes, which was deemed to be a bad idea and was
summarily removed, so there is no point in wasting effort on maintaining it
any more.
2003-10-23 20:55:08 +00:00
thorpej e8a98ee63e Oops, FAST_MBSEARCH counters were swapped; fix it. Pointed out by yamt@. 2003-10-23 17:02:23 +00:00
thorpej 9e4220c00a Oops, a little to aggressive in the previous patch; TCP_TIMER_INIT()
still needs to be in tcp_newtcpcb(), for now.  Pointed out by enami.
2003-10-22 05:55:54 +00:00
thorpej 31923baa46 Rather than zeroing a tcpcb structure and filling in all the fields
individually, create a tcpcb template pre-initialized (and pre-zero'd)
with the static and mostly-static tcpcb parameters.  The template is
now copied into the new tcpcb, which zeros and initializes most of the
tcpcb in one pass.  The template is kept up-to-date as TCP sysctl
variables are changed.

Combined with the previous sb_max change, TCP socket creation is now
25% faster.
2003-10-22 02:45:57 +00:00
thorpej 861856caa0 Add event counters that measure FAST_MBSEARCH. 2003-10-21 21:17:20 +00:00
enami e51f5c64e5 Fix indent. 2003-10-18 13:05:45 +00:00
enami bae9643b84 Increment stats when packet is dropped since there is no room
to put all fragments in the interfaces's send queue.  Some large
UDP packets are dropped here and administrator may want to bump ifqmaxlen.
2003-10-17 20:31:12 +00:00
itojun 5e7b0c710b more correction to ip_fragment; free mbuf correctly if ENOBUFS is raised
during fragmenting.
2003-10-14 06:36:48 +00:00
itojun 00af50df1b avoid mbuf leak on ip_fragment(); obey 4.4bsd mbuf passing rule (mbuf passed
to a function must be freed by the called function on error).
pointed out by enami
2003-10-14 03:38:49 +00:00
mycroft f2fc15d4b5 There is also no reason to use arc4random() here. 2003-10-07 21:24:56 +00:00
itojun 98d5598feb when dropping M_PKTHDR, need to free m_tag associated with it. 2003-10-03 20:56:11 +00:00
itojun 899b67c09a correct ip_fragment() wrt ip->ip_off handling.
do not send out incomplete fragment due to ENOBUFS (behavior change from 4.4BSD)
2003-10-01 23:54:40 +00:00
tls b911732f2a Increase default socket-buffer sizes from 16K to 32K. This increases
throughput significantly in a wide variety of test cases, including
local gigabit ethernet with both jumbo and standard frames,
transcontinental (U.S.) connections with e2e bandwidths ranging from
10Mbit/sec to 155Mbit/sec, and on a variety of test connections
between the NetBSD Project public servers and machines in Australia.

The impact of this change is less dramatic for high-delay connections
when Path MTU is in use but still measurable.

For optimal performance on local gigabit networks, a higher socket
buffer size (at least 64K) will still yield a substantial improvement
in performance, but 32K gets us most of the way there in my test
cases, with only a cost of _doubling_ memory use per socket rather
than _quadrupling_ it.

N.B. Windows NT, at least since Win2k SP2, uses a default socket buffer
     size (or their analogue thereof) of 64K, which is a useful data
     point.
2003-09-29 21:39:35 +00:00
mycroft ca96c7c4ec Remove some code that breaks AH tunnels completely. The comment describing
the purpose of this code appears to be on crack -- it's talking about
end-to-end authentication, but the purpose of an AH tunnel is NOT end-to-end
authentication; it's authentication of the tunnel endpoints.

NB: This does not fix the fact that IPsec leaks "packet tags."
2003-09-28 04:45:14 +00:00
mycroft 3114965161 Fix glaring errors in recent changes. 2003-09-25 00:59:31 +00:00
itojun 8d9a724638 on arplookup() failure, nuke cloned route - otherwise outsider could use massive
number of bogus ARPs for DoS attack.  FreeBSD-SA-03:14.arp
2003-09-24 06:52:47 +00:00
jonathan 5923dedaeb Fast-ipsec can call ip_output() with a null 'struct socket *so'
argument.  So check so is non-NULL before doing the pointer-chasing
dance to find the PCB. (Unless and until we rework fast-ipsec and
KAME, to pass a struct in_pcbhdr * instead of the struct socket *).
2003-09-19 00:27:56 +00:00
itojun a3931fc5ab exp is reserved name under posix 2003-09-16 00:31:55 +00:00
itojun 6b33d95e22 send icmp admin prohibit if socket policy mismatches. 2003-09-12 09:55:22 +00:00
itojun 644a4857fb cut-and-paste error. Valeriy E. Ushakov 2003-09-10 01:46:27 +00:00
itojun 99bc41d6fd if IPsec inbound policy mismatches, respond to SYN with RST (instead of
just dropping it), allow client to react quickly.
2003-09-10 00:58:29 +00:00
itojun 495bd5ff91 initialize ip_hl for ipsec policy lookup. PR kern/22715 2003-09-08 02:06:34 +00:00
itojun 32e3deae21 randomize IPv4/v6 fragment ID and IPv6 flowlabel. avoids predictability
of these fields.  ip_id.c is from openbsd.  ip6_id.c is adapted by kame.
2003-09-06 03:36:30 +00:00
itojun 175c9afa3f clarify flowlabel handling 2003-09-06 03:12:51 +00:00
itojun dd45bfac41 backout previous, we don't know if arc4random() corrides on reboot. 2003-09-06 00:24:54 +00:00
itojun 9636351c96 u_short -> u_int16_t 2003-09-05 23:02:40 +00:00
itojun 186bd1ad6a initialize fragment ID with arc4random, not by time.tv_sec 2003-09-05 22:09:38 +00:00
itojun 495906ca8e revamp inpcb/in6pcb so that they are more aligned with each other.
in6pcb lookup now uses hash(9).
2003-09-04 09:16:57 +00:00
itojun 5c39f4aaa7 don't intiialize m by m0, m0 is not initialized (by introduction of ip_fragment) 2003-08-27 02:09:59 +00:00
itojun 3e76200c67 need sys/domain.h for FAST_IPSEC case; jonathan 2003-08-23 01:41:10 +00:00
itojun a3bad645a4 make sure so is properly initialized 2003-08-22 22:49:34 +00:00
itojun 58f57a60fd tp could be null in tcp_respond() 2003-08-22 22:27:07 +00:00
itojun 4e6aca94c2 correct missing inclusion of opt_ipsec.h 2003-08-22 22:11:44 +00:00
itojun 11ede1ed88 remove ipsec_set/getsocket. now we explicitly pass socket * to ip{,6}_output. 2003-08-22 22:00:36 +00:00
itojun 82eb4ce914 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.
2003-08-22 21:53:01 +00:00
jonathan 9339ef0381 Change KAME code for ip_output()/ip6_output() to obtain struct socket*
from the explicit inpcb*/in6pcb* argument.  set_socket() becomes redundant.
2003-08-22 20:29:00 +00:00
jonathan 902669955f 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.
2003-08-22 20:20:09 +00:00
jonathan 6196bbe72d Honour the M_CSUM_NO_PSEUDOHDR, if set on inbound TCP and UDP packets.
Tested against  bcm5700 with patched if_bge.c.
2003-08-21 14:49:49 +00:00
itojun b83dd2f98b remove unneeded #ifdef __NetBSD__ 2003-08-19 08:00:54 +00:00
itojun ade8129bdc make ip_fragment public (it is for coming PF integration) 2003-08-19 01:20:03 +00:00
christos ae572737ba make ip_fragment static and add prototype. 2003-08-19 00:54:41 +00:00
itojun 4f8ba921cd correct ip_multicast_if fix to always set ifp (tnx Shiva) 2003-08-19 00:17:38 +00:00
itojun 449b5c43d4 since we cope with packets with addess on !IFF_UP interface in ip_input()
properly, IFF_UP check in INADDR_TO_IA is obsolete (or too much).
2003-08-18 22:28:51 +00:00
itojun 122edbc337 fix problem we can't drop membership on !IFF_UP interface.
reported by Shiva Shenoy

while we're here, fix another problem when the same interface address is
assigned to !IFF_MULTICAST and IFF_MULTICAST interface.  if ip_multicast_if()
returns the first one, join/leave will fail, which is not an desired effect.
2003-08-18 22:23:22 +00:00
itojun 3bcba4f62b do not disconnect L4 connections on IP address removal. the behavior
is too extreme (consider DHCP/PPP-based fixed address allocation).
see tech-net for more info.
2003-08-16 11:30:35 +00:00
martti 03506a6ef3 Fix return-rst for IPv6 (PR#22157 by Peter Postma). 2003-08-15 08:11:09 +00:00
jonathan 28b5f5dfab (fast-ipsec): Add hooks to pass IPv4 IPsec traffic into fast-ipsec, if
configured with ``options FAST_IPSEC''.  Kernels with KAME IPsec or
with no IPsec should work as before.

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

Fast-ipsec tested with ICMP or UDP over ESP. TCP doesn't work, yet.
2003-08-15 03:42:00 +00:00
itojun fd3f06dabb enforce ipsec policy on raw wildcard. 2003-08-14 07:57:40 +00:00
agc aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
itojun e4feda72ab avoid code dup when check broadcast addr in bind(2) 2003-07-22 02:09:30 +00:00
itojun 074166110c permit bind(2) to broadcast address, as it was permitted before.
(for instance, "ntpd -b" was broken since revision 1.82)
found report on http://pc.2ch.net/unix
2003-07-21 07:02:35 +00:00
he 80ccb5520c As a temporary workaround, apply the fix from PR#20390, thereby
cooperating with the callout code in working around the race
condition caused by the TCP code's use of the callout facility.

Instead of unconditionally releasing memory in tcp_close() and
SYN_CACHE_PUT(), check whether any of the related callout handlers
are about to be invoked (but have not yet done callout_ack()), and
if so, just mark the associated data structure (tcpcb or syn cache
entry) as "dead", and test for this (and release storage) in the
callout handler functions.
2003-07-20 16:35:07 +00:00
itojun 4c19286f97 correct igmp. from love 2003-07-14 16:39:43 +00:00
ragge 9e2d68cb61 Make it possible to set TCP_INIT_WIN and TCP_INIT_WIN_LOCAL in the config
file as options.
2003-07-03 08:28:16 +00:00
itojun 022df20c75 minor KNF 2003-07-03 05:03:53 +00:00
ragge cb6b5a36c4 Make the fast-search stuff an option. There are still reports on
problem with it.
2003-07-02 21:43:49 +00:00
ragge c6308a0598 Fix previous bug. Thanks to Enami for spotting the (obvious) error, and
to other people with much help with bug reports etc.
While fixing, change some of the code I added last time to make it
cleaner and simpler.
2003-07-02 19:33:20 +00:00
ragge c04e1a5756 Disable the code I checked in yesterday; reports that samba (!) are crashing
machines with it. Will do some more tests.
2003-06-30 14:51:06 +00:00
itojun 7e53aaa8dd better ip_mrouter_detach(). by ono@kame 2003-06-30 10:34:53 +00:00
itojun 38d08be727 do not generate ICMP redirect when packet filter alters ip_dst to an
address that reside on the same link.  Cedric Berger convinced me that
it is necessary.
2003-06-30 07:54:28 +00:00
itojun 1db5330c52 freebsd code somehow crept in 2003-06-30 02:08:28 +00:00
itojun 7ded9690f4 after pfil_run_hooks, need to fix hlen as well 2003-06-30 01:22:51 +00:00
itojun 868bbd9978 fix indent 2003-06-30 01:21:11 +00:00
itojun 725c585956 remove IPv4 hook if IPv6 hook fails (seems to be cut-and-paste error). 2003-06-30 00:15:12 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
ragge 679db94879 Add code to remember where in the send queue of mbufs the last packet was
sent from. This change avoid a linear search through all mbufs when using
large TCP windows, and therefore permit high-speed connections on long
distances.

Tested on a 1 Gigabit connection between Luleå and San Francisco, a distance
of about 15000km.  With TCP windows of just over 20 Mbytes it could keep up
with 950Mbit/s.

After discussions with Matt Thomas and Jason Thorpe.
2003-06-29 18:58:26 +00:00
simonb 130b423e90 Fix a nit in a comment. 2003-06-29 12:00:47 +00:00
darrenr 960df3c8d1 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
2003-06-28 14:20:43 +00:00
itojun 73ed908c03 fix stats to meet 4.4BSD practice 2003-06-26 21:49:17 +00:00
itojun 08740c2691 fix comment 2003-06-26 21:43:39 +00:00
christos 8924cfdcba abuse the mib instead of abusing the new pointer. Idea from simon burge.
It allows the tcp_sysctl_ident to run by non-super-users. No backwards
compatibility provided.
2003-06-26 17:32:22 +00:00
itojun c077e299a8 expire mrt if mrt_stall goes empty. ono@kame 2003-06-26 07:41:48 +00:00
itojun 4f7d642336 cleanup multicast routing stuff on if_detach().
XXX sideeffect to running instance of multicast routing daemon unknown
2003-06-26 03:35:00 +00:00
itojun 0888779b69 put meaningful count into in_multientries.
(or we could remove this variable - noone seem to use it)
2003-06-26 03:17:32 +00:00
itojun bef80abb93 purge rti structure (in igmp.c) for removed ifp on if_detach(). 2003-06-26 03:11:08 +00:00
itojun d1fcb86326 tabify 2003-06-26 00:43:31 +00:00
itojun ab5963ee1f check if INADDR_TO_IA gets us valid in_ifaddr or not. hopefully fix PR21964 2003-06-26 00:19:13 +00:00
martin 864f19482a #ifdef _KERNEL_OPT police 2003-06-23 14:59:21 +00:00
martin 1f875208a7 Protect opt_*.h includes by _KERNEL_OPT 2003-06-23 13:58:06 +00:00
martin d505b18964 Make sure to include opt_foo.h if a defflag option FOO is used. 2003-06-23 11:00:59 +00:00
itojun faef0b82e9 install host route for p2p interface even if there's connected net route
by broadcast interface.  PR 21903.
2003-06-18 06:42:34 +00:00
matt 27e1742142 Change the way multicasts are kept. They now use a hash table in the same
manner as the ifaddr hash table.  By doing this, the mkludge code can go
away.  At the same time, keep track of what pcbs are using what ifaddr and
when an address is deleted from an interface, notify/abort all sockets
that have that address as a source.  Switch IGMP and multicasts to use pools
for allocation.  Fix a number of potential problems in the igmp code where
allocation failures could cause a trap/panic.
2003-06-15 02:49:32 +00:00
onoe 7dad9f7d8a For loopback interface, assign ia_dstaddr instead of just changing reference
to ifa_dstaddr.  This fixes the problem that assigning more than 2 IPv4
aliases to loopback interface fails to create routing table entry.
2003-06-13 07:59:57 +00:00
itojun f05831c62a separate RFC2292 decls for MLD; sync w/ kame 2003-06-06 09:37:29 +00:00
itojun 7a5741651c - sync up MLD declaration with RFC3542 (s/MLD6/MLD/)
- routing header declaration with RFC3542
  (note: sizeof(ip6_rthdr0) has changed!)
  also, sync up with RFC2460 routing header definition (no "strict" source
  routing mode any more)

part of advanced API update (RFC2292 -> 3542).
2003-06-06 08:13:43 +00:00
itojun 7cc3e999f7 inherit IPV6_V6ONLY from listening socket. PR 21713 2003-05-30 01:15:04 +00:00
itojun f46a719b5c can't use M_WAIT here, i believe. 2003-05-27 22:36:38 +00:00
yamt 63cb165a80 - don't pass mbufs with M_CSUM_* flags which isn't supported by the interface
to if_output.
- offload ip-checksumming for each fragmented packets as well.
2003-05-26 15:12:11 +00:00
itojun 6ca34aa391 no need for ip_v recovery in output path too
(tcp_template includes ip_v setting)
2003-05-17 17:16:20 +00:00
itojun b29a40989d ip checksum logic no longer damage ip_v 2003-05-17 17:08:15 +00:00
itojun 4008ec1218 use strlcpy 2003-05-16 03:56:49 +00:00
itojun f41cda35e4 more KNF 2003-05-14 17:28:31 +00:00
itojun 560bd2fe2e more KNF 2003-05-14 17:18:36 +00:00
itojun f53c3317b8 wrap multiline macro by do {} while (0) 2003-05-14 16:57:03 +00:00
itojun caa10ced69 constcond 2003-05-14 16:52:53 +00:00
itojun 716a9823dd KNF 2003-05-14 16:43:44 +00:00
itojun 346e0198f0 always use PULLDOWN_TEST codepath. 2003-05-14 06:47:33 +00:00
bjh21 ff81b6d549 Header cleanup: Hide all of this file apart from the socket options
from POSIX/XNS applications.
2003-05-05 14:36:13 +00:00
itojun e6eb2671ed clear m_flags just for safety 2003-05-02 02:13:16 +00:00
bjh21 4be7a2dcf3 Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
  can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
  various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
  !defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them.  In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.
2003-04-28 23:16:11 +00:00
itojun afdd63b90b remove redundant adjustment of m->m_pkthdr.len 2003-04-21 08:14:45 +00:00
itojun cb30d7ce0b correct arg to m_pullup (need to count IP header size as well) 2003-04-21 07:02:31 +00:00
itojun a81c148373 correct (false) assumptions on mbuf chain. not sure if it really helps, but
anyways, it is necessary to perform m_pullup.
2003-04-21 06:52:47 +00:00
christos 9b6eb382c2 PR/2352: Tor Egge: Add sysctl to get uid of connected socket. 2003-04-19 20:58:35 +00:00
tron 2dcd4d2952 Clear hardware checksum flags before reusing a mbuf for an ICMP reply as
suggested by Enami Tsugutomo. This fixes PR kern/21203 by myself.
2003-04-17 16:57:49 +00:00
dogcow 6045dfd329 PR/991: Darren Reed: Add a sysctl (checkinteface) to implement this. This
implementation is taken from FreeBSD, but we default to off.
XXX: We should really do this on a per ifaddr basis as jason suggested.
2003-04-12 00:17:49 +00:00
christos 565d9732ff PR/991: Darren Reed: Add a sysctl (checkinteface) to implement this. This
implementation is taken from FreeBSD, but we default to off.
XXX: We should really do this on a per ifaddr basis as jason suggested.
2003-04-11 19:41:37 +00:00
dogcow 5ee791c103 bring into conformance with RFC 3514 2003-04-01 07:39:47 +00:00
lukem b1026bf11c Enable check in in_pcbbind() to enforce sin_family == AF_INET.
If there are any "old programs which incorrectly set this" left,
they will now fail with EAFNOSUPPORT.
This make in_pcbbind() consistent with in_pcbconnect() and the other
protocol families.

As per my PR [kern/4441], which has the comment:
	Steven's "TCP/IP Illustrated, Volume 2", page 730, notes that
	in_pcbbind() has the check which determines if sin_family == AF_INET
	commented out, but the same check in in_pcbconnect() is still active.
2003-03-16 03:33:28 +00:00
ragge be084ba94f vax -> __vax__. Didn't I fix this a year ago? 2003-03-05 13:19:59 +00:00
thorpej cdf1b0026c Allow TCP connections to hosts on a local network to use a larger
slow start initial window.  Default this larger initial window to
4 packets, allowing it to be adjusted with net.inet.tcp.init_win_local.
2003-03-01 04:40:27 +00:00
matt 65e5548a17 Add MBUFTRACE kernel option.
Do a little mbuf rework while here.  Change all uses of MGET*(*, M_WAIT, *)
to m_get*(M_WAIT, *).  These are not performance critical and making them
call m_get saves considerable space.  Add m_clget analogue of MCLGET and
make corresponding change for M_WAIT uses.
Modify netinet, gem, fxp, tulip, nfs to support MBUFTRACE.
Begin to change netstat to use sysctl.
2003-02-26 06:31:08 +00:00
he 27bc436921 Swap neighboring lines of callout_init() and bzero() of container
struct in syn_cache_add(); the bzero() invalidates whatever
callout_init() has done (which might matter, but presently doesn't).
2003-02-25 22:12:24 +00:00
thorpej 73fe03a9d6 Comment out the inclusion of <uvm/uvm_extern.h> -- the header is not
necessary.
2003-02-24 22:12:57 +00:00
thorpej 2ee9a875f2 Use callout_setfunc() and callout_schedule(). 2003-02-04 03:31:32 +00:00
thorpej 882dec6ba3 Test callout_pending(), not callout_active(), and eliminate now-unnecessary
callout_deactivate() calls.
2003-02-03 23:50:59 +00:00
thorpej d133a4da92 M_SOOPTS -> MT_SOOPTS 2003-01-30 23:43:33 +00:00
wiz 9115df8c49 success, not sucess. Noted by mjl. 2003-01-28 22:35:02 +00:00
kleink 8fb0c069dc C++ does not permit static a data member to have the same name as its
class, so in a C++ environment rename the ip_opts member to Ip_opts as
observed in several other implementations; from Jon Olsson in
PR toolchain/19880.
2003-01-27 09:57:09 +00:00
itojun 4d7a2eb391 correct panic when ip-in-ip encapsulation is used. found by Masanori Kanaoka 2003-01-21 03:23:44 +00:00
simonb f16a426a0f Remove variables that are only assigned too but not referenced. 2003-01-19 23:57:01 +00:00
itojun 40606ab8f2 switch from kame-based m_aux mbuf auxiliary data, to openbsd m_tag
implementation.  it will simplify porting across *bsd (such as kame/altq),
and make us more synchronized.  from Joel Wilsson
2003-01-17 08:11:49 +00:00
wiz 617b132aac Spell output with two ts. 2003-01-04 23:43:02 +00:00
atatat 89b889a8a7 Always recompute the IP checksum, otherwise fast-routed packets that
also get natted leave with an invalid checksum which can prevent
things from working properly.
2002-12-11 16:33:11 +00:00
lukem 0635de35a3 Remove KDIR=, since SYS_INCLUDE=symlinks and KDIR are not supported any more. 2002-11-26 23:30:07 +00:00
simonb 85a8258aac The "osrc" variable in gre_mobile_input() is only ever set but not
referenced; remove it.
2002-11-25 23:37:08 +00:00
thorpej d6f8cc841d Avoid strict-alias warnings. 2002-11-25 01:55:21 +00:00
scw 5521093d4b Quell an uninitialised variable warning. 2002-11-24 10:52:47 +00:00
scw 5b169b8d2e Fix a genuine uninitialised variable warning. 2002-11-24 10:51:56 +00:00
dyoung 9a9deae382 Squash a panic: do not try to print the name of a NULL interface. 2002-11-20 03:52:08 +00:00
itojun 50a545a34b remove all entries in rt timer queue on ip_mtudisc change, instead of
destroying the queue.
2002-11-12 02:10:13 +00:00
itojun 6a151fcce1 ckout previous - doesn't compile 2002-11-12 01:57:07 +00:00
itojun 9a8b644578 update ip_mtudisc sysctl change handling. 2002-11-12 01:38:09 +00:00
itojun c8a8326600 make USE_ENCAPCHECK (in netinet*/*gif.c) to global option, GIF_ENCAPCHECK.
#ifdef out unneeded code when possible.
From: Krister Walfridsson <cato@df.lth.se>
2002-11-11 18:35:27 +00:00
itojun e80a17da7b always create pmtud timeout queue, as ip_mtudisc can be tweaked via
sysctl at runtime.  From lha@stacken.kth.se
2002-11-10 19:52:16 +00:00
thorpej 55cd2960c9 In the IP_HDRINCL case of rip_output(), if the mbuf is read-only
then copy the header into a new mbuf before modifying it.

Fixes PR 18809.  Thanks to Chuq Silvers for diagnosing it.
2002-11-07 17:49:08 +00:00
thorpej 62b2879585 Fix signed/unsigned comparison warnings. 2002-11-07 07:15:19 +00:00
itojun 29ef3e950d improve gif lookup performance, when there are many of those,
by using radix tree for lookups.  tested by yshimizu@iij.
2002-11-05 16:58:11 +00:00
fair caee39d926 Add required IPSEC #include files that prevented this from compiling. 2002-11-05 02:07:25 +00:00
itojun 61eed162b2 cleanup ipsec.h dependency. commented by perry, sync w/kame 2002-11-02 19:03:44 +00:00
perry 6858187df6 /*CONTCOND*/ while (0)'ed macros 2002-11-02 07:20:42 +00:00
jdolecek e0cc03a09b merge kqueue branch into -current
kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
2002-10-23 09:10:23 +00:00
lukem 3b5f6123fa fix typo in previous: s/tip/top/ 2002-10-22 07:22:19 +00:00
thorpej 163bdfc19e Make sure TF_REQ_TSTMP and TF_REQ_SCALE get set correctly in the new
TCPCB in the passive-open case.

Fixes PR 18677.
2002-10-22 04:24:50 +00:00
simonb d79a5f79da Guard use of "ostate" with #ifdef TCP_DEBUG in tcp_usrreq().
Don't put semicolons at the end of "#define token value".
2002-10-22 03:14:16 +00:00
simonb 4dd4549b31 Guard use of "so" in tcp_timer_persist() and tcp_timer_2msl() with
#ifdef TCP_DEBUG.
2002-10-22 03:11:03 +00:00
simonb ce9de06a5d In tcp_input():
Remove the set-but-not-used "proto" variable.
 Guard the "ostate" variable in #ifdef TCP_DEBUG.
Remove the set-but-not-used "parentinpcb" variable in syn_cache_get().
2002-10-22 03:07:06 +00:00
simonb 8b9702b758 Micro-optimisation: don't check if the high bit is set and then mask it
off - just mask it off anyways.  Saves a branch 50% of the time.
2002-10-22 02:53:59 +00:00
simonb ddac8bbac4 Oops, still need the call to va_arg() to advance the args pointer. 2002-10-22 02:44:34 +00:00
simonb da0d919807 "off" in rip_input() is set but not used, remove it.
static global "ripsrc" is never used, remove it.
2002-10-22 02:34:47 +00:00
simonb e6a79d25e7 "error" in in_pcbbind() was only ever set but not used, remove it. 2002-10-22 02:31:16 +00:00
simonb dc50de01ff "newifaddr" in in_control() was set but never used, remove it. 2002-10-22 02:28:47 +00:00
itojun 2fffb9beb4 correct log_refused check (TH_SYN, !TH_RST and !TH_ACK). PR 18669 2002-10-16 15:15:28 +00:00