summaryrefslogtreecommitdiffstats
path: root/sys/net/if_gif.c
Commit message (Collapse)AuthorAgeFilesLines
* o eliminate widespread on-stack mbuf use for bpf by introducingsam2003-12-281-28/+2
| | | | | | | | | | | | | a new bpf_mtap2 routine that does the right thing for an mbuf and a variable-length chunk of data that should be prepended. o while we're sweeping the drivers, use u_int32_t uniformly when when prepending the address family (several places were assuming sizeof(int) was 4) o return M_ASSERTVALID to BPF_MTAP* now that all stack-allocated mbufs have been eliminated; this may better be moved to the bpf routines Reviewed by: arch@ and several others
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-311-2/+1
| | | | | | | | | | | | | if_xname, if_dname, and if_dunit. if_xname is the name of the interface and if_dname/unit are the driver name and instance. This change paves the way for interface renaming and enhanced pseudo device creation and configuration symantics. Approved By: re (in principle) Reviewed By: njl, imp Tested On: i386, amd64, sparc64 Obtained From: NetBSD (if_xname)
* Update netisr handling; Each SWI now registers its queue, and all queuejlemon2003-03-041-8/+1
| | | | | | | | | | drain routines are done by swi_net, which allows for better queue control at some future point. Packets may also be directly dispatched to a netisr instead of queued, this may be of interest at some installations, but currently defaults to off. Reviewed by: hsu, silby, jayanth, sam Sponsored by: DARPA, NAI Labs
* Back out M_* changes, per decision of the TRB.imp2003-02-191-3/+3
| | | | Approved by: trb
* 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.
* network interface and link layer changes:sam2002-11-151-2/+2
| | | | | | | | | | | | 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
* last arg of in6?_gif_output() is not used any more.ume2002-10-171-2/+2
| | | | | Obtained from: KAME MFC after: 3 weeks
* - drop too short IPv6 frameume2002-10-171-10/+15
| | | | | | | - NULL != 0 Obtained from: KAME MFC after: 3 weeks
* s/gifp/ifp/ume2002-10-171-11/+11
| | | | | Obtained from: KAME MFC after: 3 weeks
* - after gif_set_tunnel(), psrc/pdst may be null. set IFF_RUNNING accordingly.ume2002-10-161-133/+157
| | | | | | | | | | | | | | - set IFF_UP on SIOCSIFADDR. be consistent with others. - set if_addrlen explicitly (just in case) - multi destination mode is long gone. - missing break statement - add gif_set_tunnel(), so that we can set tunnel address from within the kernel at ease. - encap_attach/detach dynamically on ioctls - move encap_attach() to dedicated function in in*_gif.c Obtained from: KAME MFC after: 3 weeks
* Revert 1.27, as it breaks IPv6 over IPv4 tunnels.sobomax2002-09-261-2/+2
| | | | Submitted by: Mark Huizer <xaa@timewasters.nl>, ume
* mistakenly set IFF_UP by SIOCSIFPHYADDR.ume2002-09-201-4/+0
| | | | Obtained from: KAME
* Restore original behaviour of recursion preventer.sobomax2002-09-131-4/+7
| | | | Submitted by: sumikawa
* Since from now on encap_input() also catches IPPROTO_MOBILE and IPPROTO_GREsobomax2002-09-091-2/+2
| | | | | | | | packets in addition to IPPROTO_IPV4 and IPPROTO_IPV6, explicitly specify IPPROTO_IPV4 or IPPROTO_IPV6 instead of -1 when calling encap_attach(). MFC after: 28 days (along with other if_gre changes)
* Make recursion prevention variable per-instance and remove XXX commentsobomax2002-09-051-7/+4
| | | | | | about thread-unsafety. MFC after: 2 weeks
* Correct error handling during MAC transmission check for if_gif.rwatson2002-08-121-2/+5
| | | | | Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Introduce support for Mandatory Access Control and extensiblerwatson2002-08-011-1/+12
| | | | | | | | | | | kernel access control. Label packets generated by the gif virtual interface. Perform access control on packets delivered to gif virtual interfaces. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Move all unit number management cloned interfaces into the cloningbrooks2002-05-251-4/+3
| | | | | | | | 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)
* just merged cosmetic changes from KAME to ease sync between KAME and FreeBSD.suz2002-04-191-7/+6
| | | | | | | (based on freebsd4-snap-20020128) Reviewed by: ume MFC after: 1 week
* Remove __P.alfred2002-03-191-5/+5
|
* Simplify the interface cloning framework by handling unitmux2002-03-111-46/+5
| | | | | | | | | 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
* Change the network interface cloning API so the destroy function returnsbrooks2002-03-041-2/+3
| | | | | | | | an int errorcode instead of void in preperation for merging cloning of the loopback device. Submitted by: mux MFC after: 2 weeks
* Fix warnings in the gif(4) driver so it compiles with -Werror.brooks2002-02-261-4/+6
|
* Make gif(4) nesting level and parallel tunnel support tunable at runtimebrooks2002-02-261-5/+27
| | | | | | via sysctl's. The old #defines, MAX_GIF_NEST and XBONEHACK are currently supported for backwards compatability, but will probably be removed at some point in the future.
* Staticise private interface lists.msmith2002-01-081-1/+1
|
* /home/brooks/ng_gif.messagebrooks2001-09-261-1/+19
|
* Use LIST_ macros instead of TAILQ_ macros to be more like NetBSD.brooks2001-09-261-6/+7
| | | | Obtained from: NetBSD
* Patches from Keiichi SHIMA <keiichi@iij.ad.jp>julian2001-09-031-2/+1
| | | | | | to make ip use the standard protosw structure again. Obtained from: Well, KAME I guess.
* gif(4) and stf(4) modernization:brooks2001-07-021-71/+194
| | | | | | | | | | | - Remove gif dependencies from stf. - Make gif and stf into modules - Make gif cloneable. PR: kern/27983 Reviewed by: ru, ume Obtained from: NetBSD MFC after: 1 week
* Suppress update ifnet.iflastchange when processing packets for SNMPsumikawa2001-06-191-1/+0
| | | | | | | | | | | | | requirements(RFC1573, interface MIB). This change for 4.4BSD was first introduced in if_ethersubr.c:1.17->1.18. BTW, iflastchange on all of IFs are inconsistent. e.g. ether, tun: update fddi, tokenring, ppp: not update I'll make patch later. Obtained from: KAME MFC after: 2 weeks
* Sync with recent KAME.ume2001-06-111-54/+130
| | | | | | | | | | | | | | | | | | 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
* First, wrap the if_up() call into splimp()/splx() becauseyar2001-06-031-2/+5
| | | | | | | | | | | if_up() must be called at splnet or higher. Second, set the IFF_RUNNING flag on an interface after its resources (i.e. tunnel source and destination addresses) have been set. Note that we don't set IFF_UP because it is if_up()'s job to do that. PR: kern/27851 Submitted by: Horacio J. PeÓa <horape@compendium.com.ar>
* * Rename M_WAIT mbuf subsystem flag to M_TRYWAIT.bmilekic2000-12-211-1/+1
| | | | | | | | | | | | | | | | | | This is because calls with M_WAIT (now M_TRYWAIT) may not wait forever when nothing is available for allocation, and may end up returning NULL. Hopefully we now communicate more of the right thing to developers and make it very clear that it's necessary to check whether calls with M_(TRY)WAIT also resulted in a failed allocation. M_TRYWAIT basically means "try harder, block if necessary, but don't necessarily wait forever." The time spent blocking is tunable with the kern.ipc.mbuf_wait sysctl. M_WAIT is now deprecated but still defined for the next little while. * Fix a typo in a comment in mbuf.h * Fix some code that was actually passing the mbuf subsystem's M_WAIT to malloc(). Made it pass M_WAITOK instead. If we were ever to redefine the value of the M_WAIT flag, this could have became a big problem.
* Lock down the network interface queues. The queue mutex must be obtainedjlemon2000-11-251-12/+4
| | | | | | | | | | | | | | 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.
* Temporary hack for the benefit of the X-Bone projectkris2000-07-201-0/+2
| | | | | | (http://www.isi.edu/xbone). I expect this to go away in due course. Submitted by: Lars Eggert <larse@ISI.EDU>
* sync with kame tree as of july00. tons of bug fixes/improvements.itojun2000-07-041-96/+239
| | | | | | | API changes: - additional IPv6 ioctls - IPsec PF_KEY API was changed, it is mandatory to upgrade setkey(8). (also syntax change)
* IPv6 6to4 support.shin2000-03-111-2/+17
| | | | | | | | | | | | | | | | | | | | | Now most big problem of IPv6 is getting IPv6 address assignment. 6to4 solve the problem. 6to4 addr is defined like below, 2002: 4byte v4 addr : 2byte SLA ID : 8byte interface ID The most important point of the address format is that an IPv4 addr is embeded in it. So any user who has IPv4 addr can get IPv6 address block with 2byte subnet space. Also, the IPv4 addr is used for semi-automatic IPv6 over IPv4 tunneling. With 6to4, getting IPv6 addr become dramatically easy. The attached patch enable 6to4 extension, and confirmed to work, between "Richard Seaman, Jr." <dick@tar.com> and me. Approved by: jkh Reviewed by: itojun
* Wrap if_up() by splnet.shin2000-02-271-1/+7
| | | | | | Approved by: jkh Submitted by: peter
* Remove #if NGIF > 0 and #if NFAITH > 0 as config already checks this.peter2000-01-291-3/+0
|
* udp IPv6 support, IPv6/IPv4 tunneling support in kernel,shin1999-12-071-0/+468
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
OpenPOWER on IntegriCloud