summaryrefslogtreecommitdiffstats
path: root/sys/netmpls/mpls_input.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Pullup the mbuf before accessing the version field in the IP header.bluhm2017-12-081-2/+10
| | | | | Fix the pullup length of the shim header in mpls_do_error(). issue reported by Maxime Villard; OK deraadt@ claudio@
* Use m_freem() in error case. Found by Maxime Villardclaudio2017-12-081-2/+2
| | | | OK bluhm@
* The adjttl functions use m_pullup(). In some cases m_pullup() can returnclaudio2017-12-081-15/+15
| | | | | | | a new mbuf chain and this chain needs to be returned to the caller else a use after free may happen. Issue reported by Maxime Villard OK bluhm@ deraadt@
* mpls_shim_pop() can return NULL. Check it else we end up dereferencing NULL.claudio2017-12-081-1/+7
| | | | | Issue reported by Maxime Villard OK bluhm@ deraadt@
* The per-interface mpls flag should also also be tested on input beforederaadt2017-12-081-14/+24
| | | | | | proceeding, as described in ifconfig documentation. Discussion with claudio. Related to a report from maxime. ok claudio bluhm
* Introduce ipv{4,6}_input(), two wrappers around IP queues.mpi2017-05-301-3/+15
| | | | | | | This will help transitionning to an un-KERNEL_LOCK()ed IP forwarding path. Disucssed with bluhm@, ok claudio@
* Allow MPLS switching and VPLS across rdomains.renato2017-03-021-2/+2
| | | | OK claudio@ mpi@
* Retire the AF_MPLS protosw struct. Nothing is using it and the code was superclaudio2017-02-271-6/+1
| | | | | | | basic anyway. Simplifies the code a lot also by calling the mpls sysctl no longer via the protosw but instead directly. OK mpi@ on a previous diff. Also tested by renato@ who actually found a bug which is now fixed.
* Do not dereference ``rt->rt_ifa'' after calling rtfree(9).mpi2016-08-221-2/+3
| | | | | | | This could result in a use after free if the route entry was holding the last reference of the address descriptor. ok jca@, bluhm@, claudio@
* Revert the introduction of ``rt_addr''.mpi2016-07-111-2/+2
| | | | | | Being able to add route entries without configured addresses is a nice feature but this is not my fight. So I'd rather no add another pointer to ``struct rtentry'' if I'm not removing another one.
* Store the source address associated with a route in its own chunk ofmpi2016-06-141-2/+2
| | | | | | | | | memory. This will allow to unlink 'sruct rtentry' and 'struct ifaddr' to be able to add route entries without needing an address. ok sthen@, visa@, florian@
* There is no need to grab the KERNEL_LOCK here anymore. After discussion withclaudio2015-12-041-7/+1
| | | | dlg@ and mpi@
* Oups, forgot in the tedu of RT_REPORT commitclaudio2015-12-021-3/+3
|
* Rework the MPLS handling. Remove the lookup loops since nothing is usingclaudio2015-12-021-163/+116
| | | | | | | | | them and they make everything so much harder with no gain. Remove the ifp argument from mpls_input since it is not needed. On the input side the lookup side is modified a bit when it comes to BOS handling. Tested in a L3VPN setup with ldpd and bgpd. Commiting now so we can move on with cleaning up rt_ifp usage. If this breaks L2VPN I will fix it once reported. OK mpi@
* rtfree(9) and rtalloc(9) no longer need to be called under KERNEL_LOCK.mpi2015-10-231-20/+7
|
* Always increment rt_use inside rtalloc(9) instead of doing it in somempi2015-09-231-3/+1
| | | | | | specific places. ok claudio@, benno@
* There's no point in abstracting ifp->if_output() as long as pf_test()mpi2015-09-131-2/+2
| | | | | | needs to see lo0 in the output path. ok claudio@
* Stop overwriting the rt_ifp pointer of RTF_LOCAL routes with lo0ifp.mpi2015-09-121-2/+2
| | | | | | | | | Use instead the RTF_LOCAL flag to loop local traffic back to the corresponding protocol queue. With this change rt_ifp is now always the same as rt_ifa->ifa_ifp. ok claudio@
* Don't use mpls_input() as input handler anymore and instead call itrzalamena2015-07-291-50/+24
| | | | | | directly. Also protect non mp-safe functions while at it. ok mpi@.
* Implemented MPLS pseudowire (mpw(4)) to be used with VPLS and VPWS.rzalamena2015-07-201-1/+6
| | | | ok mpi@, claudio@.
* Kill NETISR_MPLS, from now on we will use interface input handlers to dealrzalamena2015-07-201-21/+45
| | | | | | with MPLS packets. ok mpi@, claudio@
* Store a unique ID, an interface index, rather than a pointer to thempi2015-06-161-3/+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@
* replace the use of ifqueues for most input queues serviced by netisrdlg2015-04-101-28/+9
| | | | | | | | | | | | | | | | | 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@
* unifdef some more INET. v4 4life.tedu2014-12-231-6/+1
|
* 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-3/+3
| | | | | | 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-5/+5
| | | | | | kill the macro. ok mikeb@, henning@
* Fewer <netinet/in_systm.h> !mpi2014-07-221-2/+1
|
* Remove the number of in6_var.h inclusions by moving some functions andmpi2013-10-241-3/+1
| | | | | | global variables to in6.h. ok 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@
* Keep this copy of the ICMP checksum code in sync with recent changes.mpi2013-07-101-7/+4
| | | | ok lteo@, claudio@, bluhm@, henning@
* Move various extern declarations into their corresponding header file.mpi2013-04-241-2/+1
|
* Remove various read-only *maxlen variables and use IFQ_MAXLEN directly.mpi2013-03-261-3/+2
| | | | ok beck@, mikeb@
* cosnistently use IFQ_SET_MAXLEN, surfaced in a discussion with + ok bluhmhenning2011-07-061-2/+2
|
* make mpls compile w/o errors when inet6 is not definedmikeb2011-01-211-1/+15
| | | | | diff from form@ who's too busy drinking vodka with pelmeni to commit this; ok claudio
* Handle IMPLNULL labels (#3) directly in the kernel like we do with theclaudio2010-10-071-6/+21
| | | | | explicit NULL labels. IMPLNULL labels should never ever be seen on the wire but we're realists. michele@ agrees
* First shot at ICMP error handling inside an MPLS path. Currently onlyclaudio2010-09-131-16/+118
| | | | | | TTL exceeded errors for IPv4 are handled. This makes traceroute through MPLS tunnels work (including RFC 4950 MPLS extension header). "best to get it in." deraadt@
* Use correct function name in panic()claudio2010-07-071-2/+2
|
* Fix the pop operation to make PHP work again. When popping the last labelclaudio2010-06-091-40/+76
| | | | | | | | by a pop operation we need to forward the packet to the specified nexthop as is. This is done by calling the interface output routine directly. This is different to the local operation since that one injects the packets into ip_input() via netisr. OK michele
* Kill the mpls enable sysctl knob. Since MPLS needs to be enabled explicitlyclaudio2010-06-021-2/+2
| | | | | on each interface there is no need for yet another knob. OK michele@
* Add a comment about the explicit NULL label handling. We follow RFC 4182claudio2010-05-311-1/+6
| | | | | which relaxes the position of these labels. After discussion with Christophe Fillot (cf (at) utc fr)
* 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-29/+38
| | | | | | | | | | | 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).
* Start cleaning up the mess called rtalloc*. Kill rtalloc2, make rtalloc1claudio2010-05-071-3/+2
| | | | | | | | accept flags for report and nocloning. Move the rtableid into struct route (with a minor twist for now) and make a few more codepathes rdomain aware. Appart from the pf.c and route.c bits the diff is mostly mechanical. More to come... OK michele, henning
* Split up functionalities between mpls_input and mpls_output.michele2009-04-291-19/+3
| | | | | | | | The former is responsible to handle packets destined to localhost, the latter handles packet that have to be forwarded or the ones originated from localhost. "i like it" claudio@
* Introduce a new dummy operation to easily handle packets that have to leavemichele2009-04-281-4/+20
| | | | | | the MPLS cloud and join ipv4/ipv6 stack. ok claudio@ laurent@
* Correctly handle packets that are leaving the MPLS cloud andmichele2009-04-171-6/+105
| | | | | | | | | joining the ipv4/ipv6 stack. Get also rid of the dependency on mpe(4) for packets not belonging to VPN traffic. ok laurent@, ok and input claudio@
* Get rid of the ugly rtentry hack.michele2009-01-281-13/+22
| | | | | | | | 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@
* Fix sockaddr_mpls structure.michele2009-01-081-17/+17
| | | | | | | | | Now it contains just the label as it must be. This introduces a ugly hack in rtentry that will be removed as soon as possible. OK claudio@
* Initial fixup of sockaddr_mpls struct.michele2008-12-151-10/+8
| | | | | | | | Remove smpls_in_iface as labels must be per platform unique. Remove smpls_out_iface. It is redudant and can be inferred from nexthop. Move smpls_operation to rt_flags and temporary remove smpls_out_exp. ok claudio@