summaryrefslogtreecommitdiffstats
path: root/sys/net (follow)
Commit message (Collapse)AuthorAgeFilesLines
* free(9) sizes for buffers.mpi2019-06-131-4/+4
| | | | ok anton@, sashan@
* free(9) sizes.mpi2019-06-131-4/+3
| | | | ok kn@
* Copy the user provided sockaddr into a normalized sockaddr in rtrequest()claudio2019-06-131-16/+59
| | | | | | | | | | before adding it to the routing table. The rtable code is doing memcmp() of those rt_dest sockaddrs so it is important that they are stored in a canonical form. To do this struct domain is extended to include the sockaddr size for this address family. OK bluhm@ anton@ Reported-by: syzbot+10fe9cd8d0211c562ead@syzkaller.appspotmail.com
* use m_microtime to get the packet rx time it might be available.dlg2019-06-101-3/+9
|
* don't allow userland to change if_type.dlg2019-06-101-2/+3
| | | | | | if_type is now immutable in tun(4) and tap(4) ok claudio@ mpi@
* Use mallocarray(9) & put some free(9) sizes for M_IPMOPTS allocations.mpi2019-06-102-10/+10
| | | | ok semarie@, visa@
* Always return EEXIST if an interface is already part of a bridge.mpi2019-06-091-2/+5
|
* Remove code for non-Ethernet members, these are no longer supported.mpi2019-06-091-15/+11
| | | | From Eygene Ryabinkin.
* Remove workaround and return EINVAL when userland sends routing messagesclaudio2019-06-051-10/+3
| | | | | with bad address flags. OK bluhm@ sthen@
* if_netisr(): trade NET_LOCK() for NET_RLOCK()sashan2019-06-041-5/+5
| | | | OK mpi@
* pfsync_sendout() requires PF_LOCK()sashan2019-06-041-1/+7
| | | | OK mpi@
* Repair state and flag bitmasks to match RFC, from Mitchell Kromederaadt2019-06-021-3/+3
| | | | ok claudio
* Fix reporting of up->down transition in routing messagekn2019-05-281-2/+2
| | | | | | | | | The code for updating the laststate and timer is looking at laststate before it's been updated. From Mitchell Krome <mitchellkrome at gmail dot com>, thanks! OK claudio
* init sc_rxhprio properly instead of sc_txhprio twice; CID 1480289dlg2019-05-211-2/+2
| | | | the cid thing was via jmatthew@
* don't fall through SIOCSVNETID into SIOCGVNETID; CID 1480290dlg2019-05-211-1/+2
| | | | the cid was via jmatthew@
* BPF: remove redundant reference counting of filedescriptorssashan2019-05-182-46/+10
| | | | OK visa@, OK mpi@
* Do not check for IFF_RUNNING inside bstp_initialization().mpi2019-05-131-3/+2
| | | | | | | This allows to set such flag after completing the initialization of a bridge and still have bstp_tick() be scheduled from the begining. Fix a regression reported by and ok markus@
* Deal with the case where bridge_getbif() can return NULL.mpi2019-05-131-3/+4
| | | | | | | | Since `bif' are removed from the interface list before calling smr_barrier() and the hash queue is cleaned up afterward, it is possible to find an ifidx with bridge_rtlookup() that won't match to any `bif'. Fix a panic reported by Hrvoje Popovski, ok visa@
* Switch the list of span interfaces and interfaces to SMR.mpi2019-05-123-86/+123
| | | | | | | | | | | | This removes the KERNEL_LOCK() around the list iteration in bridge_enqueue(). Since the NET_LOCK() isn't protecting any data structure, release it early in all the code paths coming from the Network Stack to prevent possible deadlock situations with smr_barrier(). bridge_input() is still KERNEL_LOCK()ed as well as bridge_filterrule(). ok visa@
* pushing NET_LOCK() further down from if_clone_{create,destroy}()sashan2019-05-124-33/+23
| | | | OK mpi@
* Unused switch_port variable.akoshibe2019-05-121-4/+1
|
* Correct a check in if_isconnected().mpi2019-05-111-2/+2
| | | | | | Fix a regression introduced by the bridge(4) refactoring. Found by and ok bluhm@
* A trunk(4) usually stays up when the link state of one of its membersflorian2019-05-111-1/+3
| | | | | | | | | changes. While we do get RTM_IFINFO messages for the (physical) member interfaces there is no indication that something changed from the trunk(4) interface. It is helpful to get this information in userland from the trunk so that userland daemons do not need to track interface membership by themselves. OK phessler
* Make rt_mpls_set() be more strict in what it accepts. Also ensure thatclaudio2019-05-112-10/+16
| | | | | | | | | | the RTF_MPLS can't be toggled without rt_mpls_set() being called. While RTF_MPLS is part of RTF_FMASK it should be excluded from the flags and mask when they are applied to the route since toggling it requires a call to rt_mpls_set(). OK bluhm@ Reported-by: syzbot+86344a9e31c27aa6f15b@syzkaller.appspotmail.com
* Add port protection support to switch(4). The behavior copies that ofakoshibe2019-05-103-7/+34
| | | | | | | | | | | | | bridge(4), where the SIOCBRDGSIFPROT ioctl can be used to add a port to up to 31 protected domains. This allows configuration by specifying a list of IDs to the 'protected' option in ifconfig(8): # ifconfig switch0 protected pair1 1,2,.. Domain membership is checked for unicast, flooded (broadcast), and local (host-network-bound, e.g. trunk) traffic. OK benno@
* Move bridge_filterrule() before doing the mbuf copy. Fixes a memory leakclaudio2019-05-101-6/+7
| | | | | | when multiple interfaces do MAC filtering. Memory leak reported by Daniel Levai With and OK mpi@
* Add a sysctl accessor to struct pf_status. The pf_status only holds theclaudio2019-05-091-1/+17
| | | | | | current status and statistics and can be exported without super-user rights via sysctl to make it easier for tools like systat to access those. OK deraadt@, sashan@
* we don't need to check rtisvalid() in these places, the functions we arephessler2019-05-091-10/+2
| | | | | | protecing will do the right thing OK claudio@
* Add missing bridge_getbif(), reported by jsg@.mpi2019-05-031-1/+2
|
* An if_put() was missing in one branch of bridge_process(). Thisbluhm2019-05-031-1/+2
| | | | | | caused a hanging "ifconfig bridge0 destroy" and a subsequent uvm fault. reported and tested by Hrvoje Popovski; OK visa@
* Reset root port after last STP interface is removed.mpi2019-05-021-5/+13
| | | | Prevent use-after-free reported by Hrvoje Popovski.
* pretty much all of tun_wakeup needs to be protected with KERNEL_LOCKdlg2019-05-011-1/+3
| | | | | | | | | | | | tun_wakeup is called from the network stack, which generally runs with NET_LOCK, not KERNEL_LOCK, which is a problem when it calls into things like csignal or kq code. this started causing corruption and panics of a list inside the kq code, which got reported to bugs@. this version of the fix is ok mpi@ (even though he hasn't seen it) an earlier but far trickier fix was ok visa@ the bug was reported by Olivier Antoine, and again by jmc@ privately.
* tr_unit is unused, so gc itdlg2019-04-292-4/+2
|
* don't have lacp input push lacp packets into the trunkports bpf again.dlg2019-04-291-11/+1
| | | | | | if_input already runs bpf for all packets on a trunkport. having lacp code do it again means packets are seen twice by bpf filters twice, which is misleading.
* Removes the KERNEL_LOCK() from bridge(4)'s output fast-path.mpi2019-04-288-163/+198
| | | | | | | | This redefines the ifp <-> bridge relationship. No lock can be currently used across the multiples contexts where the bridge has tentacles to protect a pointer, use an interface index. Tested by various, ok dlg@, visa@
* Fix reading route entries via kvm(3).mpi2019-04-282-24/+3
| | | | From Naoki Fukaumi, ok yasuoka@, sthen@
* fix up some rxprio handling while heredlg2019-04-271-5/+7
| | | | | | we should swap the value off the wire for 802.1P, not the rxhprio config value. try and avoid toctou issues by copying the sc_rxprio value to a local.
* don't increment noproto on the parent interface when there's no childdlg2019-04-271-13/+5
| | | | | it's not atomic is the main reason. this simplifies leaving the function too.
* use unsigned int, not u_int, and uintXX_t, not u_intXX_tdlg2019-04-271-10/+11
|
* rename sc_prio to sc_txpriodlg2019-04-271-6/+6
|
* remove sc_proto, it isn't used.dlg2019-04-271-2/+1
|
* rename softc members so theyre prefixed with sc.dlg2019-04-271-124/+124
| | | | | makes vlan more consistent with the rest of the tree, but no functional change.
* back out, this isn't part of a vlan change.dlg2019-04-272-2149/+0
|
* this wasnt meant to be committed, back out for now.dlg2019-04-271-12/+16
|
* get rid of ifv_linkmib and a bunch of useless macrosdlg2019-04-274-27/+2167
|
* fix some whitespace.dlg2019-04-271-17/+18
|
* call vlan_softc variables sc, not ifv. no functional change.dlg2019-04-271-169/+169
|
* whitespace tweaks. no functional change.dlg2019-04-271-29/+29
|
* rename struct ifvlan to struct vlan_softcdlg2019-04-271-53/+54
| | | | | this makes it more consistent with the rest of the tree, but has no functional change.
* move the struct ifvlan (the vlan softc) definition into if_vlan.c.dlg2019-04-272-40/+38
| | | | | | | | nothing needs to see inside it, so it can move. the next steps are to rename it to vlan_softc and all the variables to sc to make the driver move consistent with the rest of the tree. ok visa@ mpi@