Commit Graph

1612 Commits

Author SHA1 Message Date
rpaulo 2fb2ae3251 Import of TCP ECN algorithm for congestion control.
Both available for IPv4 and IPv6.
Basic implementation test results are available at
http://netbsd-soc.sourceforge.net/projects/ecn/testresults.html.

Work sponsored by the Google Summer of Code project 2006.
Special thanks to Kentaro Kurahone, Allen Briggs and Matt Thomas for their
help, comments and support during the project.
2006-09-05 00:29:35 +00:00
liamjfoy 3c3d7131af increment ips_total too.
ok matt thomas
2006-09-02 12:41:01 +00:00
dyoung 47be766fd3 Add a mode to gre(4) that sends GRE tunnel packets in UDP datagrams.
Fix MOBILE encapsulation.  Add many debugging printfs (mainly
concerning UDP mode).  Clean up the gre(4) code a bit.  Add the
capability to setup UDP tunnels to ifconfig.  Update documentation.

In UDP mode, gre(4) puts a GRE header onto transmitted packets,
and hands them to a UDP socket for transmission.  That is, the
encapsulation looks like this: IP+UDP+GRE+encapsulated packet.

There are two ways to set up a UDP tunnel.  One way is to tell the
source and destination IP+port to gre(4), and let gre(4) create
the socket.  The other way to create a UDP tunnel is for userland
to "delegate" a UDP socket to the kernel.
2006-08-31 17:46:16 +00:00
christos 2434b8bf99 Fix initializers. 2006-08-30 19:00:22 +00:00
christos da6e78aa67 fix initializer 2006-08-30 18:55:09 +00:00
christos cddf6d88fb static comes first 2006-08-30 18:54:19 +00:00
christos 67cdc0f9ea fix initializers 2006-08-30 18:53:04 +00:00
christos ca0d162d55 add missing initializers 2006-08-30 17:05:30 +00:00
christos dd762fc161 fix initializers and add const. 2006-08-30 16:40:03 +00:00
christos eb6054a9fe Fix initializers 2006-08-30 15:45:54 +00:00
yamt ea6892fdba icmp_input: don't assume relations between PRC_ and ICMP_ values. 2006-08-28 13:46:35 +00:00
christos 82b002de3d Remove excess initializer. 2006-08-28 02:53:03 +00:00
matt 6c8fa3224e One step closer to loadable domains. Store pointers to a domain's soft
interrupt queues so if_detach can remove packets to removed interfaces from
them.  This eliminates a lot of conditional ugly code in if.c
2006-08-25 19:33:50 +00:00
elad 5446ee0ef6 ugh.. more stuff that's overdue and should not be in 4.0: remove the
sysctl(9) flags CTLFLAG_READONLY[12]. luckily they're not documented
so it's only half regression.

only two knobs used them; proc.curproc.corename (check added in the
existing handler; its CTLFLAG_ANYWRITE, yay) and net.inet.ip.forwsrcrt,
that got its own handler now too.
2006-07-30 17:38:19 +00:00
dyoung 7559ef3351 Extract predicate M_UNWRITABLE(m, len), which is true iff len
consecutive bytes at the front of m are writable (i.e., neither
shared nor read-only).
2006-07-28 17:34:13 +00:00
dyoung 8cb43bea43 Fix mtod() usage. If we will write to the mbuf data, check whether
the data is read-only/shared and call m_pullup().  Otherwise,
extract a const pointer to the mbuf data.

XXX I should extract a new macro, M_WRITABLE(m, len), that is true
if m has len consecutive writable bytes at its front.

KNF slightly.

Use bpf_mtap_af().
2006-07-28 17:06:59 +00:00
dyoung bce72f7b6a Fix mtod() usage. If we will write to the mbuf data, check whether
the data is read-only/shared and call m_pullup().  Otherwise,
extract a const pointer to the mbuf data.

XXX I should extract a new macro, M_WRITABLE(m, len), that is true
if m has len consecutive writable bytes at its front.
2006-07-28 17:04:27 +00:00
dyoung ae0b3d534e Where mbuf data may be read-only/shared, use mtod(m, const ...).
Annotate a comparison and m_pullup() that seem unnecessary.
2006-07-28 16:30:55 +00:00
dyoung 788c34d9d0 Use bpf_mtap_af(). KNF slightly. 2006-07-28 16:26:20 +00:00
ad f474dceb13 Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
rpaulo 25ec6d007f revert stuff that shouldn't have gone in. 2006-07-22 17:45:03 +00:00
rpaulo f5f6aa2ed3 TCP RFC is 793, not 783. 2006-07-22 17:39:48 +00:00
elad 77de54cbf0 get rid of CURTAIN() macro. inline the last use of it, together
with a nice XXX comment (assigned to me of course) that we should
be doing this differently.
2006-07-16 21:13:00 +00:00
tron e12e4b2966 Remove test for M_CSUM_TSOv6 flag which is not (yet) defined in
NetBSD-current.
2006-07-12 14:07:02 +00:00
tron 9563ec16dc Add diagnostic checks for hardware-assisted checksum related flags in
the mbuf which supposed to get sent out:
- Complain in ip_output() if any of the IPv6 related flags are set.
- Complain in ip6_output() if any of the IPv4 related flags are set.
- Complain in both functions if the flags indicate that both a TCP and
  UCP checksum should be calculated by the hardware.
2006-07-12 13:11:27 +00:00
peter b794520dcd Wrap long lines, unwrap a short line. 2006-07-10 15:37:26 +00:00
peter fac34f3d31 Moves the PF_GENERATED m_tag to the new packet in icmp_error.
This is needed because the pf code can call icmp_error with setting
this tag, but the new packet should not be filtered when it comes back
to pf(4).

ok christos@
2006-07-10 15:35:39 +00:00
riz a06a21e5d3 Prototype for tvtohz() is no longer needed here. 2006-06-13 15:57:15 +00:00
riz 58d052216c Remove implementation of tvtohz() - since the timecounters branch
was merged, this is now in sys/kern/kern_clock.c .
2006-06-13 15:43:04 +00:00
kardel de4337ab21 merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
  time.tv_sec -> time_second
- struct timeval mono_time is gone
  mono_time.tv_sec -> time_uptime
- access to time via
	{get,}{micro,nano,bin}time()
	get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
  Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
  NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html
2006-06-07 22:33:33 +00:00
liamjfoy 62438e22ea remove some dead code
ok christos@
2006-05-28 11:07:04 +00:00
bouyer 01307555ec Revert rev 1.241: calling m_makewritable() in tcp_input causes problems when
it has to change the mbuf chain. I experience hard hang on a Xen2 domU after
TCP connections have been closed, and a crash has been reported which may be
caused by this too.
2006-05-27 13:35:20 +00:00
bouyer bc93583ffe If we're going to byteswap fields in the TCP header, make sure the mbuf
area is writable first.
2006-05-25 21:49:19 +00:00
bouyer df9be102c5 Make sure the mbuf is writable before trying to write to it. 2006-05-25 21:33:12 +00:00
liamjfoy 14c608becb remove a little white space 2006-05-25 15:22:05 +00:00
liamjfoy d8d9494bf9 Add a check for our own advertisements. This is due to non-simplex
interfaces which received the packets they have just sent.

From: OpenBSD (rev. 1.124)
ok: christos@
2006-05-24 13:39:37 +00:00
liamjfoy 4876c304b1 Integrate Common Address Redundancy Procotol (CARP) from OpenBSD
'pseudo-device	carp'

Thanks to: joerg@ christos@ riz@ and others who tested
Ok: core@
2006-05-18 09:05:49 +00:00
christos fc6d984beb kauth fallout 2006-05-15 00:05:16 +00:00
elad 874fef3711 integrate kauth. 2006-05-14 21:19:33 +00:00
christos 8f60e3b3e5 Comment out attribute packed. Gcc4 warns us that the field is too narrow
for packing. Produces the same size struct on i386 (28 bytes)
2006-05-14 02:34:41 +00:00
mrg 126f7e1139 since ar_tha() can return NULL, don't pass it directly to functions
that expect real addresses.  explicitly KASSERT() that it is not
NULL in the kernel and just avoid using it userland.

(the kernel could be more defensive about this, but, until now it
would have just crashed anyway.)
2006-05-12 01:20:33 +00:00
mrg 084c052803 quell GCC 4.1 uninitialised variable warnings.
XXX: we should audit the tree for which old ones are no longer needed
after getting the older compilers out of the tree..
2006-05-10 21:53:14 +00:00
liamjfoy 64c2ef1711 #if -> #ifdef
ok christos
2006-05-08 18:50:12 +00:00
rpaulo de8db47547 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.
2006-05-05 00:03:21 +00:00
liamjfoy 79f53c18fe - use MAXTTL
ok christos@
2006-04-25 08:29:08 +00:00
christos 49cd195740 Coverity CID 1153: Add KASSERT before deref. 2006-04-15 02:33:41 +00:00
christos 4fd8acf0f3 Coverity CID 1152: Add KASSERT before deref. 2006-04-15 02:32:22 +00:00
christos ddb5372e69 Coverity CID 1149: Add KASSERT before deref. 2006-04-15 02:30:39 +00:00
christos 7a396ae9a9 Coverity CID 1148: Add KASSERT before deref. 2006-04-15 02:29:12 +00:00
christos f190fa88ca Coverity CID 1134: Protect against NULL deref. 2006-04-15 02:24:12 +00:00