summaryrefslogtreecommitdiffstats
path: root/sys/net/if_mpip.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Only install route with label, fix route leak on destroykn2021-03-261-1/+5
| | | | | | | | | | | | | | | | | | | | | ifconfig mp* mplslabel N" validates the label both in ifconfig(8) and each driver's ioctl handler, but there is one case where all drivers install a route without looking at the label at all. SIOCSLIFPHYRTABLE in all three drivers just validates the rdomain and sets the label to itself (0) such that the route is (re)installed accordingly. None of the driver's helper functions dealing with labels and routes validate labels themselves but instead expect the callees, e.g. the ioctl handler to do so. That means we can install routes for the explicit NULL label in non-default routing tables but are never able to clean them up without reboot. Fix this by adding the inverse of mp*_clone_destroy()'s label check to the routines installing the MPLS route to avoid bogus ones in the first place. OK claudio
* Use correct rdomain when adding/deleting routeskn2021-03-171-5/+5
| | | | | | | | | | | | | | | | mpip(4) always adds and deletes routes in rdomain 0 regardless of the `tunneldomain', i.e. the `sc_rdomain' value. mpw(4) adds routes with the specified rdomain but always deletes them in rdomain 0. mpe(4) consistently uses the softc's rdomain which is tracked consistently across the various ioctls -- no fix needed. Found while reading the code and testing ifconfig(8)'s "tunneldomain" in order to document MPLS ioctls. OK claudio
* move from calling l3 protocol input handlers to using if_vinput.dlg2021-02-201-21/+6
| | | | | | 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@
* Change users of IFQ_PURGE() to use the "new" API.patrick2020-07-101-4/+4
| | | | ok dlg@ tobhe@
* make ph_flowid in mbufs 16bits by storing whether it's set in csum_flags.dlg2020-06-171-4/+5
| | | | | i've been wanting to do this for a while, and now that we've got stoeplitz and it gives us 16 bits, it seems like the right time.
* 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-5/+63
|
* use txprio to control the use of exp as a priority fielddlg2019-04-171-5/+58
| | | | | | | | 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.
* 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-2/+8
| | | | | consistently set the rtabled for "outgoing" packets to the encap rdomain. use this for rtallocs in mpip too instead of assuming 0.
* make SIOCGETLABEL fail with EADDRNOTAVAIL if the label is not set.dlg2019-03-181-2/+2
| | | | this makes ifconfig print "(unset)" to show the label isn't set yet.
* Add mpip(4), an IP tunnel interface for "IP Layer 2" over MPLS pseudowiresdlg2019-02-281-0/+706
This is basically mpw(4), but it carries IP directly instead of Ethernet. On the wire it can look the same as what IP over MPLS looks like, but because it is a pseudowire you can configure a control word or the FAT label to improve load balancing. It can be used to quickly set up an IP tunnel over an MPLS fabric without the need to configure bgpd and mpe(4) interfaces. Because It implements the same pwe3 ioctls that mpw(4) uses ifconfig already supports configuration of mpip(4) interfaces. ldpd will grow support for this in the near future. This is not hooked up to the build yet discussed with claduio@ at ak219 ok claudio@