summaryrefslogtreecommitdiffstats
path: root/sys/net/if_loop.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-3/+3
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* don't reference a pkthdr after M_MOVE_PKTHDR has "remove it"; insteadsam2003-01-061-2/+2
| | | | | | reference the pkthdr now in the destination of the move Sponsored by: Vernier Networks
* Correct mbuf packet header propagation. Previously, packet headerssam2002-12-301-10/+10
| | | | | | | | | | | | | | | | | | | | | | were sometimes propagated using M_COPY_PKTHDR which actually did something between a "move" and a "copy" operation. This is replaced by M_MOVE_PKTHDR (which copies the pkthdr contents and "removes" it from the source mbuf) and m_dup_pkthdr which copies the packet header contents including any m_tag chain. This corrects numerous problems whereby mbuf tags could be lost during packet manipulations. These changes also introduce arguments to m_tag_copy and m_tag_copy_chain to specify if the tag copy work should potentially block. This introduces an incompatibility with openbsd which we may want to revisit. Note that move/dup of packet headers does not handle target mbufs that have a cluster bound to them. We may want to support this; for now we watch for it with an assert. Finally, M_COPYFLAGS was updated to include M_FIRSTFRAG|M_LASTFRAG. Supported by: Vernier Networks Reviewed by: Robert Watson <rwatson@FreeBSD.org>
* Under some circumstances, the loopback interface will allocate a newrwatson2002-12-181-0/+10
| | | | | | | | | | | | | | | | mbuf for a packet looping back to provide alignment guarantees for KAME. Unfortunately, this code performs a direct copy of the header rather than using a header copying primitive (largely because we have sucky header copying primitives). This results in a multiple free of the MAC label in the header when the same label data is freed twice when the two mbufs with that header are freed. As a temporary work-around, clear the initialized flag on the label to prevent the duplicate free, which prevents panics on large unaligned loopback IP and IPv6 data. The real fix is to improve and make use of proper packet header copying routines here. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* network interface and link layer changes:sam2002-11-151-1/+1
| | | | | | | | | | | | o on input don't strip the Ethernet header from packets o input packet handling is now done with if_input o track changes to ether_ifattach/ether_ifdetach API o track changes to bpf tapping o call ether_ioctl for default handling of ioctl's o use constants from net/ethernet.h where possible Reviewed by: many Approved by: re
* Replace aux mbufs with packet tags:sam2002-10-161-2/+1
| | | | | | | | | | | | | | | | | | | o instead of a list of mbufs use a list of m_tag structures a la openbsd o for netgraph et. al. extend the stock openbsd m_tag to include a 32-bit ABI/module number cookie o for openbsd compatibility define a well-known cookie MTAG_ABI_COMPAT and use this in defining openbsd-compatible m_tag_find and m_tag_get routines o rewrite KAME use of aux mbufs in terms of packet tags o eliminate the most heavily used aux mbufs by adding an additional struct inpcb parameter to ip_output and ip6_output to allow the IPsec code to locate the security policy to apply to outbound packets o bump __FreeBSD_version so code can be conditionalized o fixup ipfilter's call to ip_output based on __FreeBSD_version Reviewed by: julian, luigi (silent), -arch, -net, darren Approved by: julian, silence from everyone else Obtained from: openbsd (mostly) MFC after: 1 month
* Move all unit number management cloned interfaces into the cloningbrooks2002-05-251-16/+6
| | | | | | | | code. The reverts the API change which made the <if>_clone_destory() functions return an int instead of void bringing us into closer alignment with NetBSD. Reviewed by: net (a long time ago)
* Replace (deprecated ?) FREE() macro with direct calls to free()luigi2002-04-041-1/+1
|
* Simplify the interface cloning framework by handling unitmux2002-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
* Add cloning support to the loopback interface.brooks2002-03-041-56/+99
| | | | Submitted by: mux
* sparc64 needs the same alingment fixes that alpha and ia64 do.jake2001-12-291-1/+1
| | | | Submitted by: tmm
* whitespace fixes.jlemon2001-12-141-1/+1
|
* Pull post-4.4BSD change to sys/net/route.c from BSD/OS 4.2.ru2001-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
* Revision 1.32 corresponded to CSRG revision 8.2.ru2001-10-171-1/+1
|
* Add ia64 to the list of machines which don't do unaligned reads.dfr2001-10-051-1/+1
|
* Remove/comment tokens after #endif (#endif NETATALK)peter2001-09-101-2/+2
|
* Sync with recent KAME.ume2001-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
* "Fix" the previous initial attempt at fixing TUNABLE_INT(). This timepeter2001-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.
* Back out part of my previous commit. This was a last minute changepeter2001-06-071-1/+1
| | | | | and I botched testing. This is a perfect example of how NOT to do this sort of thing. :-(
* Make the TUNABLE_*() macros look and behave more consistantly like thepeter2001-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.
* Exterminate the use of PSEUDO_SET() with extreme prejudice.peter2001-01-311-14/+26
|
* Let M_PANIC go back to the private tree as its intention isn't understood wellbp2001-01-311-2/+1
| | | | for now.
* Use M_PANIC instead of if (sc == NULL) panic();peter2001-01-291-1/+2
|
* Make the number of loopback interfaces dynamically tunable. Why onepeter2001-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.
* Lock down the network interface queues. The queue mutex must be obtainedjlemon2000-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.
* o Add missing "\n" to warning output in netinet/if_loop.c, when anrwatson2000-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. :-)
* sync with kame tree as of july00. tons of bug fixes/improvements.itojun2000-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)
* fix KASSERT usagemjacob2000-06-021-1/+1
|
* Rather than checking for hlen causing misalignment, we should do thegallatin2000-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
* Just need to pass the address family to if_simloop(), not the whole sockaddr.archie2000-05-241-10/+12
|
* Clean up some loose ends in the network code, including the X.25 and ISOpeter2000-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
* Remove some #if NFOO > 0 that are always true because of config rules.peter2000-01-291-2/+0
|
* udp IPv6 support, IPv6/IPv4 tunneling support in kernel,shin1999-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
* KAME netinet6 basic part(no IPsec,no V6 Multicast Forwarding, no UDP/TCPshin1999-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
* Remove NBPF conditionality of bpf calls in most of our network drivers.phk1999-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.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Back out redundant checksbrian1999-08-061-5/+2
| | | | Pointed out by: bde
* Define IF_MAXMTU and IF_MINMTU and don't allow MTUs withbrian1999-08-061-2/+5
| | | | | | | | | out-of-range values. ``comparison is always 0'' warnings are silly ! Ok'd by: wollman, dg Advised by: bde
* Rename bpfilter to bpf.des1999-07-061-5/+5
|
* Set ifq_maxlen.dt1999-02-201-1/+2
|
* Make sure the packet is aligned correctly for the alpha in if_simloop.dfr1998-07-121-2/+13
|
* Oopsjulian1998-06-141-1/+2
| | | | | left a "break;" out of the last patch it complains for every loopback packet..
* Try narrow down the culprit sending undefined packet types through the loopbackjulian1998-06-141-1/+14
|
* Remove 3 occurances of __FUNCTION__julian1998-06-121-4/+3
|
* Go through the loopback code with a broom..julian1998-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 :-)
* This commit fixes various 64bit portability problems required fordfr1998-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.
* Loopback network interface driver (net/if_loop.c) has no SIOCSIFFLAGSphk1998-04-301-1/+4
| | | | | | | | ioctl handler. PR: 6466 Reviewed by: phk Submitted by: Ruslan Ermilov <ru@ucb.crimea.ua>
* NETATALK -> opt_atalk.heivind1998-01-091-1/+2
|
* Make INET a proper option.eivind1998-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>.
* Throw options IPX, IPXIP and IPTUNNEL into opt_ipx.h.eivind1997-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.)
OpenPOWER on IntegriCloud