summaryrefslogtreecommitdiffstats
path: root/sys/net/if_mpe.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Inspired by satosin(), use inline functions to convert sockaddr dl.bluhm2015-10-221-2/+3
| | | | | | Instead of casts they check wether the incoming object has the expected type. So introduce satosdl() and sdltosa() in the kernel. OK mpi@
* Now that rtrequest1(9) properly sets RTF_UP for newly added route,mpi2015-09-121-5/+5
| | | | | | stop passing it in every rt_ifa_add(9) calls. ok claudio@
* Rename if_output() into if_enqueue() to avoid confusion with commentsmpi2015-06-301-2/+2
| | | | | | talking about (*ifp->if_output)(). ok claudio@, dlg@
* Store a unique ID, an interface index, rather than a pointer to thempi2015-06-161-4/+4
| | | | | | | | | | | | | | | receiving interface in the packet header of every mbuf. The interface pointer should now be retrieved when necessary with if_get(). If a NULL pointer is returned by if_get(), the interface has probably been destroy/removed and the mbuf should be freed. Such mechanism will simplify garbage collection of mbufs and limit problems with dangling ifp pointers. Tested by jmatthew@ and krw@, discussed with many. ok mikeb@, bluhm@, dlg@
* Introduce if_output(), a function do to the last steps before enqueuingmpi2015-05-151-12/+2
| | | | | | | | a packet on the sending queue of an interface. Tested by many, thanks a lot! ok dlg@, claudio@
* replace the use of ifqueues for most input queues serviced by netisrdlg2015-04-101-11/+6
| | | | | | | | | | | | | | | | | with niqueues. this change is so big because there's a lot of code that takes pointers to different input queues (eg, ether_input picks between ipv4, ipv6, pppoe, arp, and mpls input queues) and falls through to code to enqueue packets against the pointer. if i changed only one of the input queues id have to add sepearate code paths, one for ifqueues and one for niqueues in each of these places by flipping all these input queues at once i can keep the currently common code common. testing by mpi@ sthen@ and rafael zalamena ok mpi@ sthen@ claudio@ henning@
* Use rt_ifa_add(9) and rt_ifa_del(9) to configure MPLS labels.mpi2015-03-261-49/+30
| | | | | | | | | | | | | Since the removal of the link-layer ifa from "struct ifnet" it was impossible to configure MPLS routes on mpe(4). Because just like enc(4), mpe(4) was abusing the link-layer ifa to attach its route entries. So explicitly pass a "glue" ifa to the routing layer. From Rafael Zalamena who discovered this the hardway, thanks! ok claudio@
* Make sure rtrequest1(9) is called under splsoftnet().mpi2014-12-221-3/+6
|
* unifdef INET in net code as a precursor to removing the pretend option.tedu2014-12-191-8/+1
| | | | | long live the one true internet. ok henning mikeb
* Explicitly include <net/if_var.h> instead of pulling it in <net/if.h>.mpi2014-12-051-1/+2
| | | | ok mikeb@, krw@, bluhm@, tedu@
* Rename rtalloc1() into rtalloc(9) and convert its flags to only enablempi2014-11-011-2/+2
| | | | | | functionnality instead of a mix of enable/disable. ok bluhm@, jca@
* Use rtfree() instead of RTFREE(), NULLify some free'd route pointers andmpi2014-10-141-2/+2
| | | | | | kill the macro. ok mikeb@, henning@
* Since the list of mpe(4) interfaces is only accessed in process context,mpi2014-10-071-7/+1
| | | | | | it does not need to be protected by splnet(). Rafael Zalamena agrees, no objection from the MPLS gang.
* Fewer <netinet/in_systm.h> !mpi2014-07-221-2/+1
|
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-2/+2
| | | | after discussions with beck deraadt kettenis.
* "struct pkthdr" holds a routing table ID, not a routing domain one.mpi2014-04-141-8/+8
| | | | | | | | | | | | | | Avoid the confusion by using an appropriate name for the variable. Note that since routing domain IDs are a subset of the set of routing table IDs, the following idiom is correct: rtableid = rdomain But to get the routing domain ID corresponding to a given routing table ID, you must call rtable_l2(9). claudio@ likes it, ok mikeb@
* Remove the number of in6_var.h inclusions by moving some functions andmpi2013-10-241-2/+1
| | | | | | global variables to in6.h. ok deraadt@
* Remove the number of in_var.h inclusions by moving some functions andmpi2013-10-231-2/+1
| | | | | | global variables to in.h. ok mikeb@, deraadt@
* The header file netinet/in_var.h included netinet6/in6_var.h. Thisbluhm2013-10-171-1/+2
| | | | | | | created a bunch of useless dependencies. Remove this implicit inclusion and do an explicit #include <netinet6/in6_var.h> when it is needed. OK mpi@ henning@
* no need for a lot of code to include proc.htedu2013-03-281-2/+1
|
* Remove various read-only *maxlen variables and use IFQ_MAXLEN directly.mpi2013-03-261-2/+2
| | | | ok beck@, mikeb@
* Use DLT_LOOP for all tunneling interfaces.yasuoka2012-04-141-2/+2
| | | | | | | | Byte order adjustment for bpf was hidden behind bpf_mtap_af() and sizeof(u_int32_t) is used for length of the bpf header. tested by sebastia and mxb at alumni.chalmers.se. ok claudio
* Fix packet accounting in error cases.mcbride2011-08-201-2/+2
| | | | From Christiano F. Haesbaert.
* Replace another m_free() with m_freem() to plug an mbuf leak in mpe_input().reyk2011-01-281-2/+2
| | | | ok gollo@
* make mpls compile w/o errors when inet6 is not definedmikeb2011-01-211-1/+5
| | | | | diff from form@ who's too busy drinking vodka with pelmeni to commit this; ok claudio
* No need to m_freem() a NULL pointer and change the error for unknownclaudio2010-09-211-3/+2
| | | | protocols to EPFNOSUPPORT.
* Move the iface specific ioctl call for SIOCSIFRDOMAIN further down so thatclaudio2010-08-251-1/+12
| | | | | | all the magic cleanup happens before. This is needed because mpe(4) needs to add a route which would be removed by the cleanup code. OK henning
* m_copyback can fail to allocate memory, but is a void fucntion so gymnasticsblambert2010-07-021-3/+3
| | | | | | | | | are required to detect that. Change the function to take a wait argument (used in nfs server, but M_NOWAIT everywhere else for now) and to return an error ok claudio@ henning@ krw@
* Do not use IF_ENQUEUE() but IF_INPUT_ENQUEUE() instead. The first makroclaudio2010-05-311-3/+3
| | | | | | does no overflow checking and does not set the congestion flag. Protocol input queues (inet, inet6, ...) should always use IF_INPUT_ENQUEUE(). OK henning@
* Rework the way we handle MPLS in the kernel. Instead of fumbling MPLS intoclaudio2010-05-281-41/+142
| | | | | | | | | | | ether_output() and later on other L2 output functions use a trick and over- load the ifp->if_output() function pointer on MPLS enabled interfaces to go through mpls_output() which will then call the link level output function. By setting IFXF_MPLS on an interface the output pointers are switched. This now allows to cleanup the MPLS input and output pathes and fix mpe(4) so that the MPLS code now actually works for both P and PE systems. Tested by myself and michele (A custom kernel with MPLS and mpe enabled is still needed).
* No need to call bpfdetach() in mpe_clone_destroy() since this is done inclaudio2010-01-091-4/+1
| | | | | if_detach() which is called right afterwards. Found by Gleydson Soares (gleydson (at) trusted.com.br)
* Initial rdomain support for mpe(4). Caveat: assumes MPLS is always inclaudio2009-12-261-1/+19
| | | | rdomain 0 for now. OK michele@
* dont initialise ifp->if_snd.ifq_maxlen, and then follow it bydlg2009-07-131-2/+1
| | | | | | IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen). the first was deprecated by the use of IFQ_SET_MAXLEN.
* Get rid of the ugly rtentry hack.michele2009-01-281-2/+2
| | | | | | | | We can now act as edge node and allow ipv4 packets to enter a Label Switched Path and not just forwarding MPLS packets. OK claudio@
* Introduced IPv6 support of uniform model for TTL handling.michele2008-11-061-4/+12
| | | | OK claudio@ laurent@
* Introduced Uniform Model for TTL handling.michele2008-11-011-7/+38
| | | | | | | | MPLS TTL is mapped into network layer one as the packet exits the LSP. Just IPv4 support for now. Added the relevant sysctls to enable this behaviour. Input and OK claudio@
* Added mpls_output() used to output mpls packets originating from local host.michele2008-10-281-8/+2
| | | | | | Strictly similar to mpls_input(). Input and OK claudio@, OK laurent@
* Prevent the user to assign reserved labels to mpe(4) interfaces.michele2008-10-181-2/+3
| | | | OK claudio@
* Now mpls_input() handles ipv4 and ipv6 explicit null labels.michele2008-10-141-4/+26
| | | | | | Added mpe_input6 to manage also ipv6 packets insted of just ipv4 ones. OK claudio@ laurent@
* Add license and OpenBSD RCS Tag to the file, spotted by Dries Schellekens.pyr2008-05-081-0/+17
|
* Start at making mpe tap to bpf. While there move if_start() call insidepyr2008-05-081-9/+30
| | | | | | splnet. The DLT_MPLS will not go away and will be used for display in tcpdump -y mpls when the code is there, as suggested by reyk.
* Hook mpe(4) correctly into mpls so that it is possible to tunnel packets overclaudio2008-05-081-17/+13
| | | | MPLS. Still a bit hackish but getting closer. hai norby@
* UP mpe interfaces.norby2008-05-081-0/+1
| | | | ok claudio@
* Missing return and correctly indent a debug printf.claudio2008-05-071-3/+3
|
* add mpe_input() to be able to be fed packets that will reenter ip.pyr2008-05-071-0/+32
| | | | | | no consumers yet, they should come soon. ok norby@
* Make mpe a point-to-point interface.pyr2008-05-071-1/+9
| | | | | Make the mtu user definable. ok claudio@
* Correctly initialize labels by byte-swapping and inserting BoS and TTL.pyr2008-05-071-6/+12
| | | | | | | | While there bump MTU to 1500 and set the receiving interface before calling mpls_input. mpestart will eventually call mpls_output when it exists. ``yaaaaayyy'' and ok claudio@ and norby@
* bring in the mpe interface - for ``MPLS Provider Edge'' - this is a workpyr2008-05-061-0/+216
in progress and some bits need to be cleaned up but will be in-tree for convenience. ok claudio@, norby@