summaryrefslogtreecommitdiffstats
path: root/sys/netinet/in_var.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* igmp, struct router_info: use queue(3)cheloha2018-10-181-2/+2
| | | | | | | | | | In particular, use LIST_* to preserve O(n) removal in rti_delete(). While here, clean up two malloc(9) calls. Suggested by mpi@. ok visa@
* Per-interface list of addresses, both multicast and unicast, arempi2017-05-291-1/+3
| | | | | | | | | | | | | currently protected by the NET_LOCK(). They are not accessed in the hot path, so protecting them with a mutex could be an option. However since we're now going to run with a NET_LOCK() for some time, assert that it is held. IPsec is not yet ready to run without KERNEL_LOCK(), so assert it is held, even in the forwarding path. Tested by sthen@, ok visa@, claudio@, bluhm@
* Add umb(4) - a driver for the Mobile Broadband Interface Model (MBIM)gerhard2016-06-151-1/+2
| | | | | | | | | The umb(4) driver provides support for USB MBIM devices. Those devices establish connections via celluar networks such as GPRS, UMTS, and LTE. ok mpi@ sthen@ additional feedback from deraadt@ jmc@ stsp@ kettenis@
* Introduce in{,6}_hasmulti(), two functions to check in the hot path ifmpi2016-01-211-1/+2
| | | | | | an interface joined a specific multicast group. ok phessler@, visa@, dlg@
* Get rid of rt_mask() and stop allocating a "struct sockaddr" for everympi2015-12-031-1/+2
| | | | | | | | | | | | | route entry in ART. rt_plen() now represents the prefix length of a route entry and should be used instead. For now use a "struct sockaddr_in6" to represent the mask when needed, this should be then replaced by the prefix length and RTA_NETMASK only used for compatibility with userland. ok claudio@
* Store an interface index instead of a pointer that's never dereferenced.mpi2015-11-111-4/+4
| | | | | | Get rid of an if_ref()/if_put() dance. ok dlg@
* Kill the global list of IPv4 addresses.mpi2015-01-121-4/+1
| | | | ok claudio@, mikeb@, bluhm@
* Stop mixing interface address flags with routing entry ones.mpi2014-03-271-2/+2
| | | | | | | | | | Instead of always copying ifa_flags to the routing entry flags when creating a route by calling rtinit(), explicitly pass the RTF_CLONING flag when required. This means ifa_flags are now *only* used to check if an address has an associated route that was created by the kernel auto-magically. ok benno@
* Do not clean the multicast records of an interface when it is destroyedmpi2014-01-211-2/+2
| | | | | | | | | | | (unplugged). Even if it makes no sense to keep them around if the interface is no more, we cannot safely remove them since pcb multicast options might keep a pointer to them. Fixes a user after free introduced by the multicast address linking rewrite and reported by Alexey Suslikov, thanks! ok claudio@
* Iterate over the per interface address list instead of the global onempi2014-01-131-3/+6
| | | | | | in IFP_TO_IA(). ok bluhm@, henning@, mikeb@
* move in_multi definition into kernel-onlyderaadt2013-11-291-4/+2
|
* Change the way protocol multicast addresses are linked to an interface.mpi2013-11-281-26/+25
| | | | | | | | | | | | | | | | | | | | | | Instead of linking multicast records to the first configured address of the corresponding protocol, making this address and its position in the global list special, add them to a new list directly linked to the interface descriptor. This new multicast address list is similar to the address list, all its elements contain a protocol agnostic part. This design allows us to be able to join a multicast group without necessarily having a configured address. That means IPv6 multicast kludges are no longer needed. Another benefit is to be able to add and remove an IP address from an interface without worrying about multicast records. That means that the global IPv4 list is no longer needed since the first configured address of an interface is no longer special. This new list might also be extended in the future to contain the link-layer addresses used to configure hardware filters. Tested by sthen@ and weerd@, ok mikeb@
* Replace INADDR_TO_IFP() by in_iawithaddr() and kill the macro.mpi2013-11-271-18/+1
| | | | ok mikeb@, ports@, henning@
* hide a bunch of structures (namely arpcom, llinfo_arp, ethernetmikeb2013-11-211-1/+3
| | | | | multicast macros and in_ifaddr) that reference ifnet in some way; looked over by deraadt, ok mpi
* Replace the last usage of IA_SIN() and kill this macro.mpi2013-11-211-6/+1
| | | | ok henning@, sthen@, mikeb@, deraadt@
* Remove the number of in_var.h inclusions by moving some functions andmpi2013-10-231-8/+1
| | | | | | global variables to in.h. ok mikeb@, deraadt@
* No need to expose twice in_socktrim(), it is only used in one file.mpi2013-10-231-2/+1
|
* Abstract the fact that IPv4 muticast records are linked to thempi2013-10-181-1/+2
| | | | | | | | | interface descriptor throught the first configured address in the global list, this will help reducing the size of future diffs. No object change. ok sthen@
* The header file netinet/in_var.h included netinet6/in6_var.h. Thisbluhm2013-10-171-5/+1
| | | | | | | created a bunch of useless dependencies. Remove this implicit inclusion and do an explicit #include <netinet6/in6_var.h> when it is needed. OK mpi@ henning@
* Change the macros used to iterate over the multicast records of anmpi2013-10-141-51/+17
| | | | | | | | | | interface to not depend on the global list of addresses. For IPv4 the IP_TO_IA() macro still depends on the global list of addresses because we want to be sure to grab the first configured address of an interface, where the records are linked. Tested by sthen@, ok henning@
* Replace hand-crafted for loop over in_ifaddr with FOREACH macro.bluhm2013-08-281-11/+9
| | | | OK mpi@
* Remove the scrub argument from in_ifinit() and simply call in_ifscrub()mpi2013-05-311-2/+2
| | | | | | unconditionally for SIOCSIFADDR. ok bluhm@, henning@
* simple replacement of LIST_END with NULL. ok mpitedu2013-03-221-4/+4
|
* align ifaliasreq.ifra_addr similar to the way that ifreq is fixed --deraadt2012-11-111-2/+8
| | | | | | a gruesome union, to block the compiler from placing the struct incorrectly aligned on stack frames ok guenther
* Since the IPv6 madness is not enough introduce NAT64 -- which is actuallyclaudio2011-10-131-1/+5
| | | | | | | | "af-to" a generic IP version translator for pf(4). Not everything perfect yet but lets fix these things in the tree. Insane amount of work done by sperreault@, mikeb@ and reyk@. Looked over by mcbride@ henning@ and myself at eurobsdcon. OK mcbride@ and general put it in from deraadt@
* an extra parameter for in_ifinit, indicating wether the ifaddr passed to ithenning2010-11-171-2/+2
| | | | | is new or an already existing one. for existing ones, call ifa_del first tested by many as part of a larger diff, ok claudio dlg krw sthen
* we don't need broadcast for the classful network AND broadcast for thehenning2010-01-131-2/+1
| | | | | subnet of the classful network. at least, not since 1992. ok mpf dlg bob
* let's admit it's not 1992 any more. CIDR is around for a long time, evenhenning2010-01-131-4/+2
| | | | | | | | | | | that router vendor doesn't default to classful routing any more, and there really is no point in having a classful netmask and a subnetmask to split it. we still do classful guesses on the netmask if it isn't supplied by userland, but that's about it. i decided to keep ia_netmask and kill ia_subnetmask which makes this diff bigish, the classful ia_netmask wasn't really used all that much. the real changes are in in.c, the rest is mostly s/ia_subnetmask/ia_netmask. ok claudio dlg ryan
* rtables are stacked on rdomains (it is possible to have multiple routingclaudio2009-11-031-2/+2
| | | | | | | | | | | | | | tables on top of a rdomain) but until now our code was a crazy mix so that it was impossible to correctly use rtables in that case. Additionally pf(4) only knows about rtables and not about rdomains. This is especially bad when tracking (possibly conflicting) states in various domains. This diff fixes all or most of these issues. It adds a lookup function to get the rdomain id based on a rtable id. Makes pf understand rdomains and allows pf to move packets between rdomains (it is similar to NAT). Because pf states now track the rdomain id as well it is necessary to modify the pfsync wire format. So old and new systems will not sync up. A lot of help by dlg@, tested by sthen@, jsg@ and probably more OK dlg@, mpf@, deraadt@
* Initial support for routing domains. This allows to bind interfaces toclaudio2009-06-051-3/+4
| | | | | | | | | alternate routing table and separate them from other interfaces in distinct routing tables. The same network can now be used in any doamin at the same time without causing conflicts. This diff is mostly mechanical and adds the necessary rdomain checks accross net and netinet. L2 and IPv4 are mostly covered still missing pf and IPv6. input and tested by jsg@, phessler@ and reyk@. "put it in" deraadt@
* fix macros up so they use the do { } while (/* CONSTCOND */ 0) idiomdlg2008-11-081-61/+61
| | | | ok deraadt@ otto@
* Remove inm_ifp from struct in_multi -- caching struct ifnet is dangerousclaudio2007-07-201-2/+1
| | | | | | | because interfaces may disappear without notice causing use after free bugs. Instead use the inm_ia->ia_ifp as a hint, struct in_ifaddr correctly tracks removals of interfaces and invalidates ia_ifp in such cases. looks good henning@ markus@
* Use more queue macros rather than doing it by hand; ok otto@ krw@miod2006-03-051-15/+16
|
* From NetBSD:pascoe2005-01-151-1/+3
| | | | | | | | | | - Keep track of allhost multicast address record we joined into each in_ifaddr and delete it when an address is purged. - Don't simply try to delete a multicast address record listed in the ia_multiaddrs. It results a dangling pointer. Let whoever holds a reference to it to delete it. mcbride@ markus@ ok
* de-register. deraadt okitojun2003-12-101-3/+3
|
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* First round of __P removal in sysmillert2002-03-141-8/+8
|
* Inclusion protection.angelos2001-06-091-1/+6
|
* bring in KAME IPv6 code, dated 19991208.itojun1999-12-081-1/+6
| | | | | | | | | replaces NRL IPv6 layer. reuses NRL pcb layer. no IPsec-on-v6 support. see sys/netinet6/{TODO,IMPLEMENTATION} for more details. GENERIC configuration should work fine as before. GENERIC.v6 works fine as well, but you'll need KAME userland tools to play with IPv6 (will be bringed into soon).
* From NetBSD: 960217 mergeniklas1996-03-031-2/+3
|
* initial import of NetBSD treederaadt1995-10-181-0/+214