Commit Graph

1521 Commits

Author SHA1 Message Date
yamt b211b85ff4 wrap INET-only code by #if defined(INET). 2005-08-10 13:07:21 +00:00
yamt f02551ec2d move {tcp,udp}_do_loopback_cksum back to tcp/udp
so that they can be referenced by ipv6.
2005-08-10 13:06:49 +00:00
yamt 8220c378e6 device independent part of ipv6 rx checksum offloading. 2005-08-10 13:05:16 +00:00
yamt 40a140d919 ipv6 tx checksum offloading. reviewed by Jason Thorpe. 2005-08-10 12:58:37 +00:00
elad 6439f2618f Add sysctls for IP, ICMP, TCP, and UDP statistics. 2005-08-05 09:21:25 +00:00
gdt e25f2a0d87 Restore to working order; this has apparently been nonworking since
the decapsulator dispatch changes in 2001.  Problems found and fixed
by Christine Jones of BBN.  Specifically:

Check for a packet's protocol to be ENCAP_PROTO, not AF_INET.

Remove one-back cache for last vif, because vif_encapcheck is called
for each vif, rather than being expected to find the appropriate vif.
The cache usage caused packets to be input on the wrong vif and hence
usually dropped.

In vif_encapcheck, verify the local source as well.  While mrouted
endeavors not to create multiple tunnels with a peer, a packet
arriving with the wrong local address is still wrong and should not be
accepted.  (This is a correctness nit, not a security issue.)  Order
checks to fail quickly for packets being checked to see if they match
a vif other than the one they belong on (essentially, check peer
source address in outer header first).

Claim 69 bits of match (32 each from outer src/dst and 5 from checking
that inner dst is within 224/5).  This should result in the vif having
a higher priority for multicast packets compared to a parallel gif(4)
tunnel, and that both seems appropriate if both are configured and
seems to match the semantics expected by the decapsulator dispatch
machinery.

(These changes were made in 2.99.15 and about a dozen nodes are
running them with many vifs.  ip_mroute.c has not changed
significantly since then (February 2005) and the changes applied
cleanly to current and compile cleanly.)
2005-08-03 18:20:11 +00:00
christos afe9d603ec PR/30844: Gert Doering: Non-inet traffic is passed to bpf incorrectly (as inet) 2005-07-26 21:26:48 +00:00
riz fba9a3bda6 Add a definition for TCPOLEN_SIGLEN from OpenBSD, so a kernel with
options TCP_SIGNATURE will compile again after the new PMTU checks
were brought in from OpenBSD.  Approved by christos.
2005-07-21 17:32:11 +00:00
he 4047396e46 Make this build without INET6. 2005-07-20 08:05:43 +00:00
christos 89940190d0 Implement PMTU checks from:
http://www.gont.com.ar/drafts/icmp-attacks-against-tcp.html

1. Don't act on ICMP-need-frag immediately if adhoc checks on the
advertised MTU fail. The MTU update is delayed until a TCP retransmit
happens.
2. Ignore ICMP Source Quench messages meant for TCP connections.

From OpenBSD.
2005-07-19 17:00:02 +00:00
gdt b0239c745e Add PR_PURGEIF flag for protocols to indicate that the protocol might
store a struct ifnet *, and define it for udp/tcp/rawip for INET and
INET6.  When deleting a struct ifnet, invoke PRU_PURGEIF on all
protocols marked with PR_PURGEIF.  Closes PR kern/29580 (mine).
2005-07-19 12:58:24 +00:00
xtraeme 997ffdbad9 Move ipl.h into the ipfilter block, which is the right place. 2005-07-09 14:15:11 +00:00
christos a85b0c68e0 Normalize our PAWS code with Free and Open, as mentioned in tech-security. 2005-06-30 02:58:28 +00:00
seanb d7185c5796 - Return ICMP_UNREACH_NET when no route found as per
section 4.3.3.1 of rfc1812.
2005-06-28 19:38:58 +00:00
drochner de48323ae9 typo in comment 2005-06-28 19:16:02 +00:00
mlelstv d23f1d6e16 expire cached route. Fixes PR 22792. 2005-06-26 10:39:21 +00:00
atatat df13e3579e Change the rest of the sysctl subsystem to use const consistently.
The __UNCONST macro is now used only where necessary and the RW macros
are gone.  Most of the changes here are consumers of the
sysctl_createv(9) interface that now takes a pair of const pointers
which used not to be.
2005-06-20 02:49:18 +00:00
atatat 420d91208b Properly fix the constipated lossage wrt -Wcast-qual and the sysctl
code.  I know it's not the prettiest code, but it seems to work rather
well in spite of itself.
2005-06-09 02:19:59 +00:00
yamt 0e70c535bf tcp_input: don't overload opti.ts_ecr. 2005-06-06 12:10:09 +00:00
martin 71d020f371 Since we decided "const struct mbuf *" would not do the right thing (tm),
remove ~all const from mbuf pointers.
2005-06-06 06:06:50 +00:00
martin 4ba4736381 Adapt to ip_encap.h constification. 2005-06-06 04:51:06 +00:00
christos 578e0f23a2 make this compile again. 2005-06-06 02:47:59 +00:00
martin 782608e87b Sprinkle some const 2005-06-03 21:40:56 +00:00
tron c86b2622dd Change the first argument of the encapsulation check function from
"const struct mbuf *" to "struct mbuf *". Without this change the
actual implementation cannot even use m_copydata() on the mbuf chain
which is broken.
2005-06-02 15:21:35 +00:00
tron 41dcb3a310 Remove type casts and lint directives which are now longer necessary
because the first argument of m_copydata() is "const struct mbuf *" now.
2005-06-02 10:54:58 +00:00
riz c86368208b Fix some const fallout. 2005-06-02 04:40:46 +00:00
drochner 49d230fa91 need a "const" 2005-06-01 12:27:15 +00:00
blymn e703150707 Unconstify rnode to prevent compile error when GATEWAY option set. 2005-06-01 09:45:15 +00:00
christos ea2d4204b6 - add const
- remove bogus casts
- avoid nested variables
2005-05-29 21:41:23 +00:00
christos 00c7362be7 change casts to proper unconst. mark XXXUNCONST 2005-05-29 21:40:27 +00:00
christos 52d3dc717e - remove local copy of hexdigits.
- sprinkle const
- use mem*() instead of b*()
2005-05-29 21:39:21 +00:00
christos 5e5ed54bfe remove stupid hand-rolled loop and kernel conditional. 2005-05-29 21:38:37 +00:00
yamt f398966b60 tcp_output: account FIN when building sack option. 2005-05-08 04:52:05 +00:00
yamt a448e5be5b tcp_output: don't try to send more data than we have. PR/30160. 2005-05-08 04:51:05 +00:00
yamt 0afea4b00f tcp_output: clear TH_FIN where appropriate. related to PR/30160. 2005-05-08 04:48:47 +00:00
yamt b8690cc289 tcp_sack_option: ignore sack beyond snd_max. 2005-05-08 04:46:20 +00:00
christos 761bd09636 PR/30154: YAMAMOTO Takashi: tcp_close locking botch
chgsbsize() as mentioned in the PR can be called from an interrupt context
via tcp_close(). Avoid calling uid_find() in chgsbsize().
- Instead of storing so_uid in struct socketvar, store *so_uidinfo
- Add a simple lock to struct uidinfo.
2005-05-07 17:42:09 +00:00
matt 89ba134744 Add #include <sys/protosw.h> when _KERNEL 2005-05-06 04:28:37 +00:00
martti 840228057a Install netinet/ipl.h (bin/30095) 2005-05-01 14:57:27 +00:00
manu e0d963d34b Fix memory leak 2005-04-29 13:06:23 +00:00
yamt 34c3fec469 move decl of inetsw to its own header to avoid array of incomplete type.
found by gcc4.  reported by Adam Ciarcinski.
2005-04-29 10:39:09 +00:00
manu cddc307094 Fix build problem after recent NAT-T changes 2005-04-26 05:37:45 +00:00
manu 52786ce730 Don't sleep when handling ESP over UDP packets. 2005-04-25 20:37:06 +00:00
manu 455d55f55b Enhance IPSEC_NAT_T so that it can work with multiple machines behind the
same NAT.
2005-04-23 14:05:28 +00:00
yamt 23cd288d37 ip_output: handle the case M_CSUM_TSOv4 but !IFCAP_TSOv4. 2005-04-18 22:06:28 +00:00
yamt fa67035590 add a function to handle M_CSUM_TSOv4 by software. 2005-04-18 21:55:06 +00:00
yamt e5a2b5a4a4 fix problems related to loopback interface checksum omission. PR/29971.
- for ipv4, defer decision to ip layer as h/w checksum offloading does
  so that it can check the actual interface the packet is going to.
- for ipv6, disable it.
  (maybe will be revisited when it implements h/w checksum offloading.)

ok'ed by Jason Thorpe.
2005-04-18 21:50:25 +00:00
yamt 0b4d50d7bd when doing TSO, avoid to use duplicated ip_id heavily.
XXX ip_randomid
2005-04-07 12:22:47 +00:00
kurahone f7707899c1 Added sysctl tunable limits for the number of maximum SACK holes
per connection and per system.

Idea taken from FreeBSD.
2005-04-05 01:07:17 +00:00
yamt 4b935040d0 tcp_input: update a comment to match with the code. 2005-04-03 05:02:46 +00:00