summaryrefslogtreecommitdiffstats
path: root/sys/net/if_gif.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* move gif from calling l3 protocol input handlers to using if_vinput.dlg2021-02-201-25/+5
| | | | | | if_vinput requires mpsafe interface counters, so gif is a bit more mpsafe now than it was before. using if_vinput means monitor mode works on gif 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@
* make ph_flowid in mbufs 16bits by storing whether it's set in csum_flags.dlg2020-06-171-3/+3
| | | | | 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.
* gif shouldn't include netinet/ip_ether.h, cos gif doesnt do etherip.dlg2019-10-041-2/+1
| | | | | | ip_ether.h is where netinet/ip_ipip.h got the forward declaration for struct tdb from though, so fix that before cutting ip_ether.h out of gif.
* use the factored out txhprio and rxhprio checksdlg2019-04-191-16/+5
| | | | reduces code duplication and chance for error.
* allow configuration of rxpriodlg2019-04-191-4/+49
| | | | ok claudio@
* allow configuration of ecn processingdlg2018-11-291-4/+13
| | | | | | this is a step toward better rfc6040 support ok claudio@
* provide ip_tos_patch() for setting ip_tos and patching the ipv4 cksum.dlg2018-11-141-2/+3
| | | | | | | | | | | | | | | | previously the gif code would patch the tos field and not recalc the cksum, which would cause ip input code to drop the packet due to a cksum failure. the ipip code patched ip_tos and unconditionally recalculated the cksum, making it correct, but also wiping out any errors that may have been present before the recalculation. updating the cksum rather than replacing it lets cksum failures still fire. ip_tos_patch() is provided in the ecn code since it's because of ecn propagation that we need to update the tos field. internally it works like pf_patch_8 and pf_cksum_fixup, but since pf is optional it rolls its own code. procter may fix that in the future... ok claudio@
* remove the encapsulation headers before looking at the inner headersdlg2018-11-141-5/+5
| | | | it works less well when you look before the adj
* revert 1.121. i got confused between ecn on ingress and egressdlg2018-11-141-5/+5
|
* get ecn ingress args the right way round. again.dlg2018-11-141-5/+5
|
* according to ip_ipip.c, rfc1853 says not to copy the ttl on decapsulationdlg2018-11-141-18/+5
| | | | | rfc1853 is about IP in IP Tunneling. rfc2003 about IP Encapsulation within IP agrees.
* get the inner and outer tos values right for passing to ip_ecn_ingressdlg2018-11-131-3/+3
|
* add txprio setting supportdlg2018-11-131-1/+31
| | | | | | | gif encaps l3, so it can get a prio from the payload, as well as from the mbuf itself, or a hardcoded value. ok claudio@
* copy the mpls cos and use it as the ip dscp/tos/tclass thing.dlg2018-11-111-6/+13
|
* If m_pullup() changes the mbuf in gif_input(), also adjust the mbufbluhm2018-04-181-5/+6
| | | | | | | 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@
* use the specified protocol on v6 outputdlg2018-04-081-2/+2
| | | | | found by and diff from peter j philip ok jca@
* on output, actually attach the mbuf tag to packet.dlg2018-04-081-1/+3
| | | | | | | | | this is to suppress loops over the interface, and avoids a leak of the tag on every packet. found and fix testd by christian barthel also tested by job snijders ok bluhm@
* Remove the check for flags M_AUTH and M_CONF (AH and ESP).remi2018-03-151-5/+1
| | | | | | | | The check prevents incomming multicast packages from arriving at the gif interface (eg. OSPF) when the traffic is protected by IPsec in transport mode. ok dlg@
* fix up matching of incoming traffic to interfaces.dlg2018-02-281-3/+3
| | | | | | | | i was assigning to ip dst to both the key src and dst, which meant no traffic matched and it fell through the network stacks ipip processing. based on some excellent investigation by andreas bartelt.
* enable configuration of tunnel fragmentation.dlg2018-02-191-2/+15
|
* restore the previous semantics wrt if up, tunnel, and address config.dlg2018-02-121-34/+38
| | | | | this is a port of the change made to if_etherip.c r1.35 to allow addresses to be configured before the tunnel is configured.
* rework gif to be more consistent.dlg2018-02-101-445/+596
| | | | | | | | | while here, give us support for mpls in gif on ipv6. this moves all the gif handling into if_gif, eg, the mpls handling is no longer in ip_etherip.c. ok claudio@
* move gif_encap from gif_output to gif_start.dlg2018-01-121-50/+7
| | | | | | the main win is the simplification of bpf in the ouput path. ok visa@
* 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@
* Use ip{,6}_send() instead of ip{,6}_output() to prevent a recursion.mpi2018-01-091-9/+3
| | | | | | | | if_start() is a boundary between the network stack and drivers. The states it modifies must be protected by the driver, so we should not require the NET_LOCK() there. ok bluhm@, visa@
* Sprinkle some NET_ASSERT_LOCKED(), const and co to prepare runningmpi2017-11-201-2/+5
| | | | | | pr_input handlers without KERNEL_LOCK(). ok visa@
* #if -> #ifdef for consistencyjca2017-11-171-3/+3
| | | | ok visa@ as part of a larger diff
* Rename functions that now handle only MPLS-in-IPjca2017-11-171-3/+3
| | | | ok visa@ mpi@
* Remove useless comment about if_ioctl() & reduce grep noise.mpi2017-11-131-2/+1
|
* Remove Multicast and Broadcast flags from the encapsulated packet inmpi2017-10-251-1/+2
| | | | | | | | vxlan(4) like it is done by other tunnelling pseudo-interfaces. While here sync the comment between multiple interfaces. Bug report and original diff from Pierre LALET.
* Remove kernel support for the following ioctl(2)s, deprecated since 2001:mpi2017-10-161-105/+3
| | | | | | | | | | | - SIOCSIFPHYADDR - SIOCSIFPHYADDR_IN6 - SIOCGIFPSRCADDR - SIOCGIFPSRCADDR_IN6 - SIOCGIFPDSTADDR - SIOCGIFPDSTADDR_IN6 ok bluhm@
* Remove NET_LOCK()'s argument.mpi2017-08-111-7/+5
| | | | Tested by Hrvoje Popovski, ok bluhm@
* Do not use the interface pointer after if_put(). Rename ipip_input_gif()bluhm2017-06-201-3/+3
| | | | | | to ipip_input_if() and always pass the ifp. Only dump the packet to bpf if we are called with a gif(4) interface. OK mpi@
* When dealing with mbuf pointers passed down as function parameters,bluhm2017-06-191-2/+2
| | | | | | | bugs could easily result in use-after-free or double free. Introduce m_freemp() which automatically resets the pointer before freeing it. So we have less dangling pointers in the kernel. OK krw@ mpi@ claudio@
* The function name ip4_input() is confusing as it also handles IPv6bluhm2017-05-181-5/+6
| | | | | | | | | | packets. This is the IP in IP protocol input function, so call it ipip_input(). Rename the existing ipip_input() to ipip_input_gif() as it is the input function used by the gif interface. Pass the address family to make it consistent with pr_input. Use __func__ in debug print and panic messages. Move all ipip prototypes to the ip_ipip.h header file. OK dhill@ mpi@
* Protect the global list of interfaces with the NET_LOCK().mpi2017-05-171-8/+5
| | | | ok bluhm@
* Introduce sstosa() for converting sockaddr_storage with a type safebluhm2017-05-041-9/+5
| | | | | | | 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@
* Remove unused define satoin6().bluhm2017-04-141-2/+1
|
* Pass down the address family through the pr_input calls. Thisbluhm2017-04-141-5/+5
| | | | | allows to simplify code used for both IPv4 and IPv6. OK mikeb@ deraadt@
* Change the IPv4 pr_input function to the way IPv6 is implemented,bluhm2017-01-291-11/+9
| | | | | | | to get rid of struct ip6protosw and some wrapper functions. It is more consistent to have less different structures. The divert_input functions cannot be called anyway, so remove them. OK visa@ mpi@
* Since raw_input() and route_input() are gone from pr_input, we canbluhm2017-01-251-9/+3
| | | | | | make the variable parameters of the protocol input functions fixed. Also add the proto to make it similar to IPv6. OK mpi@ guenther@ millert@
* 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@
* move counting if_opackets next to counting if_obytes in if_enqueue.dlg2017-01-221-2/+1
| | | | | | | this means packets are consistently counted in one place, unlike the many and various ways that drivers thought they should do it. ok mpi@ deraadt@
* make v6 tunnel address handling consider ipv6 scope.dlg2016-12-131-3/+14
| | | | an earlier version of this diff was ok mpi@
* Retire bridge(4) support.mpi2016-09-131-21/+2
| | | | ok claudio@, deraadt@
* 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-6/+2
| | | | From David Hill, ok dlg@
* remove old lint annotationstedu2015-12-051-2/+1
|