summaryrefslogtreecommitdiffstats
path: root/sys/net/if_mpe.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* move from calling l3 protocol input handlers to using if_vinput.dlg2021-02-201-19/+8
| | | | | | if_vinput requires mpsafe interface counters, so add those in. this factors out some more code between drivers. monitor mode will work on these interfaces now too.
* Leave default ifq_maxlen handling to ifq_init()kn2020-08-211-2/+1
| | | | | | | | | | | | Most clonable interface drivers (except bridge, enc, loop, pppx, switch, trunk and vlan) initialise the send queue's length to IFQ_MAXLEN during *_clone_create() even though ifq_init(), which is eventually called through if_attach(), does the same. Remove all early "ifq_set_maxlen(&ifq->if_snd, IFQ_MAXLEN);" lines to leave it to ifq_init() and have clonable drivers a tad more in sync. OK mvs
* Change users of IFQ_SET_MAXLEN() and IFQ_IS_EMPTY() to use the "new" API.patrick2020-07-101-2/+2
| | | | ok dlg@ tobhe@
* cleanup unused headers generated by configjsg2020-01-241-2/+1
| | | | ok tedu@ krw@ deraadt@
* The MPLS edge devices get the packets from the MPLS stack which neverclaudio2019-06-261-4/+3
| | | | | | | passed though pf_test(). So there is no need to try to call pf_pkt_addr_changed() instead just check that the PF statekey is NULL. Initial problem of not including pf.h found by jsg@ OK jsg@ sashan@
* use the factored out txhprio and rxhprio checksdlg2019-04-191-16/+5
| | | | reduces code duplication and chance for error.
* implement rxpriodlg2019-04-191-4/+64
|
* use txprio to control the use of exp as a priority fielddlg2019-04-171-4/+48
| | | | | | | | by default txprio is set to 0, so the exp field will be 0. howerver, txprio on mpe/mpw/mpip can be configured with other values or settings like our other tunnel or encapsulation interfaces. intermediate LSPs can use the exp field to manage their prioritisation of encapsulated traffic.
* call pf_pkt_addr_changed on inputdlg2019-04-021-1/+5
| | | | | makes this consistent with other tunnel drivers, but mostly to avoid having state info leak between layers of encapsulation.
* clear the BCAST and MCAST mbuf flags for "outgoing" packets.dlg2019-04-021-1/+2
| | | | | | | | | if these remain set then output on the underlying interface may mistakenly be done with the wrong protocol type (eg, MPLS_MCAST instead of MPLS), and to the wrong link layer address. reported by Lee Nelson the specific problem was identified by Mitchell Krome
* some mbuf ph_rtableid fixesdlg2019-04-021-4/+4
| | | | | consistently set the rtabled for "outgoing" packets to the encap rdomain. use this for rtallocs in mpip too instead of assuming 0.
* tweak SIOCGETLABEL and add SIOCDELLABELdlg2019-03-181-1/+14
| | | | makes mpe consistent with mpw and mpip
* use NET_LOCK to coordinate destroying a cloned interface.dlg2019-02-261-11/+7
|
* add the locking for coordinating between ioctls and a clone destroy.dlg2019-02-201-9/+29
| | | | | i wrote this in mpe before porting and committing it in mpw, but forgot to commit the mpe version.
* use the configured route domain for the mpls tunnel when sending packets.dlg2019-02-141-2/+3
|
* allow configuration of the rdomain the mpls encap operates indlg2019-02-141-14/+45
| | | | | | | | this borrows the SIOCSLIFPHYRTABLE and SIOCGLIFPHYRTABLE that tunnel interfaces implement to set the rdomain mpls operates in. ifconfig tunneldomain X lets you set it, and you can see the effect with netstat -nr -f mpls -TX, but ifconfig currently doesnt show the tunneldomain. yet.
* don't confuse the interface rdomain with the one the local label is in.dlg2019-02-131-12/+1
| | | | | | SIOCSIFRDOMAIN is about the routes on top of an mpe interface. the rdomain mpls operates in is independent of that, and currently restricted to rdomain 0.
* change rt_ifa_add and rt_ifa_del so they take an rdomain argument.dlg2019-02-131-5/+5
| | | | | | | | | | | | this allows mpls interfaces (mpe, mpw) to pass the rdomain they wish the local label to be in, rather than have it implicitly forced to 0 by these functions. right now they'll pass 0, but it will soon be possible to have them rx packets in other rdomains. previously the functions used ifp->if_rdomain for the rdomain. everything other than mpls still passes ifp->if_rdomain. ok mpi@
* add M_CANFAIL to malloc, and return ENOMEM if allocating an interfacedlg2019-02-111-2/+5
| | | | fails.
* whitespace tweak, no functional changedlg2019-02-101-2/+2
|
* get rid of the global list of mpe interfaces, it's not needed anymoredlg2019-02-101-18/+1
| | | | | | | mpe would try to detect label collisions itself, but wasn't coordinating with mpw or other labels, making it's solution incomplete. this also means i won't need extra locking if i try to make the ioctl paths mpsafe.
* use "sc" as the name of the softc variable in the ioctl code too.dlg2019-01-311-17/+14
| | | | | while there, assign int when declaring the sc variable so the ioctl paths do less.
* use MPLS_SHIM2LABEL and MPLS_LABEL2SHIMdlg2019-01-301-5/+3
|
* dont store the unit when creating the interface, it's never useddlg2019-01-301-3/+1
|
* get rid of unused globaldlg2019-01-281-2/+1
|
* fix mpe_start by if_put()ting the right ifpdlg2019-01-281-29/+23
| | | | shuffle mpe_output while here.
* make a start at supporting ipv6 on mpe.dlg2019-01-281-64/+62
| | | | | we still can't assign a v6 address to the interface, or handle icmp error generation, but denis@ is working toward that.
* don't play with IFF_UP in strange places.dlg2019-01-271-9/+1
|
* use mpls_ip_adjttl and mpls_ip6_adjttl in mpe instead of rolling it again.dlg2019-01-271-26/+7
| | | | | | | | mpls_ip_adjttl now patches the checksum rather than check it and calculate it again. both mpls_ip_adjttl and mpls_ip6_adjttl now rely on the caller to check the sysctls for whether they should run or not, which paves the way for making it configurable in mpe via the tunnel ioctls.
* rework mpe_input so it patches ipv4 cksum, and handles ipv6 too.dlg2019-01-271-35/+58
| | | | | | | | | rather than check and recalculate the ipv4 checksum, we can update the cksum incrementally. this is a bit faster, and means we'll see more things on bpf. also, peek at the first nibble so we can tell ipv6 from ipv4. i consider them the same FEC, so either can be received now.
* change how packets are pushed into mpe(4).dlg2019-01-271-42/+30
| | | | | | | mpe(4) adds itself ot the mpls rtable with RTF_LOCAL set, which pushes the packet through mpe_output, which sees RTF_LOCAL can calls mpe_input. this follows what mpw(4) does, and removes a special case in mpls_input.
* move the mpe_softc definition and mpe macros into the mpe driver.dlg2019-01-271-1/+16
|
* use sc as the name of the softc variable.dlg2019-01-271-17/+17
| | | | makes this more like other drivers to read.
* put underscores in function names like other driversdlg2019-01-271-10/+10
| | | | | | | mpestart, mpeioctl and mpeoutput are now mpe_start, mpe_ioctl, and mpe_output respectively. no functional change
* Creating a cloned interface could return ENOMEM due to temporarybluhm2018-01-091-5/+2
| | | | | | memory shortage. As it is invoked from a system call, it should not fail and wait instead. OK visa@ mpi@
* Make mpe(4) work again by:claudio2017-11-291-9/+20
| | | | | | | | | | - Change the way mpe figures out the IP of the MPLS nexthop. Instead of using RTF_GATEWAY and so a valid (and cachable) gateway route just use the gateway IP address of the route (rt->rt_gateway). - Make sure the interface is up when adding a mplslabel. The inserted route is in rtable 0 and so invisible for the link state tracker. Forcing the if_up ensures that the added route is RTF_UP. OK mpi@
* Remove unneeded null pointer check in mpe_input*: ifp cannot be NULL.reyk2017-08-141-3/+3
| | | | | | | | This was a bit confusing for the scanner and when reviewing the code. Coverity CIDs 1453053 1453106; Severity: Insignificant ok mpi@
* sizes for free()deraadt2017-05-301-2/+2
|
* Introduce ipv{4,6}_input(), two wrappers around IP queues.mpi2017-05-301-3/+3
| | | | | | | This will help transitionning to an un-KERNEL_LOCK()ed IP forwarding path. Disucssed with bluhm@, ok claudio@
* Introduce sstosa() for converting sockaddr_storage with a type safebluhm2017-05-041-2/+2
| | | | | | | inline function instead of casting it to sockaddr. While there, use inline instead of __inline for all these conversions. Some struct sockaddr casts can be avoided completely. OK dhill@ mpi@
* A space here, a space there. Soon we're talking real whitespacekrw2017-01-241-5/+5
| | | | rectification.
* Flag pseudo-interfaces as such in order to call add_net_randomness()mpi2017-01-231-1/+2
| | | | | | | | | only once per packet. Fix a regression introduced when if_input() started to be called by every pseudo-driver. ok claudio@, dlg@
* Kill recursive splsoftnet()/splx() dances in ioctl(2) path.mpi2016-12-201-6/+2
| | | | ok rzalamena@
* Remove recursive splsoftnet() calls, from David Hill.mpi2016-09-211-4/+1
|
* We're always ready! So send IFQ_SET_READY() to the bitbucket.mpi2016-04-131-2/+1
|
* No need for a splnet() dance around IFQ_DEQUEUE() anymore.mpi2016-01-141-5/+1
| | | | From David Hill, ok dlg@
* remove old lint annotationstedu2015-12-051-2/+1
|
* Kill the RT_REPORT flag to rtalloc() and stop sending RTM_MISS messagesclaudio2015-12-021-2/+2
| | | | | | for failed route lookups. This is something that was maybe useful in the 90is but in this modern times it is just annoying and nothing expect it anyway. OK mpi@, sthen@
* Do not use rt_ifp directly.mpi2015-11-061-8/+17
| | | | ok claudio@
* Kill link_rtrequest(), introduce in 1990 to "fix" the resultmpi2015-10-221-2/+1
| | | | | | | of rt_getifa() when adding link level route from outside the kernel. ok claudio@