summaryrefslogtreecommitdiff
path: root/sys/net
AgeCommit message (Collapse)Author
2018-07-08"id" is too generic, rename to "rdomain" for clarity and easier greppingJeremie Courreges-Anglas
ok benno@ mpi@
2018-07-08Use the same test pattern as for enc_ifps, for consistencyJeremie Courreges-Anglas
ok denis@
2018-07-05fix comment: s/always send/always sent/Stuart Henderson
2018-07-05RTM_BFD route messages are also a special case. suggested by claudio@,Sebastian Benoit
ok phessler@
2018-07-05not all route messages have a priority. Move the priority filter checkSebastian Benoit
where it belongs. Problem spotted by by remi@ ok sthen@ claudio@ krw@
2018-07-01Retire support for unused RTM_LOCK messages, it's redundant w/ RTM_CHANGE.Martin Pieuchot
ok tb@, sthen@
2018-06-25Fix a kernelpanic when using rdomain(4) and enc(4)denis
OK jca@ mpi@
2018-06-25Push the NET_LOCK() down in pfkeyv2_send().Martin Pieuchot
While here document which field of the PCB is protected by which lock. ok visa@
2018-06-25Factorize MPLS setup/teardown into two functions.Martin Pieuchot
ok claudio@
2018-06-25Push the NET_LOCK() down in rtm_output().Martin Pieuchot
ok tb@, visa@
2018-06-21Grab the KERNEL_LOCK() rather than asserting that it is held.Martin Pieuchot
Prevent a panic now that some syscall are running unlocked. Found the hardway by Gregor Best.
2018-06-20Use the socket lock rather than the KERNEL_LOCK() in pfkey_sendup().Martin Pieuchot
inputs & ok visa@
2018-06-18Do not allow to change the rdomain of the default loopback interface.Martin Pieuchot
Routing domain must always have an existing lo(4). Problem reported and fix tested by multiplexd at gmx.com.
2018-06-18Refactor the six ways to find TCP options into one new function. As a result:Richard Procter
- MSS and WSCALE option candidates must now meet their min type length. - 'max-mss' is now more tolerant of malformed option lists. These changes were immaterial to the live traffic I've examined. OK sashan@ mpi@
2018-06-15Fix the lock order problem found by witness. Release the lock forYASUOKA Masahiko
pppx_ifs earlier not to overlap the protected section for ifnet. Also introduce pxi_ready flag to protect pxi not to be used before initialization. ok bluhm
2018-06-11Rename routing & pfkey tables for coherency with other PCB tables.Martin Pieuchot
ok claudio@
2018-06-11Push the KERNEL_LOCK() inside route_input().Martin Pieuchot
ok visa@, tb@
2018-06-06Prefix fields of pfkey & routing PCBs, part 2, no functionnal change.Martin Pieuchot
ok tb@
2018-06-06Prefix fields of pfkey & routing PCBs, no functionnal change.Martin Pieuchot
ok visa@, tb@
2018-06-06Pass the socket to sounlock(), this prepare the terrain for per-socketMartin Pieuchot
locking. ok visa@, bluhm@
2018-06-06Asseert that a pfkey or routing socket is referenced by a `fp' insteadMartin Pieuchot
of calling sofree(), when its PCB is detached. This is different from TCP which does not always detach `inpcb's from sockets. In the pfkey & routing case caling sofree() there is a noop whereas for TCP it's needed to free closed connections. Having fewer sofree() makes it easier to understand the code and move the locks down. ok visa@
2018-06-04The function pf_create_state() calls pf_set_protostate() beforeAlexander Bluhm
pf_state_insert(), so the state key has not been set. When inlining, the compiler recognized the NULL pointer dereference in s->key[PF_SK_STACK]->proto and optimized it away. But if pf.c was compiled with -fno-inline, the system crashed during boot. Add a NULL check in pf_set_protostate() to handle the situation when the function is called. OK sashan@ henning@
2018-06-01While sending the pf syncookie, we are holding the pf lock. SoAlexander Bluhm
goto unlock when leaving this block. OK sashan@ henning@
2018-05-30restrict the prio values from SIOCSIFLLPRIO to what the kernel handlesDavid Gwynne
previously the ioctl code checked that prio was an int less than UCHAR_MAX, but the rest of the kernel (and priq code in particular) expects it to be between 0 and 7 inclusive. ok krw@ tb@
2018-05-30Add SIOCGIFGLIST to fetch a list of interface groups on the system.Stuart Henderson
From Jan Klemkow, ok mpi@ tb@, ok/bugfix bluhm@
2018-05-28implement support for MikroTik's Ethernet over IP protocol as eoip(4)David Gwynne
it is sort of like egre(4), but different enough to warrant separate handling. more specifically, eoip sits under gre 1, not 0, and has it's own protocol id (0x6400). the gre key field is mandantory (the rest cannot be set) which is split into a 16 bit length field and a 16 bit tunnel id. lastly, it has a keepalive mechanism where peers send 0 length packets as hellos to each other periodically, which has no equivalent in egre(4) and is different to the gre(4) keepalives. ok sthen@
2018-05-19As long we have no per socket locking, we must grab either net lockAlexander Bluhm
or kernel lock when accessing a socket. For pf key sockets it is kernel lock, so add its protection in pfkey_sendup(). Fixes a kernel lock assertion panic reported by Peter J. Philipp. OK mpi@ visa@
2018-05-17Move the handling of SIOCIFGCLONERS out of the NET_RLOCK(). The globalTheo Buehler
&if_clone list and the if_cloners_count are currently protected by the KERNEL_LOCK(). Introduce the ifclonerslk rwlock to serialize access to these two globals as a small step towards removing the KERNEL_LOCK() from the ioctl path. While there, separate the two codepaths in if_clone_list() more clearly and replace a ternary operator with MIN(). guidance & ok mpi, ok visa
2018-05-16Fix kernel builds without IPSEC.Reyk Floeter
OK mikeb@
2018-05-15Take NET_LOCK for pppioctl when called via the tty ioctl handlerMike Belopuhov
ok mpi
2018-05-15Grab the KERNEL_LOCK() in pppasyncstart/pppasyncrelinq/pppasyncctlp.Martin Pieuchot
The tty layer still relies on it to serialize access to its data. Fixes crashes reported & tested by form@ via mikeb@. ok mikeb@
2018-05-14Use a SRP list to protect pfkeyv2 sockets, thus removing the need toMartin Pieuchot
grab the KERNEL_LOCK() when delivering messages. This is the same solution already used by routing sockets. ok claudio@, visa@
2018-05-12Make LACP_STATE_BITS accessible to userlandccardenas
Update ifconfig to display LACP State (Actor and Partner) on each trunk port Ok benno@, phessler@, and tb@
2018-05-10pf route-to should not send packets from 127.0.0.1 or ::1 addressAlexander Bluhm
to the network. This is necessary for locally generated icmp packets that would be dropped otherwise. Refine this check to modify only the source address of packets that go to the external network. This allows route-to tricks on loopback interface. OK sashan@
2018-05-08Introduce rtm_sendup() a function to deliver routing messages to aMartin Pieuchot
socket receive buffer. It is modelled after pfkey_sendup() as both will need the same MP treatment. ok tb@, bluhm@, visa@
2018-04-28replace add_*_randomness with enqueue_randomness()Jasper Lievisse Adriaanse
this gets rid of the source annotation which doesn't really add anything other than adding complexitiy. randomess is generally good enough that the few extra bits that the source type would add are not worth it. ok mikeb@ deraadt@
2018-04-28bump my copyrightPeter Hessler
2018-04-28don't check if we still have the BFD flag set when sending a packet, as wePeter Hessler
might be shutting the session down
2018-04-28properly delete the bfd configuration when it is disabledPeter Hessler
2018-04-28use unsigned variables for things that we use as unsignedPeter Hessler
noticed by clang
2018-04-28add the socket lock around our use of socketsPeter Hessler
2018-04-25Make this header standalone #if __BSD_VISIBLE, by including needed headersJeremie Courreges-Anglas
Puts us in line with Free/NetBSD and Linux and will get us rid of pointless patches in the ports tree. ok guenther@ deraadt@
2018-04-24Use pf_rm_rule() instead of pool_put() to decrement references byAlexander Bluhm
the rule created in pf_rule_copyin(). Plugs a potential kif memory leak in pf(4) ioctl. OK sashan@
2018-04-24Fix copy and paste typo in pfi_kif_unref route error message.Alexander Bluhm
2018-04-24Push NET_LOCK down in the default ifioctl case.Paul Irofti
For the PRU_CONTROL bit the NET_LOCK surrounds in[6]_control() and on the ENOTSUPP case we guard the driver if_ioctl functions. OK mpi@
2018-04-24Remove unused rtentry parameter.Florian Obser
Input bluhm OK benno, kn, claudio
2018-04-19when adding span ports, restrict them to ether and mplstunnel interfaces.David Gwynne
this is the same check that's done when adding normal members to the bridge. it prevents things like gif(4) being added to the bridge, which in turn prevents panics when shoving ethernet packets down a layer 3 interface. reported and tested by jasper@
2018-04-18If m_pullup() changes the mbuf in gif_input(), also adjust the mbufAlexander Bluhm
pointer in the IP protocol loop. Reset the loop's mbuf when the mbuf is freed. The latter is not necessary, but clearing a pointer to freed data is safer. OK dlg@
2018-04-13Remove compatibility with pfctl from 6.1 and plug a few leaksMike Belopuhov
No objections from henning, OK visa
2018-04-08use the specified protocol on v6 outputDavid Gwynne
found by and diff from peter j philip ok jca@