Commit Graph

1585 Commits

Author SHA1 Message Date
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
christos 3e3a249d3c Move pf2 assignment after we've assigned pf. 2006-04-15 00:29:25 +00:00
christos 519309ea6e Coverity CID 1154: Prevent NULL deref. 2006-04-14 23:17:24 +00:00
christos 0f609f1bfa Coverity CID 738: Fix the query size vs. result returning setup. 2006-04-14 23:09:16 +00:00
dyoung 4db39a7dbf When reflecting an ICMP Echo, do not scribble over read-only/shared
mbuf storage.
2006-03-29 21:13:55 +00:00
seanb c6d79d21de Slight simplification of hdr len calculation in tcp_segsize().
No functional change.
2006-03-25 13:34:35 +00:00
matt 4c71408df5 An MTU can't be negative so store them in unsigned variables. 2006-03-22 01:07:24 +00:00
wiz e2a71c2aab 'advertisment' -> 'advertisement', from leonardo chiquitto filho
via jmc@openbsd.
2006-03-07 18:15:28 +00:00
rpaulo 8c2379fd97 NDP-related improvements:
RFC4191
	- supports host-side router-preference

	RFC3542
	- if DAD fails on a interface, disables IPv6 operation on the
          interface
	- don't advertise MLD report before DAD finishes

	Others
	- fixes integer overflow for valid and preferred lifetimes
	- improves timer granularity for MLD, using callout-timer.
	- reflects rtadvd's IPv6 host variable information into kernel
	  (router only)
	- adds a sysctl option to enable/disable pMTUd for multicast
          packets
	- performs NUD on PPP/GRE interface by default
	- Redirect works regardless of ip6_accept_rtadv
	- removes RFC1885-related code

From the KAME project via SUZUKI Shinsuke.
Reviewed by core.
2006-03-05 23:47:08 +00:00
christos 23ecfee197 Handle IPSEC_NAT_T in the FAST_IPSEC case.
XXX: need to fix the FAST_IPSEC code now.
2006-02-23 01:35:19 +00:00
joerg 34096c9b32 Print the source and destination IP in ip_forward's DIAGNOSTIC code
with inet_ntoa, making it more human friendly.

From Liam J. Foy in private mail.
2006-02-18 17:47:07 +00:00
rpaulo ae6865ba83 PR 13952: Noritoshi Demizu: correct the TCP window information update check. 2006-02-18 17:34:49 +00:00
perry fbae48b901 Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.
2006-02-16 20:17:12 +00:00
riz 854279801b If TCP_SIGNATURE is defined, include netinet6/scope6_var.h for the
prototype of in6_clearscope().  Kernels with options TCP_SIGNATURE now
compile again after the IPv6 scoped address changes.
2006-02-02 05:52:23 +00:00
elad 6a22a76f5c fix tyop.
pr 32678 from yves emmanuel jutard.
2006-01-31 17:19:39 +00:00
rpaulo 78678b130a 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@.
2006-01-21 00:15:35 +00:00
perry f8824a9b43 change comment from __const__ to const 2005-12-24 23:43:17 +00:00
perry 0f0296d88a Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 20:45:08 +00:00
christos f01a2f5714 Define INADDR_NONE when we are in the kernel too. 2005-12-20 19:32:30 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
elad 9702e98730 Multiple inclusion protection, as suggested by christos@ on tech-kern@
few days ago.
2005-12-10 23:31:41 +00:00
manu 9d0ec64222 Fix a bug in ESP over UDP: because udp4_espinudp() called m_pullup, it
could modify the struct mbuf and calling functions (udp_input() and
udp4_realinput()) would have used a garbled local copy of the pointer.

The fix is not perfect. udp4_espinudp() should use m_pulldown()...
2005-12-09 15:36:34 +00:00
yamt d3ac0a8b69 revert rev.1.72 as it isn't necessary. 2005-11-22 17:52:38 +00:00
dsl c24781af04 Pass the current process structure to in_pcbconnect() so that it can
pass it to in_pcbbind() so that can allocate a low numbered port
if setsockopt() has been used to set IP_PORTRANGE to IP_PORTRANGE_LOW.
While there, fail in_pcbconnect() if the in_pcbbind() fails - rather
than sending the request out from a port of zero.
This has been largely broken since the socket option was added in 1998.
2005-11-15 18:39:46 +00:00
christos 2fa7cb2348 Remove redundant assignment (from Liam Foy) 2005-11-10 13:40:38 +00:00
christos 8481673c7a Don't decrement the ttl, until we are sure that we can forward this packet.
Before if there was no route, we would call icmp_error with a datagram
packet that has an incorrect checksum. (From Liam Foy)
2005-11-01 21:21:09 +00:00
christos ff7f1eddad No need to pass an interface when only the mtu is needed. From OpenBSD via
Liam Foy.
2005-10-23 18:38:53 +00:00
christos 30756e31a3 small list macro cleanup:
- remove duplicate LIST_FIRST (Liam Foy)
- change to use LIST_FOREACH or for () instead of while () for consistency
2005-10-17 19:51:24 +00:00