Commit Graph

1535 Commits

Author SHA1 Message Date
rpaulo be72809857 Add preliminary/not tested support for IPv6. 2006-02-05 16:44:55 +00:00
cube 97047d48dd Properly dispose of cfdata memory when unloading the tap(4) LKM. 2006-02-01 05:51:58 +00:00
martin 0975a4b449 Make sure error messages (received from the access concentrator) are
zero terminated.
2006-01-31 23:50:15 +00:00
rpaulo 219ca2b318 Replace the comment that came from if_loop.c many years ago by
something that matches reality.
2006-01-31 22:27:15 +00:00
christos f0551e03f4 PR/32676: Yves-Emmanuel JUTARD: faithprefix should only be defined with INET6 2006-01-31 17:15:20 +00:00
jdolecek 8ce024013a fix VLAN_ATTACHED() macro, it was always true due to condition bug
Fixes PR kern/32645 by Pavel Cahyna
2006-01-29 09:57:59 +00:00
rpaulo e4a54dec0a Reflect reality (ktrace-lwp). 2006-01-28 01:49:58 +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
christos 4dde6a6d1b Make sure that breq is also cleared (from Xin LI) 2006-01-17 13:23:02 +00:00
christos a94f0325fe zlib 1.2.3 changed the include protection variable names; adjust. 2006-01-14 20:17:12 +00:00
christos 81a0859118 prepare for userland compilation. 2006-01-14 18:58:05 +00:00
christos 1482d7ce1c Make sure we initialize all structs to 0; from Xin LI 2006-01-09 13:04:38 +00:00
perry 23917a5e48 #ifdef _KERNEL some function prototypes and an inline function
definition.

XXX It may be that this file needs more namespace cleaning (or the
files that include it, like if.h, might need it.)
2006-01-04 21:10:09 +00:00
yamt 95b350ea52 ppp_dequeue: fix a mbuf leak/packet loss introduced by rev.1.104. 2006-01-02 01:42:36 +00:00
christos fffd2322a9 make this compile with no INET option 2005-12-28 09:08:20 +00:00
christos cab48fd783 PR/5901: Felix A. Croes: PPP fast queue blocks traffic at normal priority.
Applied fix, similar to the one suggested in the PR. We use a counter to
limit the number of consecutive packets accepted from the fast queue. This
number can be set via ioctl, but this has not been implemented. Since there
are only 2 queues other proposed solutions such as ALTQ are overkill and
they have not been implemented in the past 7 years. Now LCP echos can be
used to detect that the line is up.
2005-12-28 08:13:24 +00:00
rpaulo 7eace3f40d Kill BPF_KERN_FILTER. Seems like it died with the new pppd import.
No replies from tech-kern@, but who introduced this option 8 years ago
(Christos) said it's ok to remove it.
2005-12-26 15:45:48 +00:00
perry 0f0296d88a Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 20:45:08 +00:00
rpaulo 08ac963d6f Correct typo in comments. 2005-12-14 22:46:52 +00:00
rpaulo 43bb9c133c Fix previous commit: ABS, IND and MSH are valid codes. 2005-12-14 20:33:46 +00:00
christos 49743c0da1 argument type conflict. 2005-12-14 00:28:08 +00:00
rpaulo 7174b22dd3 In bpf_validate(), get rid of bpf_maxbufsize test as there are other
clients of bpf_filter(), like if_ppp, that are not limited by
bpf_maxbufsize. The same check is done at the run time, so there is no
problem created.

Noticed by Guy Harris in private email.
2005-12-13 23:53:49 +00:00
thorpej 63eac52bac ANSI function decls and application of static. 2005-12-11 23:05:24 +00:00
christos b41db3f2c3 Protect zlib.h with the same symbol as userland.
XXX: We should either not install this, or have only one copy.
2005-12-11 19:15:38 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
elad 976bf6cfdd Multiple inclusion protection, as suggested by christos@ on tech-kern@
few days ago.
2005-12-10 23:21:38 +00:00
christos a8ffde9f61 make the ALTQ macros statement-line, by wrapping them in do {} while (0) 2005-12-06 02:56:25 +00:00
rpaulo 5eb6226d2b Oops, the previous revision had a wrong pre-processor #if clause. 2005-12-05 22:38:40 +00:00
rpaulo 7246666eed Make the bpf_maxbufsize a constant when bpfilter pseudo-device is not
present in the kernel config, thus fixing the build. Problem reported
by Havard Eidnes. Solution proposed by Christos, thanks.
2005-12-05 21:46:00 +00:00
rpaulo fe7fedbe4c PR 32198: bpf_validate() needs to do more checks, from Otto Moerbeek/OpenBSD
via Guy Harris.
Problems like out-of-bounds read/write in filter machine operations
were fixed.
2005-11-30 23:14:38 +00:00
rpaulo 5a418776bf More KNF. C99 uintXX_t types. 2005-11-30 22:40:59 +00:00
rpaulo 940d1d8665 Replace u_intXX_t by their C99 counterparts. 2005-11-30 16:47:58 +00:00
rpaulo 33ea9f9f29 Fix typo in comment found by Guy Harris (PR 32198). 2005-11-30 12:54:42 +00:00
rpaulo 6d95f3bed8 KNF. ANSYfy. de-P(). 2005-11-30 12:52:23 +00:00
thorpej 7d00e1aff3 Overhaul how TTY line disciplines are handled:
- Replace references to linesw[0] with a ttyldisc_default() function
  that returns the default ("termios") line discipline.
- The linesw[] array is gone, replaced by a linked list.
- ttyldisc_add() and ttyldisc_remove() have been replaced by
  ttyldisc_attach() and ttyldisc_detach().
- Things that provide line disciplines are now responsible for
  registering those disciplines with the system.  The linesw
  structures are no longer declared in tty_conf.c
- Line disciplines are now refcounted; a lookup causes a reference to
  be held.  ttyldisc_release() releases the reference.  Attempts to
  detach an in-use line discipline result in EBUSY.
- Fix function signature lossage in if_sl.c, if_strip.c, and tty_tb.c
  that was masked by the old tty_conf.c
- tty_init() is no longer necessary; delete it and its call from main().
2005-11-27 05:35:52 +00:00
yamt 11aa556068 fix a typo in a comment. 2005-11-23 09:43:37 +00:00
yamt 9a01903be3 correct SADB_X_MIGRATE. pointed by Francis Dupont. 2005-10-29 15:05:13 +00:00
yamt 78e012015b add some #if 0'ed out SADB_X_* definitions found in kame tree
to avoid conflicting numbers.
2005-10-25 06:12:49 +00:00
christos 86497ecc9f It is now ``later''. Follow cgd's 1993 wish and move struct osockaddr
and struct omsghdr to a compat header.
2005-09-24 15:52:03 +00:00
rpaulo dc5a3ff210 Use ANSI function declarations everywhere and a consistent indentation on
them.
2005-09-05 18:32:24 +00:00
martin ebe6c135ee Fix bogus uninitialized variable warning ifdef PPPOE_SERVER.
Noticed by Marcin Jessa on current-users.
2005-08-31 00:00:26 +00:00
yamt 2e85eff671 - introduce M_MOVE_PKTHDR and use it where appropriate.
intended to be mostly API compatible with openbsd/freebsd.
- remove a glue #define in netipsec/ipsec_osdep.h.
2005-08-18 00:30:58 +00:00
yamt 03661e8f33 include callout.h explicitly. 2005-08-12 10:02:31 +00:00
kiyohara bbebe4a265 Using DLT_APPLE_IP_OVER_IEEE1394. 2005-08-06 14:09:54 +00:00
rpaulo 2fcfc4c276 Implemented the kernel part of BPF statistics and BPF peers, net.bpf.stats
and net.bpf.peers sysctls respectively.

A new structure was added to describe the external (user viewable)
representation of a BPF file; a new entry was added to the bpf_d
structure to store the PID of the calling process; a simple_lock was added
to protect the insert/removal from the net.bpf.peers sysctl handler.

This idea came from FreeBSD (Christian S.J. Peron) but while it is
implemented with sysctl's it differs a bit.

Reviewed by: christos@ and atatat@ (who gave me the tip for the net.bpf.peers
sysctl helper function).
2005-08-04 19:30:47 +00:00
dyoung 1d1035405a Add members ifr_buf, ifr_buflen to ifreq for specifying the location
and size of a userland buffer.  The kernel shall not copyout more
than ifr_buflen bytes to ifr_buf.  For future ioctls that use
ifr_buf and ifr_buflen instead of ifr_data, the kernel can return
a larger struct in the future than when the ioctl is introduced,
without breaking ABI compatibility, provided that the size, order,
and semantics of the fields at the front of the struct does not
change.
2005-07-27 06:36:15 +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
kiyohara c1a84a4d12 ieee1394 import from FreeBSD. 2005-07-11 15:29:05 +00:00
seanb 262c8cc8a7 - Rearranged layout of struct bridge_iflist slightly to
make members naturally aligned.
- This saves 8 bytes worth of pad.
2005-06-28 20:09:44 +00:00
christos 853504efa1 Add some casts to appease lint 2005-06-28 15:33:27 +00:00
christos bbfb3b7295 Names could be const. 2005-06-26 21:18:00 +00:00
christos 305da7ae35 de-lint some pointer casts. 2005-06-26 20:55:44 +00:00
mlelstv d23f1d6e16 expire cached route. Fixes PR 22792. 2005-06-26 10:39:21 +00:00
peter 26b3362b67 Missing m_freem() in bpf_write. PR/29138. 2005-06-22 10:36:16 +00:00
dyoung 9063402978 Resolve conflicts in importation of 18-May-2005 ath(4) / net80211(9)
from FreeBSD.  Introduce compatibility shims (sys/dev/ic/ath_netbsd.[ch],
sys/net80211/ieee80211_netbsd.[ch]).  Update drivers (an, atu, atw,
awi, ipw, iwi, rtw, wi) for the new net80211(9) API.
2005-06-22 06:14:51 +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
peter 6cfd105f3a Use 'pattr' consistently in the IFQ_* macros. 2005-06-19 11:34:42 +00:00
christos 137b9bc57b 30393/Miles Nordin: PF/ALTQ does not work on ppp(4) interfaces
This is because the mbuf chain created did not have a header.
2005-06-11 22:26:42 +00:00
bouyer 79824021ea As ether_input() is always called at IPL_NET, there is no need to
protect the IF_* operations with splnet()/splx().
2005-06-10 11:11:38 +00:00
bouyer 5ce57a0010 call (ifp->if_input) at splnet(). ifp->if_input points to ether_input()
which doesn't raise the IPL itself in all cases.
Should also fix PR 29546 (the pkgsrc kernel module needs to be updated).
2005-06-10 10:28:17 +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
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
he eae41d3752 Fix -Wcast-qual warning. 2005-06-05 22:31:40 +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
jdc 9e2e82eb16 Fix this properly by renaming the conflicting variables. 2005-06-01 19:45:34 +00:00
jdc ee08c5a2f0 Remove extraneous definition of struct llc (found by shadow warning). 2005-06-01 19:38:13 +00:00
yamt a45d9db267 -Wno-shadow for some pf files.
IMO there is no point to fix them in our tree.
2005-06-01 14:15:46 +00:00
yamt 9019b2a550 make lacp_timer_funcs static. 2005-06-01 13:34:48 +00:00
yamt 88b65022bb constify. 2005-06-01 11:25:01 +00:00
christos 6c547ba0c6 change casts back to char * and explain why. 2005-05-31 01:47:24 +00:00
christos f954cf7e94 Add a CLLADDR macro which is the same as LLADDR only const. Make both macros
return void pointers.
2005-05-30 22:11:47 +00:00
christos 9a118943bd bcopy -> memcpy
bcmp -> memcmp
and remove casts.
2005-05-30 04:17:59 +00:00
christos 333e176687 - sprinkle const
- remove unneeded casts
- use more mem*() instead of b*() funcs.
2005-05-29 21:22:52 +00:00
christos 48aa099255 PR/30285: Mile Nordin: incorrect permission check joining/leaving multicast
groups.
2005-05-20 16:23:05 +00:00
christos 362a4a0bd5 Yes, it was a cool trick >20 years ago to use "0123456789abcdef"[a] to
implement, xtoa(), but I think defining the samestring 50 times is a bit
too much. Defined HEXDIGITS and hexdigits in subr_prf.c and use it...
2005-05-17 04:14:57 +00:00
matt 56bbae8802 rate limit the printfs for oversized ethernet packets. 2005-05-02 21:20:27 +00:00
yamt 330cc0a11e split IFCAP_CSUM_xxx to IFCAP_CSUM_xxx_Rx and IFCAP_CSUM_xxx_Tx. 2005-05-02 15:34:31 +00:00
martin 3cde73812d Fix typo, from C. Plasschaert in PR kern/30069. 2005-04-27 07:48:02 +00:00
martin 691a804898 As noted by Christophe Plasschaert on tech-kern, g/c never used
idletimeout configuration ioctls.
2005-04-27 07:45:52 +00:00
christos 72ad9c4bc4 no point in assigning to ifq twice. 2005-03-31 21:19:35 +00:00
christos 200dc55908 fix compiling with -DALTQ 2005-03-31 21:14:52 +00:00
explorer fcc0a1f852 Fix error with ifq not being set before use. Explicitly set it to NULL just before it may be set to the fastq, since if this becomes a loop (and in one case already is) this will always work. ifq_enqueue2() is designed to handle this case. 2005-03-31 17:07:39 +00:00
christos d7ec95d370 factor out the interface queueing code into two functions. One used by
the non point-to-point interfaces that has one queue, and one used by
the point to point interfaces that has two queues. No functional changes.
XXX: The ALTQ stuff makes the code ugly.
XXX: More cleanup to come
2005-03-31 15:48:13 +00:00
is a0c9bc9616 Add IPv6 over GRE (contributed by Gert Doering in PR 29150). 2005-03-30 16:34:54 +00:00
cube bc5ea6f651 Set bit 0x2 of the first byte of the generated MAC address, to indicate it
is a locally administered address.  Pointed out by Ignatios Souvatzis.
2005-03-24 22:20:35 +00:00
agc dd93d335d3 Fix the spelling of Bill Studenmund's name - noticed from the licences
on the Sony PSP as found in:

	http://www.scei.co.jp/psp-license/pspnet.txt
2005-03-20 07:47:29 +00:00
thorpej 6f219f734d Define IFFBITS and IFCAPBITS here in <net/if.h>. Taken from ifconfig. 2005-03-20 02:51:33 +00:00
yamt 5240b887db add agr(4), a pseudo network device driver for link aggregation. 2005-03-18 11:11:50 +00:00
kleink 513c158344 A couple of <sys/select.h>-related changes:
* Factor out struct selinfo and its header dependencies into its own header,
  <sys/selinfo.h>, to avoid namespace pollution.
* Include <sys/selinfo.h> in user-visible headers where necessary.
2005-03-17 20:39:17 +00:00
yamt 0c03ee5404 vlan_input: add a missing EVL_VLANOFTAG in the case of hw offloading. 2005-03-17 10:33:28 +00:00
tron e561507a1f Add support for changing the MTU to stf(4). 2005-03-11 13:28:25 +00:00
matt 4acc1b7c25 Add beginning of TCP Segment Offload support. 2005-03-06 00:08:30 +00:00
jonathan fba9c4c1b9 Increase default value for IFQ_MAXLEN from 50 to 256.
The value of 50 dates back to 4.3BSD and 10Mbit interfaces.
Gigabit interfaces are 100x faster, and by observation, when heavy
interrupt mitigation is enabled, gigabit interfaces can enqueue 40 packets
or more in a single hardware interrupt.  So IFQ_MAXLEN of 256 is adequate
for at least four gigabit interfaces.

Increasing IFQ_MAXLEN discussed and approved, in priniciple, circa Apr 2004.
The value is sysctl'able, so the default is no longer so critical,
but (imho) best to tune for high-performane systems by default.
2005-02-28 18:44:45 +00:00
perry f07677dd81 nuke trailing whitespace 2005-02-26 22:45:09 +00:00
christos 24db4c5a14 Re-arrange code slightly to avoid code duplication and allow to bail
out faster without doing de-capsulation work. From FreeBSD.
2005-02-21 21:37:22 +00:00
jdolecek 4c60443769 expose the new VLAN macros only within kernel 2005-02-20 15:41:48 +00:00
jdolecek 8b0dfe8d52 add several VLAN tagging related macros, to reduce code duplication
in various ethernet adapter drivers and improve code consistency; mostly
FreeBSD-compatible, with exception of VLAN_OUTPUT_TAG(), which takes
(struct ethercom *) rather than (struct ifnet *) as first parameter
since the information cannot be extracted via (struct ifnet)

also add VLAN_ATTACHED(ec), which tests if any VLAN is attached to the
ethernet device
2005-02-20 15:29:03 +00:00
cube 55dc3e11f4 Add a couple of protocols (from ppp-2.4.3). 2005-02-20 10:23:13 +00:00
cube a8a27dce29 Add MPPE definitions (from ppp-2.4.3). 2005-02-20 10:22:26 +00:00