Commit Graph

954 Commits

Author SHA1 Message Date
christos 1665d5e960 fix spelling of accommodate; from Zapher. 2006-11-24 19:46:58 +00:00
yamt 809ec70bcf implement ipv6 TSO.
partly from Matthias Scheler.  tested by him.
2006-11-23 19:41:58 +00:00
rpaulo 5423539f94 New EtherIP driver based on tap(4) and gif(4) by Hans Rosenfeld.
Notable changes:
	* Fixes PR 34268.
	* Separates the code from gif(4) (which is more cleaner).
	* Allows the usage of STP (Spanning Tree Protocol).
	* Removed EtherIP implementation from gif(4)/tap(4).

Some input from Christos.
2006-11-23 04:07:07 +00:00
dyoung 810f665a21 Use LIST_/TAILQ_ macros, esp. LIST_FOREACH() and TAILQ_FOREACH().
Use the usual idiom for iterating over a list where we might
_REMOVE() entries,

        for (x = TAILQ_FIRST(...); x != NULL; x = nx) {
                nx = TAILQ_NEXT(x, ...);
                ...
        }
2006-11-20 04:34:16 +00:00
dyoung 3df10e0d11 Cosmetic: use LIST_ macros. Shorten some staircases.
Defensive programming: set an in6_multi's ifaddr reference to NULL
after releasing it, to protect against reuse.
2006-11-20 04:26:22 +00:00
dyoung df200b9f49 Use TAILQ_FOREACH(). 2006-11-20 04:17:57 +00:00
dyoung 8ce3cb1edc Use the TAILQ_/LIST_ macros instead of open-coding them. 2006-11-20 04:16:27 +00:00
dyoung c02f6943e0 Cosmetic: join two lines. 2006-11-20 04:13:28 +00:00
dyoung 61e2e920d9 Remove __P(). Use LIST_ macros instead of accessing lh_first
directly.
2006-11-18 16:23:15 +00:00
dyoung 6a611f0c78 Cosmetic: use TAILQ_FOREACH(). Remove superfluous parentheses from
return statements.
2006-11-18 16:17:55 +00:00
christos 168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
dyoung a25eaede91 Add a source-address selection policy mechanism to the kernel.
Also, add ioctls SIOCGIFADDRPREF/SIOCSIFADDRPREF to get/set preference
numbers for addresses.  Make ifconfig(8) set/display preference
numbers.

To activate source-address selection policies in your kernel, add
'options IPSELSRC' to your kernel configuration.

Miscellaneous changes in support of source-address selection:

        1 Factor out some common code, producing rt_replace_ifa().

        2 Abbreviate a for-loop with TAILQ_FOREACH().

        3 Add the predicates on IPv4 addresses IN_LINKLOCAL() and
          IN_PRIVATE(), that are true for link-local unicast
          (169.254/16) and RFC1918 private addresses, respectively.
          Add the predicate IN_ANY_LOCAL() that is true for link-local
          unicast and multicast.

        4 Add IPv4-specific interface attach/detach routines,
          in_domifattach and in_domifdetach, which build #ifdef
          IPSELSRC.

See in_getifa(9) for a more thorough description of source-address
selection policy.
2006-11-13 05:13:38 +00:00
cbiere 5e6609fb28 Commented out IPv6 socket options which are no longer supported. 2006-10-31 00:29:30 +00:00
mrg 4804ddb2d7 what was <crypto/sha2/sha2.h> and <crypto/ripemd160/rmd160.h> is now
<sys/sha2.h> and <sys/rmd160.h>.
2006-10-27 22:50:28 +00:00
christos 31a62606ea Merge kernel and userland rmd160 and sha2 implementation.
XXX: We still install rmd160.h and sha2.h in /usr/include/crypto, unlike
the other hash functions which get installed in /usr/include for compatibility.
2006-10-27 21:20:48 +00:00
christos 95809f6403 use portable bitfields. 2006-10-17 14:52:21 +00:00
dyoung a42ff4b405 Make SIOCALIFADDR work for adding IPv6 addresses: initialize the
lifetime of the addresses to infinity (ND6_INFINITE_LIFETIME).

Nobody squealed when I proposed this on tech-net.
2006-10-15 07:00:44 +00:00
christos 4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
dogcow 55ddfc9aae change the MOWNER_INIT define to take two args; fix extant struct mowner
decls to use it. Makes options MBUFTRACE compile again and not whinge about
missing structure declarations. (Also makes initialization consistent.)
2006-10-10 21:49:14 +00:00
tls 8cc016b4bc Protect calls to pool_put/pool_get that may occur in interrupt context
with spl used to protect other allocations and frees, or datastructure
element insertion and removal, in adjacent code.

It is almost unquestionably the case that some of the spl()/splx() calls
added here are superfluous, but it really seems wrong to see:

	s=splfoo();
	/* frob data structure */
	splx(s);
	pool_put(x);

and if we think we need to protect the first operation, then it is hard
to see why we should not think we need to protect the next.  "Better
safe than sorry".

It is also almost unquestionably the case that I missed some pool
gets/puts from interrupt context with my strategy for finding these
calls; use of PR_NOWAIT is a strong hint that a pool may be used from
interrupt context but many callers in the kernel pass a "can wait/can't
wait" flag down such that my searches might not have found them.  One
notable area that needs to be looked at is pf.

See also:

http://mail-index.netbsd.org/tech-kern/2006/07/19/0003.html
http://mail-index.netbsd.org/tech-kern/2006/07/19/0009.html
2006-10-05 17:35:19 +00:00
is ed48e2c326 Fix typo in comment 2006-09-26 11:55:41 +00:00
dyoung 71522fb484 Simplify and repair icmp6_input() to stop the kernel from panicking
in m_copydata() when an ICMP6_ECHO_REQUEST is received, as reported
by Tatoku Ogaito on current-users@.
2006-09-05 16:11:26 +00:00
christos d13620d51a comment out impossible comparison. 2006-09-03 05:16:59 +00:00
christos 7ca3c62d31 - fix initializers
- add const
- remove dead code
2006-09-02 07:22:44 +00:00
dyoung 19ce2e4680 Vastly simplify the code that copies an ICMP6 packet to two data
paths: ICMP6 reply path, and socket path.
2006-09-01 02:44:46 +00:00
dyoung cb88bdd489 Re-use macro IN6_IS_SCOPE_EMBEDDABLE(). 2006-09-01 02:25:29 +00:00
dyoung f583dae6cb Restore historical kernel behavior: let an application bind(2) an
IPv6 interface address (e.g., sin6_addr fe80::200:24ff:fec3:4bac
sin6_scope_id 1), set a multicast interface with
setsockopt(,IPPROTO_IPV6,IPV6_MULTICAST_IF,), and sendto(2) multicast
destinations with "wildcard" scope ID, 0, without error EHOSTUNREACH.

Prior to this patch, sendto(2) would exit with EHOSTUNREACH, even
though the scope ID was unambiguously specified both by bind(2)
and setsockopt(2).  This was a bug because it broke old applications.

Thanks JINMEI Tatuya for the patch!
2006-09-01 01:59:56 +00:00
christos e07cc888fc remove empty code. 2006-08-30 19:15:05 +00:00
christos e8c80b0ceb remove impossible comparisons. 2006-08-30 17:15:22 +00:00
christos ff89ad5027 fix initializers 2006-08-30 17:13:45 +00:00
christos 966c4b104a Fix initializers. 2006-08-30 17:11:53 +00:00
christos ca0d162d55 add missing initializers 2006-08-30 17:05:30 +00:00
christos 86fad06b76 declare the type of code. 2006-08-30 15:25:08 +00:00
christos d65306455b comment out comparison always false 2006-08-30 01:23:35 +00:00
christos ef6c9d757e fix incomplete initializer 2006-08-30 01:17:09 +00:00
christos 588c80f975 remove extra members 2006-08-28 02:51:12 +00:00
christos 8f1ca4d223 gc unused member. 2006-08-27 23:55:16 +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
matt 1b21337267 Don't include <netccitt/x25.> and don't bother checking for SIOCSIFCONF_X25. 2006-08-25 18:29:17 +00:00
christos 35ca6c8b5b Fix all the -D*DEBUG* code that it was rotting away and did not even compile.
Mostly from Arnaud Lacombe, many thanks!
2006-08-17 17:11:27 +00:00
ad f474dceb13 Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +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
tron 8fe4e4040d Clear mbuf checksum flags before passing it to ip6_output(). We might
recycle a mbuf which contained a hardware provided checksum. This
fixes "traceroute6" to a machine which is using a wm(4) interface
that has UDP or TCP checksum offload enabled.
2006-07-11 22:13:56 +00:00
rpaulo 4e0b046439 Add a missing piece from RFC 3542. KAME-NetBSD-current branch
revision 1.1.1.2.2.5:
	do not call pfctlinput2(PRC_MSGSIZE) on fragmentation to avoid
	notification storm

From Keiichi SHIMA:
  "In the current NetBSD code, the PRC_MSGSIZE message will be generated
   for every fragmented packets when a node is trying to send a big
   packet. That was the intermediate behavior while RFC3542 was under
   discussion."

By (obviously) the KAME project.
2006-07-08 19:58:40 +00:00
liamjfoy 56054d1bbb Fix a minor printf found while reading the code 2006-06-29 16:56:31 +00:00
drochner 7d0c55ee34 fix the dad_count logic: if we send a packet successfully, reset the counter
for sent tries -- otherwise it gets confused if dad_count is set to >15
by the sysctl, and addresses get stuck in "tentative" state forever
2006-06-28 16:43:43 +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
dogcow 5e988d30ba include <netccitt/x25.h> for the SIOCSIFCONF_X25 case in in6_control. 2006-06-03 06:56:43 +00:00
christos 26deb5021a Fix typo. 2006-06-03 01:43:47 +00:00
christos 7353ed65a9 add 2 more ioctls that use struct ifaddr *, and remove debugging printfs
I accidentally committed.
2006-06-03 01:32:52 +00:00