summaryrefslogtreecommitdiffstats
path: root/sys/net
Commit message (Collapse)AuthorAgeFilesLines
* This fixes a problem where the SIOCGIFCONF ioctl goes wrong. Thisguido2000-02-281-1/+9
| | | | | | | | | | | | is triggered when qmail is used with INET6 enabled. The bug manifests itself in that the space variable can become negative and that in the comparison in the guards of the 2 loops, this was not noticed because sizeof() returns an unsigned and thus the signed variable gets promoted to unsigned. I decided not to make space unsigned because I think we should guard against this from happening. Thus panic() in case space becomes negative. Approved by: jkh
* Wrap if_up() by splnet.shin2000-02-271-1/+7
| | | | | | Approved by: jkh Submitted by: peter
* Fix possible SLIOCSUNIT panicache2000-02-201-0/+1
| | | | | | PR: 16564 Submitted by: ru Approved by: jkh
* Track if_i{bytes,packets,errors}.mdodd2000-02-161-0/+4
| | | | Approved by: jkh
* Clean up some loose ends in the network code, including the X.25 and ISOpeter2000-02-137-390/+7
| | | | | | | #ifdefs. Clean out unused netisr's and leftover netisr linker set gunk. Tested on x86 and alpha, including world. Approved by: jkh
* Update bridging code to the one already in -stable (this wasluigi2000-02-082-189/+370
| | | | | | forgotten some time ago...). Approved-by: jordan
* m_pullup() frees the supplied mbuf on failure; we don't need to trymdodd2000-02-071-5/+3
| | | | | | | and do this ourselves. Approved by: jkh Noticed by: Mike Spengler <mks@networkcs.com>
* Make sure that the entire header is in the first mbuf before wemdodd2000-02-031-2/+14
| | | | | | | | | | | | | | | attempt to copy the ethernet header forward and otherwise encapsulate a packet for output. This fixes the panic when using VLAN devices on hardware that doesn't do 802.1Q tagging onboard. (That is to say, all drivers except the Tigon.) My tests consisted of telnet, ttcp, and a pingflood of packets between 1 and 1600 (plus headers) bytes. MFC to follow in 1 week. Approved by: jkh
* Add workaround for fxp issue at interface initialization with IPv6.shin2000-02-011-0/+4
| | | | | | | | | | | | | | | | | | | | | Some LAN card chip for fxp is known to cause problem at interface initialization with IPv6 enabled. It happens at some delicate timing. And also, just adding some DELAY before IPv6 address autoconfiguration is known to avoid the problem. Complete fix is changing the driver not to use interrupt at multicast filter initialization, but trying such change in this stage will be dangerous. So I add some DELAY() only inside #ifdef INET6 part, as temporal workaround only for 4.0. Approbed by: jkh Noticed by: Mattias Pantzare <pantzer@ludd.luth.se> Obtained from: openbsd-tech mailing list
* Remove #if NGIF > 0 and #if NFAITH > 0 as config already checks this.peter2000-01-292-5/+0
|
* Remove some #if NFOO > 0 that are always true because of config rules.peter2000-01-296-18/+2
|
* Fix this so LINT compiles. There is no way this could have worked ifpeter2000-01-291-5/+5
| | | | | | tested with LINT. I've put back netatm/kern_include.h and maked it with a fixme!, otherwise NETISR_ATM isn't defined as ATM_KERNEL isn't defined. Defining that exposes a whole bunch of other dependencies.. :-(
* Remove unused includesbrian2000-01-291-7/+0
|
* Count AF_INET6 attachement to routing socket.shin2000-01-281-0/+6
| | | | Obtained from: KAME project
* Redo the intrq.c idea asbrian2000-01-273-131/+68
| | | | int family_enqueue(sa_family_t, struct mbuf *);
* Move the *intrq variables into net/intrq.c and unconditionallybrian2000-01-243-21/+168
| | | | | | | | | | | include this in all kernels. Declare some const *intrq_present variables that can be checked by a module prior to using *intrq to queue data. Make the if_tun module capable of processing atm, ip, ip6, ipx, natm and netatalk packets when TUNSIFHEAD is ioctl()d on. Review not required by: freebsd-hackers
* Notify user processes about interface's MTU change.ru2000-01-241-1/+3
| | | | Reviewed by: wollman, freebsd-net
* Allow if_ef driver to be compiled into kernel.bp2000-01-231-0/+1
|
* Implement TUN[GS]IFHEAD ioctls. Passing a non-zero int to TUNSIFHEADbrian2000-01-233-39/+140
| | | | | | | | | | | tells that tun unit to prepend a four byte address family to packets queued for tunread() and to expect a four byte address family at the front of data received by tunwrite(). We queue any protocol received from the interface for tunread(), but only accept INET, INET6, IPX and NETATALK from tunwrite(). There is support for Xerox's NS stuff, but AFAICT config(8) doesn't ever define NS.
* Add a new TUNSIFPID ioctl to update the tun_pid (recorded inbrian2000-01-212-0/+4
| | | | tunopen) with the current pid.
* |The hard limit for the BPF buffer size is 32KB, which appears too lowphk2000-01-152-3/+6
| | | | | | | | | | | | | |for high speed networks (even at 100Mbit/s this corresponds to 1/300th |of a second). The default buffer size is 4KB, but libpcap and ipfilter |both override this (using the BIOCSBLEN ioctl) and allocate 32KB. | |The following patch adds an sysctl for bpf_maxbufsize, similar to the |one for bpf_bufsize that you added back in December 1995. I choose to |make the default for this limit 512KB (the value suggested by NFR). Submitted by: se Reviewed by: phk
* Clear ro->ro_rt just after RTFREE().shin2000-01-151-0/+1
| | | | | | | | | Pleases let me make sure that no one touch the invalid ro_rt pointer, after splx(s) and before next ro_rt initialization. Though usually this seems to be already called at splnet, I still sometime experience kernel crash at rtfree() in my INET6 enabled environment where IPv6 connection is frequently used. (Off-course, it might be just due to another bug.)
* cosmetic change: sort function prototypesshin2000-01-151-27/+27
| | | | Specified by: bde
* -K&R fix for some prototype declarationshin2000-01-151-4/+4
| | | | | | -fix some comments for #endif to match them with their #ifndef Submitted by: bde
* Attempt to fix a problem with receiving packets on USB ethernet interfaces.wpaul2000-01-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Packets are received inside USB bulk transfer callbacks, which run at splusb() (actually splbio()). The packet input queues are meant to be manipulated at splimp(). However the locking apparently breaks down under certain circumstances and the input queues can get trampled. There's a similar problem with if_ppp, which is driven by hardware/tty interrupts from the serial driver, but which must also manipulate the packet input queues at splimp(). The fix there is to use a netisr, and that's the fix I used here. (I can hear you groaning back there. Hush up.) The usb_ethersubr module maintains a single queue of its own. When a packet is received in the USB callback routine, it's placed on this queue with usb_ether_input(). This routine also schedules a soft net interrupt with schednetisr(). The ISR routine then runs later, at splnet, outside of the USB callback/interrupt context, and passes the packet to ether_input(), hopefully in a safe manner. The reason this is implemented as a separate module is that there are a limited number of NETISRs that we can use, and snarfing one up for each driver that needs it is wasteful (there will be three once I get the CATC driver done). It also reduces code duplication to a certain small extent. Unfortunately, it also needs to be linked in with the usb.ko module in order for the USB ethernet drivers to share it. Also removed some uneeded includes from if_aue.c and if_kue.c Fix suggested by: peter Not rejected as a hairbrained idea by: n_hibma
* Remove BROADCAST flag from faith interface,shin2000-01-091-2/+2
| | | | | | | -it not seems to be necessary -to avoid dhcp messages or something like that sent to faith interface The problem reported by: Jim Bloom <bloom@acm.org>
* Prevent kernel panic at ifconfig up after Note PC resume.shin1999-12-301-3/+22
| | | | | Submitted by: imp, kuriyama Reviewed by: imp
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"peter1999-12-2923-58/+54
| | | | | | is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come.
* Make cloning mask sockaddr (genmask) possible.ru1999-12-281-1/+2
| | | | | PR: kern/3061 Reviewed by: wollman
* IPSEC support in the kernel.shin1999-12-222-2/+4
| | | | | | | | pr_input() routines prototype is also changed to support IPSEC and IPV6 chained protocol headers. Reviewed by: freebsd-arch, cvs-committers Obtained from: KAME project
* M_PREPEND-related cleanups (unregisterifying struct mbuf *s).green1999-12-193-9/+6
|
* Fix a broken macro usage. It had no semicolon.green1999-12-181-1/+1
| | | | Noticed by: eivind
* Two more fixes to if_detach. These are generic to all interfaces andimp1999-12-171-2/+63
| | | | | | | | | do not pollute the interface further. o Run if_detach at splnet(). o Creatively swipe the relevant parts of the netatm atm_nif_detach which will delete the relevant references to the interface going away.
* Bring up an if_ef driver which allows support for four ethernetbp1999-12-132-1/+612
| | | | | | | frame types. Currently it supports only IPX protocol and doesn't affect existing functionality when not loaded. Reviewed by: Ollivier Robert <roberto@keltia.freenix.fr>
* Allow ifunit() routine to understand names like ed0f2. Alsobp1999-12-131-31/+26
| | | | | | fix a bug caused by using bcmp() instead of strcmp(). Reviewed by: Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
* The current code incorrectly assumes that all vlansjkh1999-12-132-5/+4
| | | | | | | | | are configured, and/or associated with a parent device. If you receive a frame for a VLAN that's not in the list, you walk off the end of the list. Boom. Submitted by: C. Stephen Gunn <csg@waterspout.com> PR: 15291
* sys/net/if_vlan.c fails to maintain the IFF_RUNNING flag on thejkh1999-12-131-2/+3
| | | | | | | | vlan interfaces it manages. This prevents the interface from actually sending or receiving data. Submitted by: C. Stephen Gunn <csg@waterspout.com> PR: 15290
* Add some gross ad-hock hacks to increase stability of if_detach:imp1999-12-101-2/+17
| | | | | | | | | | | | | o be more careful about clearing addresses (this isn't a kludge) o For AF_INET interfaces, call SIOCDIFFADDR to remove last(?) bit of cruft. Special cases for AF_INET shouldn't be here, but I didn't see a good generic way of doing this. If I missed something, please let me know. This gross hack makes pccard ejection stable for ethernet cards. Submitted by: Atushi Onoe-san
* Fix a route table leak in rtalloc() and rtalloc_ign(). It isjdp1999-12-091-5/+12
| | | | | | | | | | | | | | possible for ro->ro_rt to be non-NULL even though the RTF_UP flag is cleared. (Example: a routing daemon or the "route" command deletes a cloned route in active use by a TCP connection.) In that case, the code was clobbering a reference to the routing table entry without decrementing the entry's reference count. The splnet() call probably isn't needed, but I haven't been able to prove that yet. It isn't significant from a performance standpoint since it is executed very rarely. Reviewed by: wollman and others in the freebsd-current mailing list
* rtcalloc() is removed because it turned out not to be necessary for FreeBSD.shin1999-12-092-11/+0
| | | | | | (It was added as a part of KAME patch) Specified by: jdp@polstra.com
* udp IPv6 support, IPv6/IPv4 tunneling support in kernel,shin1999-12-0710-11/+620
| | | | | | | | | | packet divert at kernel for IPv6/IPv4 translater daemon This includes queue related patch submitted by jburkhol@home.com. Submitted by: queue related patch from jburkhol@home.com Reviewed by: freebsd-arch, cvs-committers Obtained from: KAME project
* Make the stub routines have the same prototypes as the real bpfjulian1999-12-031-1/+1
| | | | routines.
* Add 'const' to the bpf_filter() and bpf_validate() prototypes.archie1999-12-022-7/+5
| | | | Remove a stale comment from bpf_validate().
* Add two new generic control messages, NGM_ASCII2BINARY andarchie1999-11-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | | NGM_BINARY2ASCII, which convert control messages to ASCII and back. This allows control messages to be sent and received in ASCII form using ngctl(8), which makes ngctl a lot more useful. This also allows all the type-specific debugging code in libnetgraph to go away -- instead, we just ask the node itself to do the ASCII translation for us. Currently, all generic control messages are supported, as well as messages associated with the following node types: async, cisco, ksocket, and ppp. See /usr/share/examples/netgraph/ngctl for an example of using this. Also give ngctl(8) the ability to print out incoming data and control messages at any time. Eventually nghook(8) may be subsumed. Several other misc. bug fixes. Reviewed by: julian
* Expand the field width for subtypes. We had already overflowed itjulian1999-11-241-3/+5
| | | | | | | | by 2 with people just adding numbers on the end of the ethernet subtypes. We now have an additional 14 subtypes available in ethernet. Use one of them immediatly for homePNA. Reviewed by: Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
* Only emit the ``wrong ifa'' message if the matching interfacebrian1999-11-231-3/+5
| | | | | | | | | | | | | | | | is neither IFF_LOOPBACK or IFF_POINTOPOINT. It's quite common (and probably more correct) to route local IP numbers via lo0 and it makes configuration easier to assign the hostname address to local POINTOPOINT links too. This message usually remains hidden because the loopback interface gets the highest interface number at boot time, but when the ethernet interface is added later, the message can get pretty annoying. Also, fix a typo. Not objected to by: freebsd-net
* KAME netinet6 basic part(no IPsec,no V6 Multicast Forwarding, no UDP/TCPshin1999-11-229-67/+946
| | | | | | | | | | for IPv6 yet) With this patch, you can assigne IPv6 addr automatically, and can reply to IPv6 ping. Reviewed by: freebsd-arch, cvs-committers Obtained from: KAME project
* Add some more comments to the sl_compress_tcp() function.archie1999-11-151-2/+9
|
* YUCK!julian1999-11-151-2/+2
| | | | | m_prepend doesn't fix m_pkthdr.len, use M_PREPEND instead, which does.. (Netgraph only)
* Fix screwup on synthesising incoming ethernet header in Netgraph mode.julian1999-11-141-2/+3
| | | | Submitted by: brian@freebsd.org
OpenPOWER on IntegriCloud