summaryrefslogtreecommitdiff
path: root/sys/net/if_loop.c
Commit message (Collapse)AuthorAgeFilesLines
* Simplify the interface cloning framework by handling unitMaxime Henrion2002-03-111-55/+9
| | | | | | | | | | | | unit allocation with a bitmap in the generic layer. This allows us to get rid of the duplicated rman code in every clonable interface. Reviewed by: brooks Approved by: phk Notes: svn path=/head/; revision=92081
* Add cloning support to the loopback interface.Brooks Davis2002-03-041-56/+99
| | | | | | | Submitted by: mux Notes: svn path=/head/; revision=91648
* sparc64 needs the same alingment fixes that alpha and ia64 do.Jake Burkholder2001-12-291-1/+1
| | | | | | | Submitted by: tmm Notes: svn path=/head/; revision=88660
* whitespace fixes.Jonathan Lemon2001-12-141-1/+1
| | | | Notes: svn path=/head/; revision=87914
* Pull post-4.4BSD change to sys/net/route.c from BSD/OS 4.2.Ruslan Ermilov2001-10-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | Have sys/net/route.c:rtrequest1(), which takes ``rt_addrinfo *'' as the argument. Pass rt_addrinfo all the way down to rtrequest1 and ifa->ifa_rtrequest. 3rd argument of ifa->ifa_rtrequest is now ``rt_addrinfo *'' instead of ``sockaddr *'' (almost noone is using it anyways). Benefit: the following command now works. Previously we needed two route(8) invocations, "add" then "change". # route add -inet6 default ::1 -ifp gif0 Remove unsafe typecast in rtrequest(), from ``rtentry *'' to ``sockaddr *''. It was introduced by 4.3BSD-Reno and never corrected. Obtained from: BSD/OS, NetBSD MFC after: 1 month PR: kern/28360 Notes: svn path=/head/; revision=85074
* Revision 1.32 corresponded to CSRG revision 8.2.Ruslan Ermilov2001-10-171-1/+1
| | | | Notes: svn path=/head/; revision=85051
* Add ia64 to the list of machines which don't do unaligned reads.Doug Rabson2001-10-051-1/+1
| | | | Notes: svn path=/head/; revision=84558
* Remove/comment tokens after #endif (#endif NETATALK)Peter Wemm2001-09-101-2/+2
| | | | Notes: svn path=/head/; revision=83268
* Sync with recent KAME.Hajimu UMEMOTO2001-06-111-12/+17
| | | | | | | | | | | | | | | | | | | | | This work was based on kame-20010528-freebsd43-snap.tgz and some critical problem after the snap was out were fixed. There are many many changes since last KAME merge. TODO: - The definitions of SADB_* in sys/net/pfkeyv2.h are still different from RFC2407/IANA assignment because of binary compatibility issue. It should be fixed under 5-CURRENT. - ip6po_m member of struct ip6_pktopts is no longer used. But, it is still there because of binary compatibility issue. It should be removed under 5-CURRENT. Reviewed by: itojun Obtained from: KAME MFC after: 3 weeks Notes: svn path=/head/; revision=78064
* "Fix" the previous initial attempt at fixing TUNABLE_INT(). This timePeter Wemm2001-06-081-1/+1
| | | | | | | | | | around, use a common function for looking up and extracting the tunables from the kernel environment. This saves duplicating the same function over and over again. This way typically has an overhead of 8 bytes + the path string, versus about 26 bytes + the path string. Notes: svn path=/head/; revision=77900
* Back out part of my previous commit. This was a last minute changePeter Wemm2001-06-071-1/+1
| | | | | | | | and I botched testing. This is a perfect example of how NOT to do this sort of thing. :-( Notes: svn path=/head/; revision=77853
* Make the TUNABLE_*() macros look and behave more consistantly like thePeter Wemm2001-06-061-2/+2
| | | | | | | | SYSCTL_*() macros. TUNABLE_INT_DECL() was an odd name because it didn't actually declare the int, which is what the name suggests it would do. Notes: svn path=/head/; revision=77843
* Exterminate the use of PSEUDO_SET() with extreme prejudice.Peter Wemm2001-01-311-14/+26
| | | | Notes: svn path=/head/; revision=71862
* Let M_PANIC go back to the private tree as its intention isn't understood wellBoris Popov2001-01-311-2/+1
| | | | | | | for now. Notes: svn path=/head/; revision=71859
* Use M_PANIC instead of if (sc == NULL) panic();Peter Wemm2001-01-291-1/+2
| | | | Notes: svn path=/head/; revision=71801
* Make the number of loopback interfaces dynamically tunable. Why onePeter Wemm2001-01-291-17/+79
| | | | | | | | | | would *want* to is a different story, but it used to be able to be done statically. Get rid of #include "loop.h" and struct ifnet loif[NLOOP]; This could be used as an example of how to do this in other drivers, for example: ccd. Notes: svn path=/head/; revision=71791
* Lock down the network interface queues. The queue mutex must be obtainedJonathan Lemon2000-11-251-17/+9
| | | | | | | | | | | | | | | | | before adding/removing packets from the queue. Also, the if_obytes and if_omcasts fields should only be manipulated under protection of the mutex. IF_ENQUEUE, IF_PREPEND, and IF_DEQUEUE perform all necessary locking on the queue. An IF_LOCK macro is provided, as well as the old (mutex-less) versions of the macros in the form _IF_ENQUEUE, _IF_QFULL, for code which needs them, but their use is discouraged. Two new macros are introduced: IF_DRAIN() to drain a queue, and IF_HANDOFF, which takes care of locking/enqueue, and also statistics updating/start if necessary. Notes: svn path=/head/; revision=69152
* o Add missing "\n" to warning output in netinet/if_loop.c, when anRobert Watson2000-09-041-1/+1
| | | | | | | | | | | | unsupported address family is used on localhost interface. looutput: af=0 unexpected Speculation as to the reasons for my seeing this error are welcome, of course. :-) Notes: svn path=/head/; revision=65454
* sync with kame tree as of july00. tons of bug fixes/improvements.Jun-ichiro itojun Hagino2000-07-041-1/+1
| | | | | | | | | | API changes: - additional IPv6 ioctls - IPsec PF_KEY API was changed, it is mandatory to upgrade setkey(8). (also syntax change) Notes: svn path=/head/; revision=62587
* fix KASSERT usageMatt Jacob2000-06-021-1/+1
| | | | Notes: svn path=/head/; revision=61181
* Rather than checking for hlen causing misalignment, we should do theAndrew Gallatin2000-05-261-7/+9
| | | | | | | | | | | | | | | m_adj() and then check the resulting mbuf for misalignment, copying backwards to align the mbuf if required. This fixes a longstanding problem where an mbuf which would have been properly aligned after an m_adj() was being misaligned and causing an unaligned access trap in ip_input(). This bug only triggered when booting diskless. Reviewed by: dfr Notes: svn path=/head/; revision=60952
* Just need to pass the address family to if_simloop(), not the whole sockaddr.Archie Cobbs2000-05-241-10/+12
| | | | Notes: svn path=/head/; revision=60889
* Clean up some loose ends in the network code, including the X.25 and ISOPeter Wemm2000-02-131-12/+0
| | | | | | | | | | #ifdefs. Clean out unused netisr's and leftover netisr linker set gunk. Tested on x86 and alpha, including world. Approved by: jkh Notes: svn path=/head/; revision=57178
* Remove some #if NFOO > 0 that are always true because of config rules.Peter Wemm2000-01-291-2/+0
| | | | Notes: svn path=/head/; revision=56856
* udp IPv6 support, IPv6/IPv4 tunneling support in kernel,Yoshinobu Inoue1999-12-071-4/+5
| | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=54263
* KAME netinet6 basic part(no IPsec,no V6 Multicast Forwarding, no UDP/TCPYoshinobu Inoue1999-11-221-1/+52
| | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=53541
* Remove NBPF conditionality of bpf calls in most of our network drivers.Poul-Henning Kamp1999-09-251-22/+11
| | | | | | | | | | | | | | | This means that we will not have to have a bpf and a non-bpf version of our driver modules. This does not open any security hole, because the bpf core isn't loadable The drivers left unchanged are the "cross platform" drivers where the respective maintainers are urged to DTRT, whatever that may be. Add a couple of missing FreeBSD tags. Notes: svn path=/head/; revision=51646
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Back out redundant checksBrian Somers1999-08-061-5/+2
| | | | | | | Pointed out by: bde Notes: svn path=/head/; revision=49468
* Define IF_MAXMTU and IF_MINMTU and don't allow MTUs withBrian Somers1999-08-061-2/+5
| | | | | | | | | | | | out-of-range values. ``comparison is always 0'' warnings are silly ! Ok'd by: wollman, dg Advised by: bde Notes: svn path=/head/; revision=49459
* Rename bpfilter to bpf.Dag-Erling Smørgrav1999-07-061-5/+5
| | | | Notes: svn path=/head/; revision=48645
* Set ifq_maxlen.Dmitrij Tejblum1999-02-201-1/+2
| | | | Notes: svn path=/head/; revision=44169
* Make sure the packet is aligned correctly for the alpha in if_simloop.Doug Rabson1998-07-121-2/+13
| | | | Notes: svn path=/head/; revision=37600
* OopsJulian Elischer1998-06-141-1/+2
| | | | | | | | left a "break;" out of the last patch it complains for every loopback packet.. Notes: svn path=/head/; revision=36994
* Try narrow down the culprit sending undefined packet types through the loopbackJulian Elischer1998-06-141-1/+14
| | | | Notes: svn path=/head/; revision=36992
* Remove 3 occurances of __FUNCTION__Julian Elischer1998-06-121-4/+3
| | | | Notes: svn path=/head/; revision=36933
* Go through the loopback code with a broom..Julian Elischer1998-06-121-27/+62
| | | | | | | | | | | | | | | | | | | Remove lots'o'hacks. looutput is now static. Other callers who want to use loopback to allow shortcutting should call the special entrypoint for this, if_simloop(), which is specifically designed for this purpose. Using looutput for this purpose was problematic, particularly with bpf and trying to keep track of whether one should be using the charateristics of the loopback interface or the interface (e.g. if_ethersubr.c) that was requesting the loopback. There was a whole class of errors due to this mis-use each of which had hacks to cover them up. Consists largly of hack removal :-) Notes: svn path=/head/; revision=36908
* This commit fixes various 64bit portability problems required forDoug Rabson1998-06-071-3/+3
| | | | | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time. Notes: svn path=/head/; revision=36735
* Loopback network interface driver (net/if_loop.c) has no SIOCSIFFLAGSPoul-Henning Kamp1998-04-301-1/+4
| | | | | | | | | | | ioctl handler. PR: 6466 Reviewed by: phk Submitted by: Ruslan Ermilov <ru@ucb.crimea.ua> Notes: svn path=/head/; revision=35563
* NETATALK -> opt_atalk.hEivind Eklund1998-01-091-1/+2
| | | | Notes: svn path=/head/; revision=32356
* Make INET a proper option.Eivind Eklund1998-01-081-1/+2
| | | | | | | | | | | | | | | This will not make any of object files that LINT create change; there might be differences with INET disabled, but hardly anything compiled before without INET anyway. Now the 'obvious' things will give a proper error if compiled without inet - ipx_ip, ipfw, tcp_debug. The only thing that _should_ work (but can't be made to compile reasonably easily) is sppp :-( This commit move struct arpcom from <netinet/if_ether.h> to <net/if_arp.h>. Notes: svn path=/head/; revision=32350
* Throw options IPX, IPXIP and IPTUNNEL into opt_ipx.h.Eivind Eklund1997-12-151-1/+3
| | | | | | | | | | | The #ifdef IPXIP in netipx/ipx_if.h is OK (used from ipx_usrreq.c and ifconfig.c only). I also fixed a typo IPXTUNNEL -> IPTUNNEL (and #ifdef'ed out the code inside, as it never could have compiled - doh.) Notes: svn path=/head/; revision=31742
* Removed unused #includes.Bruce Evans1997-08-021-6/+1
| | | | Notes: svn path=/head/; revision=27845
* Don't include <sys/ioctl.h> in the kernel. Stage 2: includeBruce Evans1997-03-241-2/+2
| | | | | | | <sys/sockio.h> instead of <sys/ioctl.h> in network files. Notes: svn path=/head/; revision=24204
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notPeter Wemm1997-02-221-1/+1
| | | | | | | ready for it yet. Notes: svn path=/head/; revision=22975
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* Use queue macros for the list of interfaces. Next stop: ifaddrs!Garrett Wollman1996-12-111-4/+1
| | | | Notes: svn path=/head/; revision=20337
* Set IFF_RUNNING on the loopback interface.Garrett Wollman1996-06-191-2/+2
| | | | Notes: svn path=/head/; revision=16512
* Change the use if ifnet.if_lastchange to be more in line withGary Palmer1996-06-101-2/+1
| | | | | | | | SNMP requirements. Update description of ifnet.if_lastchange in if.h to indicate this. Notes: svn path=/head/; revision=16287
* Obtained from: netatalk distribution netatalk@itd.umich.eduJulian Elischer1996-05-241-1/+13
| | | | | | | | | | Kernel Appletalk protocol support both CAP and netatalk can make use of this.. still needs some owrk but it seemd the right tiime to commit it so other can experiment. Notes: svn path=/head/; revision=15885