Commit Graph

538 Commits

Author SHA1 Message Date
mrg 755a273d97 pass a pointer to the list, rather than passing a copy of it, when removing
functions from the pfil hook lists.  this fixes the "missing function" problem.
also, re-add support for WAITOK that was lost several deltas ago.
1999-10-10 09:07:32 +00:00
sommerfeld 7e72e96529 Fix PR7946 (neighbor discovery tries to block at interrupt level).
stack-allocate a sockaddr_storage for the temporary sockaddr rather
than putting it in an mbuf.

neighbor discovery wants to delete expired ifa's from a timeout
handler.  allowing rtinit(RTM_DELETE, ...) to run at interrupt level
allows this to work.
i think we can afford the extra ~128 bytes of stack depth ..
1999-10-09 18:55:30 +00:00
erh 622b465872 Delay clearing of RTF_UP until after deleting rt_gwroute. Otherwise, if rt_gwroute is the same as the original route it will get freed twice. It can end up the same because of unusual "route" commands (PR4561) or certain icmp redirects (PR4827). 1999-10-09 08:13:00 +00:00
ad 2399291a41 Define ETHERTYPE_VLAN: IEEE 802.1Q VLAN tagging. 1999-09-29 23:00:21 +00:00
thorpej 6f6f873945 const poison ifunit(). 1999-09-29 22:42:02 +00:00
is f546d949b6 Decouple IP mtu for ARCnet devices from interface MTU.
This is important, because for most protocols, link level fragmentation is
used, but with different default effective MTUs. (e.g.: IPv4 default MTU
is 1500 octets, IPv6 default MTU is 9072 octets).
1999-09-25 17:49:27 +00:00
matt 72a3b3a08a Make NETATALK over FDDI. 1999-09-21 22:18:51 +00:00
matt 590b2a675e Add a ifru_value (unsigned int) as a generic value. 1999-09-21 22:16:24 +00:00
is 6a793d8a47 Zeroth version of IPv6 support for ARCnet. Correct MTU handling still needs
to be done.
1999-09-19 21:31:33 +00:00
is f5050d025a We only need the ether_ipmulticast_min and _max addresses if we have INET
compiled in.
1999-09-15 20:48:19 +00:00
itojun 6b9bfc0691 - Call in{,6}_pcbdetach if ipsec initialization is failed during PRU_ATTACH.
This situation happens on severe memory shortage.  We may need more
  improvements here and there.
- Grab IEEE802 address from IFT_ETHER card, even if the card is
  inserted after bootup time.  Is there any other card that can be
  inserted afterwards?  pcmcia fddi card? :-P
- RFC2373 u bit handling suggests that we SHOULD NOT copy interface id from
  ethernet card to pseudo interface, when ethernet card has IEEE802/EUI64
  with u bit != 0 (this means that IEEE802/EUI64 is not universally unique).
  Do not use such address as, for example, interface id for gif interface.
  (I have such an ethernet card myself)
  This may change interface id for your gif interface.  be careful upgrading
  rc files.

(sync with recent KAME)
1999-09-13 12:15:54 +00:00
itojun 65363da25e Merge in NetBSD/sh3 from cvs.kame.net repository.
Tree structure:
- sys/arch/sh3: sh3 generic code
	As commented, in-chip device drivers are put into sys/arch/sh3/dev.
- sys/arch/evbsh3: sh3 evaluation boards (pure sh3 CPU, no fancy external HW)
- sys/arch/mmeye: Brains mmEye, www.brains.co.jp
MI source code includes couple of #ifdef for sh3-coff support.
(sh3 uses coff or elf)

Needs some more improvements, especialy in sys/arch/sh3/conf/files.sh3,
to compile the tree (due to last minute tree structure change).
1999-09-13 10:30:21 +00:00
is 3e419f86dc Move the mtu initialization to arc_storelladdr, so that it will be upped
again when switching link0 on.
XXX This stuff needs to be thought about, especially with the doomming IPv6
support, which uses yet another default mtu.
1999-08-29 20:38:36 +00:00
is df8d07f87e Don't assume PHDS encoding for DIAGNOSE packets... we have to pass them
raw, if used at all.
1999-08-27 19:38:29 +00:00
is d8c7407afe Factor out arc_storelladdr(), and use that instead of arc_ifattach() in
the bah_reset() function.
This makes the last change work without deconnecting all the other interfaces
from the interface list.
1999-08-27 19:23:19 +00:00
thorpej d4d4f37bca packed -> __packed__ 1999-08-27 01:52:26 +00:00
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