summaryrefslogtreecommitdiff
path: root/sys/netinet
AgeCommit message (Collapse)Author
2015-07-20Kill NETISR_MPLS, from now on we will use interface input handlers to dealRafael Zalamena
with MPLS packets. ok mpi@, claudio@
2015-07-19tame(2) is a subsystem which restricts programs into a "reduced featureTheo de Raadt
operating model". This is the kernel component; various changes should proceed in-tree for a while before userland programs start using it. ok miod, discussions and help from many
2015-07-18Abstract the routing table internals behind an rtable_* API.Martin Pieuchot
Code abusing the radix internals for the routing table should now includes <net/rtable.h> and only deal with "struct rtentry". Code using a radix tree for another purpose can still include <net/radix.h>. Inputs from and ok claudio@, mikeb@
2015-07-17ansiTed Unangst
2015-07-17Announce an IP address after inserting its corresponding RTF_LOCALMartin Pieuchot
route and not during the SIOCSIFADDR ioctl. This way addresses are not announced when an error occurs. ok chris@, claudio@
2015-07-17manage spd entries by using the radix api directly instead ofBret Lambert
reaching around through the routing table original diff by myself, much improved by mikeb@ and mpi@ ok and testing mikeb@ mpi@
2015-07-16Kill IP_ROUTETOETHER.Martin Pieuchot
This pseudo-option is a hack to support return-rst on bridge(4). It passes Ethernet information via a "struct route" through ip_output(). "struct route" is slowly dying... ok claudio@, benno@
2015-07-16Expand ancient NTOHL/NTOHS/HTONS/HTONL macros.Martin Pieuchot
ok guenther@, henning@
2015-07-15use mp for the name of a variable of type struct mbuf **, rather than mTheo de Raadt
2015-07-15m_freem() can handle NULL, do not check for this condition beforehands.Theo de Raadt
ok stsp mpi
2015-07-15rename mbuf ** parameter from m to mp, to match other similar codeTheo de Raadt
2015-07-15rename mbuf ** parameter from m to mp, to match other similar codeTheo de Raadt
ok mpi
2015-07-13Avoid a situation where we do not set the tcp persist timer afterAlexander Bluhm
a zero window condition. If you send a 0-length packet, but there is data is the socket buffer, and neither the rexmt or persist timer is already set, then activate the persist timer. From FreeBSD revision 284941; OK deraadt@ markus@ mikeb@ claudio@
2015-07-10Make KASSERT in tcp_input() less strict, tcpcb may be NULL.Alexander Bluhm
OK deraadt@
2015-07-09Remove unused arguments and the associated code from nd6_nud_hint().Martin Pieuchot
ok claudio@
2015-07-08Pass an interface index instead of a pointer to in6_addr2scopeid().Martin Pieuchot
ok millert@
2015-07-08Use a new RTF_CONNECTED flag for interface (connected) routes.Martin Pieuchot
Recent changes to support multiple interface routes broke the assumption made by all our userland routing daemons concerning interface routes. Historically such routes had a "gateway" sockaddr of type AF_LINK. But to be able to support multiple interface routes as any other multipath routes, they now have a unique "gateway" sockaddr containing their corresponding IP address. This self-describing flag should avoid ambiguity when dealing with interface routes. Issue reported by <mxb AT alumni DOT chalmers DOT se> and benno@ ok claudio@, benno@
2015-07-07Always use "ifp" instead of mixing it with "ac->ac_if" in in_arpinput().Martin Pieuchot
2015-07-06We're now creating a connected route for every configured address soMartin Pieuchot
there's no need to flag every address as IFA_ROUTE.
2015-07-06No longer need to manually pass RTF_MPATH to rt_ifa_add(9).Martin Pieuchot
2015-07-02By design if_input_process() needs to hold a reference on the receivingMartin Pieuchot
ifp in order to access its ifih handlers. So get rid of if_get() in the various ifih handlers we know the ifp is live at this point. ok dlg@
2015-06-30Get rid of the undocumented & temporary* m_copy() macro added forMartin Pieuchot
compatibility with 4.3BSD in September 1989. *Pick your own definition for "temporary". ok bluhm@, claudio@, dlg@
2015-06-30Rename if_output() into if_enqueue() to avoid confusion with commentsMartin Pieuchot
talking about (*ifp->if_output)(). ok claudio@, dlg@
2015-06-29count if_ibytes in if_input like we do for if_ipackets.David Gwynne
tweaks and ok mpi@
2015-06-24Increment if_ipackets in if_input().Martin Pieuchot
Note that pseudo-drivers not using if_input() are not affected by this conversion. ok mikeb@, kettenis@, claudio@, dlg@
2015-06-23Pass a "struct ifnet *" instead of a "struct arpcom *" to arpresolve().Martin Pieuchot
Most of the ARP layer already take an ifp pointer and this makes clear wich chunks of code are messing with ac_enaddr. Note that our Ethernet code assume that these pointer are interchangeable since the first element of the "struct arpcom" is a "struct ifnet".
2015-06-23Adapt bridge(4) to the new if_input() framework.Martin Pieuchot
Move bridge_input() outside of ether_input() in order to duplicate packets flowing through a bridge port before applying any transformation on mbufs. This saves a various m_adj(9)/M_PREPEND(9) dances and remove the bridge(4) hack from vlan(4). Tested by mxb <mxb AT alumni DOT chalmers DOT se> and kettenis@ ok bluhm@
2015-06-16Store a unique ID, an interface index, rather than a pointer to theMartin Pieuchot
receiving interface in the packet header of every mbuf. The interface pointer should now be retrieved when necessary with if_get(). If a NULL pointer is returned by if_get(), the interface has probably been destroy/removed and the mbuf should be freed. Such mechanism will simplify garbage collection of mbufs and limit problems with dangling ifp pointers. Tested by jmatthew@ and krw@, discussed with many. ok mikeb@, bluhm@, dlg@
2015-06-15Use proper argument type for crp_callback functions; no functional change.Mike Belopuhov
2015-06-15No need for an extra local variable; no functional change.Mike Belopuhov
2015-06-15Use proper argument type for crp_callback functions; no functional change.Mike Belopuhov
2015-06-11Move away from using hzto(9); OK dlgMike Belopuhov
2015-06-08Move carp-related logic from ether_output() into carp_start().Martin Pieuchot
ok sthen@, phessler@
2015-06-07Introduce unhandled_af() for cases where code conditionally doesJonathan Gray
something based on an address family and later assumes one of the paths was taken. This was initially just calls to panic until guenther suggested a function to reduce the amount of strings needed. This reduces the amount of noise with static analysers and acts as a sanity check. ok guenther@ bluhm@
2015-06-07Replace a bunch of == 0 with == NULL in pointer tests. Nuke someKenneth R Westerback
annoying trailing, leading and embedded whitespace. No change to .o files. ok deraadt@
2015-06-05Try harder to avoid (very unlikely) NULL pointer de-ref by tweakingKenneth R Westerback
code to use sotopf() like tcp_usrreq() does. Also following tcp_usrreq(), put more stuff under splsoftnet. And as a result in-line code in udp_detach() and nuke udp_detach(). Most ideas from and ok mikeb@
2015-06-02Take carp(4) out of ether_input().Martin Pieuchot
Tested by <mxb AT alumni DOT chalmers DOT se>, thanks! ok bluhm@, dlg@
2015-05-26Store the IP address of the corresponding ifa in the rt_gateway fieldMartin Pieuchot
of RTF_CLONING and RTF_BROASCAST routes to not create MPATH conflicts when IP address aliases are used. This change makes it possible to have multiple RTF_CLONING routes with the same priority. Note that any of the existing RTF_CLONING route might be used by the kernel to create a RTF_CLONED route which should not be a problem with aliases since they are attached to the same ifp. This unbreak address aliases since the kernel supports multiple connected routes for a subnet. Found the hardway by djm@, ok claudio@
2015-05-26Do not create ARP entries for RTF_BROADCAST routes.Martin Pieuchot
This has been done because historically routes to broadcast addresses were cloned like any ARP entry. But for obvious reasons, no matching Ethernet address could ever be resolved. That's why we played tricks with the expire timer. Now that a RTF_BROADCAST route is created per configured IPv4 address, we need to differenciate duplicated one. And by not creating an ARP entry we are allowed to write the IP address in the rt_gateway field, which prevents MPATH conflicts. This change is part of a fix to unbreak aliases since the kernel support multiple connected routes for a subnet. Found the hardway by djm@, ok claudio@
2015-05-23remove PACKET_TAG_IPSEC_PENDING_TDB, it is never set; ok mikeb@Markus Friedl
2015-05-23introduce ipsec-id bundles and use them for ipsecflowinfo,Markus Friedl
fixes rekeying for l2tp/ipsec against multiple windows clients and saves memory (for many SAs to same peers); feedback and ok mikeb@
2015-05-21Correctly state the link state to INVALID when creating a carp interface.Martin Pieuchot
Since vhe are allocated with M_ZERO and INIT is also defined to be 0, carp_set_state() would result in a no-op because of the state check. So explicitly initialize the state of a vhe to INIT and move the state check in carp_set_state_all() to prevent similar issues in the future. Problem and initial diff from Johan Ymerson, thanks! ok henning@
2015-05-19Do not leak a rtentry if it is unusable.Martin Pieuchot
Found by The Brainy Code Scanner from Maxime Villard.
2015-05-15Allow multiple connected/interface routes to exist at the same time.Claudio Jeker
Use the existing multipath code. Switch away from using the ifa address when making the cloning route and instead put a dummy sockaddr_dl route in. With this it is possible to use the same network on multiple interfaces at the same time. So if wireless and ethernet share the same network the system will use the wired connection as long as there is link. Still missing is builtin proxy-arp for the other interface IPs to allow hitless failover. OK mpi@
2015-05-15Give carp(4) interfaces their own low priority. The change should notClaudio Jeker
change behaviour for now but will allow to share the same address with the parent interface without major hacks. OK mpi@
2015-05-15Remove a NULL check in carp_set_ifp() as we always pass a valid ifpMartin Pieuchot
pointer to this function. ok claudio@
2015-05-13test mbuf pointers against NULL not 0Jonathan Gray
ok krw@ miod@
2015-05-12MPLS also needs a definition for etherip_output(), fix build withoutMartin Pieuchot
bridge.
2015-05-07Include the timestamp TCP option in keep alive packets as well.Mike Belopuhov
According to RFC 7323 "once TSopt has been successfully negotiated, ... [it] MUST be sent in every non-<RST> segment for the duration of the connection." Which means that keep alives which are just ACK packets must include that too. Pointed out and tested by Lauri Tirkkonen <lotheac at iki ! fi>, thanks! ok mpi
2015-04-30Merge two identical if() statements in ipsp_acquire_sa(). TheTodd C. Miller
change in ip_spd.c 1.59 makes it appear that there is a cut & pasto. OK mikeb@