Commit Graph

522 Commits

Author SHA1 Message Date
is 8679b79192 Only use ifp->if_addrlen after initializing it.\
Problem detected by Andreas Johansson.
1999-08-26 20:44:50 +00:00
is c7acd44cf0 Eliminate a function call... we know its exactly one byte here 1999-08-26 19:56:08 +00:00
christos ec608f7058 changes from ppp-2.3.9 [synchronous] 1999-08-25 02:04:05 +00:00
bouyer 075ea2cfea Fix ifa_ifwithnet() for the netatalk case: netatalk uses blocks of addresses
which can't be handled by netmask, and ifa_ifwithnet() didn't find the
interface associated with an adress if it was in the same block but not with
the same prefix. This prevented 'route add' and atalkd to work properly
with some network configs.
This has been discussed on tech-net some weeks ago.
1999-08-24 16:02:27 +00:00
matt d3448593e5 Cleanup a little kludge in mtu handling in route.c. Bring down FDDI
mtu to legal IP max but don't affect other protocols.
1999-08-21 03:46:35 +00:00
thorpej ce3252697d u_char -> u_int8_t in the IPv6 goo. 1999-08-10 18:16:07 +00:00
thorpej 99584ccf61 M_HASCRC -> M_HASFCS, as suggested by Christoph Badura. 1999-08-05 02:07:38 +00:00
thorpej b51de33f23 In ether_input(), if M_HASCRC is set, trim the CRC off the packet. 1999-08-04 19:29:01 +00:00
thorpej 3462650350 Define an Ethernet-specific flag which drivers can use to tell
the input routine that the CRC is included at the end of the frame.
1999-08-04 19:16:48 +00:00
itojun 06c350054d remove reference to in6_systm.h (file itself will be removed afterwords) 1999-07-30 10:35:34 +00:00
bouyer fdb68cb866 Needs cpu.h for netisr (compile breaks on sun3). 1999-07-12 15:03:26 +00:00
thorpej 267920eb1a defopt INET6, and put it in opt_inet.h (most places already include this
file, which is why the file list is so short).
1999-07-09 23:41:16 +00:00
itojun dcc13cdd33 sync with KAME/NetBSD 1.4, SNAP kit 19990705.
key changes are:
- icmp6 redirect fix (dst check)
- revised ip6 multicast check for loopback i/f
- several RCS ID cleanups
1999-07-06 12:23:19 +00:00
kleink 92bd36d9a9 Add namespace protection, using XNS5.2 D2.0 as a reference (which effectively
boils down to not making anything but the if_nameindex(3) interfaces available
to _XOPEN_SOURCE).
1999-07-03 13:52:29 +00:00
itojun 118d2b1d4f IPv6 kernel code, based on KAME/NetBSD 1.4, SNAP kit 19990628.
(Sorry for a big commit, I can't separate this into several pieces...)
Pls check sys/netinet6/TODO and sys/netinet6/IMPLEMENTATION for details.

- sys/kern: do not assume single mbuf, accept chained mbuf on passing
  data from userland to kernel (or other way round).
- "midway" ATM card: ATM PVC pseudo device support, like those done in ALTQ
  package (ftp://ftp.csl.sony.co.jp/pub/kjc/).
- sys/netinet/tcp*: IPv4/v6 dual stack tcp support.
- sys/netinet/{ip6,icmp6}.h, sys/net/pfkeyv2.h: IETF document assumes those
  file to be there so we patch it up.
- sys/netinet: IPsec additions are here and there.
- sys/netinet6/*: most of IPv6 code sits here.
- sys/netkey: IPsec key management code
- dev/pci/pcidevs: regen

In my understanding no code here is subject to export control so it
should be safe.
1999-07-01 08:12:45 +00:00
explorer 12b25faeaf KNFify. Add LINK1 flag to turn off that address munging thing, for cases
where the tunnel endpoint is not the same as the remote GRE destination.
1999-06-28 07:52:38 +00:00
itojun 74d3c214ec KAME/NetBSD 1.4 SNAP kit, dated 19990628.
NOTE: this branch (kame) is used just for refernce.  this may not compile
due to multiple reasons.
1999-06-28 06:36:47 +00:00
mrg 1dd8c9f502 call pfil_list_add with the right flag, to ensure it goes into the right list.
from mike@pelley.com in PR#7802.
1999-06-18 05:59:20 +00:00
bouyer cc6eca7553 mbuf should be allocated with M_DONTWAIT in ether_output(). This caused panics
when routing atalk.
1999-06-17 17:27:13 +00:00
bad 6b30aed924 Fix thinko of mine in previous. The source route info is not at m->m_data
after various m_adj()s have been done.  Kludge around this with a cheesy
macro that knows where the drivers put the mac header in the first mbuf.

XXX There should be a better way to do this.
1999-05-30 00:39:07 +00:00
bad 0b3a9f9e00 Don't assume the Token-Ring source route is in the m_pktdat. Use
m_data instead.  This isn't a problem with ARP packets but is correct
way to this.

Noticed by pmara@cactus.org (Shashi Mara).
1999-05-29 22:36:07 +00:00
tron 770a66b9a8 Fix kernel builds if ppp interface but no bpf filters are configured.
Patch supplied by Takahiro Kambe in PR kern/7639, also fixes PR kern/7632
by Bjoern Labitzke.
1999-05-24 20:12:10 +00:00
augustss b1800a623c Make this file syntactically correct again. 1999-05-21 00:25:48 +00:00
tsarna 25e3ee0ff2 Add a *bunch* of types (file went from ~4K to ~16K!) 1999-05-20 21:02:43 +00:00
thorpej 3da4443954 Oops, commit here slipped through the cracks. 1999-05-20 18:07:27 +00:00
thorpej f98d358a1f Rework layer 2 protocol input routines. Instead of calling e.g. ether_input()
directly, call the function pointer (*if_input)(ifp, m).  The input routine
expects the packet header to be at the head of the packet, and will adjust
as necessary.  Privatize the layer 2 input and output routines, allowing
*_ifattach() to set them up as appropriate.
1999-05-18 23:52:51 +00:00
tron 81897066b9 Fix compilation problem caused by recent changes to filtering code. 1999-05-14 21:33:41 +00:00
thorpej 7e3a0bf0c5 Decouple inbound and outbound filters. Now instead of using "active-filter"
and "pass-filter" and "inbound" and "outbound" qualifiers in the filter
expression, use new "active-filter-in", "active-filter-out", "pass-filter-in",
and "pass-filter-out" without these qualifiers.

This is necessary due to the horrible, awful way "inbound" and "outbound"
were specified for the filter programs when a packet was passed through them.
Basically, the "address" byte in the serial PPP header was overwritten with
a value to indicate the direction.  However, the "address" byte doesn't even
exist on PPP headers for all other PPP encaps!  So, this old method worked
only for serial encaps, and corrupted packets for all others (PPPoE, ATM, etc.)
1999-05-12 18:50:51 +00:00
thorpej 4c89a367d5 * Start out with a data link type of DLT_NULL. When we change an interface
to serial encap, change its data link type to DLT_PPP_SERIAL.
* Work around some serious bogosity in the filtering code which utterly
breaks proper functioning of BPF.  The PPP code and pppd(8) WILL be changed
to fix this.
1999-05-11 02:18:52 +00:00
thorpej c806cc5a47 * Add the ability to change the data link type on the fly.
* Define two more data link types: NetBSD PPP-over-serial and NetBSD
PPP-over-Ethernet.  (Different PPP encaps have different header formats!)
1999-05-11 02:11:08 +00:00
matt e3107a86c2 Add ARP hardware type for IEEE 1394 (FireWire) 1999-05-08 01:42:24 +00:00
thorpej c7ea24c151 Back out previous. It was just ... braindamaged. 1999-04-30 17:47:36 +00:00
abs 175b821dfe If the driver only supports one media type, and ifmedia_ioctl() is called to
select the current medium, (and it is not autoselect), assume no change and
do not try to select the medium. Fixes 'ifconfig le0 medium 10base5' on sparc2
without requiring a 'do nothing' mediachange callback.
1999-04-30 17:30:49 +00:00
drochner b86fdd7409 don't expose structures and prototypes to _STANDALONE programs 1999-04-09 09:32:51 +00:00
bad 6bdc01f098 Fix version id strings in comment. 1999-04-08 15:53:31 +00:00
explorer 9350aaaee9 Add NetBSD rcsid tags, and preserve old ones from i4b source 1999-04-04 06:57:03 +00:00
explorer 6249482be9 Install if_sppp.h in include/net/ 1999-04-04 06:08:40 +00:00
explorer a6a18662a2 switch to the i4b version of if_sppp*.[ch] (with mods) 1999-04-04 06:07:56 +00:00
chopps 0723de9c6c deal with failure of malloc NOWAIT by restarting after mallocing with WAIT.
don't write beyond the users given buffer size (this happened if there was
	enough space for the initial malloc to succeed).
1999-04-02 17:22:21 +00:00
kleink 22ac9f8845 ANSI C police. 1999-03-28 17:13:47 +00:00
dbj a6f0126b1a fixes to compile if NBPFILTER == 0 1999-03-27 22:48:36 +00:00
aidan da1b3a7abf Added per-addr input/output statistics. Currently just support netatalk
and netinet, currently only tested under netinet.

Disabled by default, enabled by compiling the kernel with option
IFA_STATS.  Enabling this feature seems to make the ip_output function
take 13% longer than before, which should be OK for people that need
this feature.
1999-03-27 01:24:49 +00:00
thorpej 9da505740a Define several constants related to the Ethernet protocol:
- ETHER_ADDR_LEN: length of Ethernet address (actually, we already defined
  this).
- ETHER_TYPE_LEN: length of the Ethernet header `type' field.
- ETHER_CRC_LEN: length of the Ethernet CRC (explorer got this already, mostly
because I forgot to commit these changes earlier).
- ETHER_HDR_LEN: total length of the Ethernet header
- ETHER_MAX_LEN: maximum length of an Ethernet frame, including header and CRC
- ETHER_MIN_LEN: minimum length of an Ethernet frame, including header and CRC

Define ETHERMTU and ETHERMIN (payload sizes) in terms of the above constants.
1999-03-25 23:08:28 +00:00
explorer f388d47b3b put RCS ids in the right place. And yes, this is a SYNC ppp interface,
used for high-speed (T1, HSSI, DS3) interfaces.
1999-03-25 05:25:42 +00:00
explorer eb94e6147c define ETHER_CRC_LEN, for if_vr.c 1999-03-25 04:45:37 +00:00
explorer 2a91ea8a57 port FreeBSD's serial ppp layer to NetBSD. The PPP part seems broken still,
but the lmc driver uses the HDLC bits from here anyway.
1999-03-25 03:38:00 +00:00
tron bbee1b42b1 Make it possible to set MTU via "ifconfig" at run time. "SLMTU" is now
used to set the initial value.
1999-03-25 00:52:14 +00:00
thorpej 86f87d7c5f Add a new shared media option, IFM_FLOW, used to enable link-level
flow control.  IEEE 802.3x is in mind, but this could be generally
useful for different types of media.
1999-03-23 21:46:47 +00:00
bad 8bb131360c Appease GCC.
#ifdef FreeBSD some debug code as is done if if_fddisubr.c.
1999-03-22 23:14:14 +00:00
bad a4e508928f Oops. RcsID police. 1999-03-22 23:01:36 +00:00
bad b6163c625a Add LLC_SNAPFRAMELEN. 1999-03-22 22:29:27 +00:00
bad ab3f3172c5 Add ARPHRD_IEEE802. 1999-03-22 22:28:40 +00:00
bad 76c3e33738 Add if_token.h to INCS. 1999-03-22 22:27:41 +00:00
bad 52c3a56a05 Support routines for Token-Ring network drivers.
By Onno van der Linden.
1999-03-22 22:22:52 +00:00
thorpej 49d0b5de2b Define the PPPoE Discovery and PPPoE ethertypes. 1999-03-20 03:37:52 +00:00
drochner 98294086d9 make this compile again 1999-03-13 14:09:46 +00:00
perry d446fb449c exterminate ovbcopy. patches provided by Erik Bertelsen, pr-7145 1999-03-12 22:42:30 +00:00
thorpej 5fa25527ac Const poison ether_ifattach(). 1999-03-10 21:05:08 +00:00
thorpej f48012dee8 Const poison ether_sprintf(). 1999-03-10 03:28:50 +00:00
mjacob d7e48cb804 adjust format args for compiler changes 1999-03-04 02:38:31 +00:00
is 06420a5af7 So... after all, the ATA878.2 copy I had was buggy. The newer revision has
this fixed in the figures (but still not in the text); anyway, the intention
of the ATA is that this is identical to the PHDS specification.
Remove the ...EXC_8782 constant, and change the _EXC_1201 constant to be
a simple ...EXC.
1999-02-25 11:20:34 +00:00
is 874801e906 Remove zero length array 1999-02-23 20:11:06 +00:00
kleink cd577c539a Addendum to rev. 1.15: use of __extension__ here is supported in GCC 2.8.0 and
above only; since this is the only occurence, fix it locally rather than in
<sys/cdefs.h> as to not remove all the functionality on pre-2.8 systems.
XXX Shouldn't use zero-length arrays at all.
1999-02-23 16:59:38 +00:00
kleink 10a02a6706 Zero-sized arrays are a GNU C extension; from Dave Sainty in PR kern/6271. 1999-02-21 17:35:17 +00:00
hubertf 56f2d188fc RCS ID police 1999-02-15 04:54:34 +00:00
hwr fbd6e613b3 We no longer support IPIP (IP proto 4). 1999-01-26 21:21:14 +00:00
msaitoh 3af083d212 fix "CMSA CD" to "CSMA/CD" 1999-01-18 06:31:13 +00:00
is 5854b4eafe Yet another performance optimization for exceptional length ARCnet packets.
This time in the receive path.
1999-01-16 14:08:05 +00:00
is f77decf65c Make the code path for exceptional length packets a bit faster (2 mbuf
operations less) and better readable.
1999-01-16 13:04:13 +00:00
is 0a3d4d8915 - define protocol type for diagnostics (0x80 as per ANSI 878.1)
- define protocol type for IP version 6
- define length of exceptional length packets for both RFC 1201-style and
  ATA 878.2-style fragmentation.
1999-01-16 13:01:20 +00:00
thorpej 6ae68b4feb Pull the IP-in-IP tunneling support out of the GRE code. It's not handled
by a separate IP-IP input path.

XXX Should eventually do the same thing for IPPROTO_MOBILE.
1999-01-11 21:32:13 +00:00
thorpej d70bb64a38 Use M_LINK{0,1} for our own mbuf flags, rather than arbitrarily picking
2 bits.
1999-01-09 21:47:09 +00:00
thorpej f079e8d39c Simplify the rttimer code somewhat; use TAILQs instead of CIRCLEQs (we
didn't really need to traverse the queues backwards anyhow), and other
minor code simplification.
1998-12-27 18:27:48 +00:00
veego 50cc03465e Fix kern/6658 from Martin Husemann:
After booting a current kernel and receiving a few arp requests on the
network it panics (data modified on free list). The panic message is wrong,
as code inspection shows the memory pool for routing entries is intialized
twice, while the routing timer memory pool is never initialized.
1998-12-27 11:44:41 +00:00
thorpej 0a87ec1ac7 Use pools for rtentry and rttimer structures. 1998-12-22 02:27:06 +00:00
thorpej 3322b9a32e Add an extern declaration of gre_softc[] here. Wrap it and the prototypes
in #ifdef _KERNEL.
1998-12-22 01:33:45 +00:00
christos bdaefe06f3 Synchronize with the Ultrix version of the ppp release. 1998-12-12 18:22:39 +00:00
christos a0823f0a89 #include "opt_ppp.h" otherwise struct ppp_softc can be the wrong size
(From mycroft)
1998-12-12 18:21:32 +00:00
christos c748ecf74a fix thinko in previous change. 1998-12-12 17:26:09 +00:00
christos 52f565dcfd Revert IPX changes that I committed accidentally. 1998-12-10 17:48:40 +00:00
christos 13d58281de IPX counters and centralize statistics routine. 1998-12-10 15:52:39 +00:00
christos e856516838 IPX fixes. 1998-12-10 15:51:48 +00:00
christos 7e5316ae6e IPX fixes. 1998-12-10 15:50:54 +00:00
christos bf10ca4eff linted comment 1998-12-10 15:11:05 +00:00
christos bee9dafdf5 defopt COMPAT_43 1998-12-10 15:07:01 +00:00
christos c7578c510a defopt 1998-12-10 11:01:01 +00:00
bouyer 433c02431e Init the decriptors at boot time rather than at interface attach time.
Now that we have pcmcia hot-plug, it's not the same. Fixes kern/3189.
1998-12-04 11:04:37 +00:00
sommerfe 14dc6ddfe6 Fix PR6473: allow sends to tun* devices using bpf. 1998-11-30 21:43:11 +00:00
jonathan fb020850a0 Increase compiled-in default bpf buffer size from 4096 to 8192.
(the libpcap API provides no way to resize the inkernel buffe,r and
4096 is too small to capture maximum-sized FDDI frames.)
1998-11-05 22:50:15 +00:00
thorpej be4ce8c3f4 Add "10baseT-FDX" and "100baseTX-FDX" aliases to the end of the subtype
table.  These are actually subtype+option combos, but these are the
strings displayed by the MII code to indicate 10Mbps full-duplex and
100Mbps full-duplex respectively, and it's Nice that ifconfig(8) can
grok them.
1998-11-02 22:10:26 +00:00
kml afd8d9361f Add call to splsoftnet() in rt_timer_timer to avoid possible race
condition in deleting timer queue (PMTU) entries.
1998-10-28 05:01:11 +00:00
kim e34aa44c14 Put back ETHERTALK_AT (but I did convert *all* code to ETHERTYPE_ATALK),
so if vendors (or something) used it, it is still found.  Also added short
comments for each alias to explain why they are there.
1998-10-13 02:55:18 +00:00
kim cd7e3136ad Use ETHERTYPE_ATALK instead of ETHERTYPE_AT. The former seems more common.
Our other constants also use "ATALK".

Added many new ETHERTYPE constants to sys/net/ethertypes.h, including the
ones from libpcap and tcpdump "ethertype.h" files.
1998-10-13 02:34:31 +00:00
thorpej 588ccb2d75 Fix some typos in comments, and clean up some whitespace. 1998-10-07 23:33:02 +00:00
kleink 44b31a4395 Use #error instead of causing parse errors; noticed by Heiko. 1998-10-06 18:38:08 +00:00
hwr 0959469679 Also install if_gre.h in /usr/include/net/ 1998-10-02 19:23:55 +00:00
hwr eaccb9cd8d Start supporting IPPROTO_MOBILE (55) encapsulation. This is yet
another tunneling protocol used by the Mobile-IP people. See RFC 2004
for this.
1998-09-30 05:59:27 +00:00
matt 08e1d890a4 Changes so that BPF readers will get the data in fddi packet aligned along
normal boundaries.  This makes tcpdump much happier.
1998-09-20 02:36:08 +00:00
hwr 6831c842f3 The post 1.3.2 world is actually ready for this. 1998-09-13 21:39:49 +00:00
hwr 366b9c4515 Add a gre tunnel pseudo network device. Gre = generic route encapsulation.
This device shows up like any other network interface and can be used to
tunnel L3 protocols as e.g. IP over IP.
1998-09-13 20:27:47 +00:00