summaryrefslogtreecommitdiff
path: root/sys/net/if.c
AgeCommit message (Collapse)Author
2014-04-10Retire rtinit() an use rt_ifa_add(9) and rt_ifa_del(9) to manageMartin Pieuchot
connected routes to prefixes/hosts. Since the introduction of rt_ifa_addloop(9) and rt_ifa_delloop(9), rtinit() was just a wrapper, so use the underlying functions directly and document them. Inputs from and ok mikeb@, manpage tweaks from jmc@
2014-03-20Do not pull <sys/tree.h> unconditionally in <net/if.h>, only the addressMartin Pieuchot
tree and the 80211 nodes need it. ok henning@, mikeb@
2014-03-19Since in{,6}_ifdetach() take care of removing the IPv4/6 addressesMartin Pieuchot
from the per-ifp list when an interface is destroyed/removed the only address left on the list at this point is the link-layer one. So remove the custom loop and its associated hack for the link-layer address and simply call if_free_sadl(). As a side effect, this should fix any scenario where if_alloc_sadl() is called multiple time since the first link-layer address allocated was never removed from the per-ifp list.
2014-02-04reduce the length of some pool names. ok deraadt guenther mpiTed Unangst
2013-11-28Change the way protocol multicast addresses are linked to an interface.Martin Pieuchot
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@
2013-11-27Let's call a rtableid a rtableid.Martin Pieuchot
ok mikeb@, henning@, claudio@
2013-11-19Remove some FDDI/ATM leftovers.Martin Pieuchot
ok mikeb@, henning@, deraadt@, brad@, miod@
2013-11-18Convert trunk(4) to use a detachhook, discussed at b2k13 with many.Martin Pieuchot
While here add a comment explaining detach hooks' order of execution when destroying/detaching an interface.
2013-11-11Replace most of our formating functions to convert IPv4/6 addresses fromMartin Pieuchot
network to presentation format to inet_ntop(). The few remaining functions will be soon converted. ok mikeb@, deraadt@ and moral support from henning@
2013-10-23Remove the number of in_var.h inclusions by moving some functions andMartin Pieuchot
global variables to in.h. ok mikeb@, deraadt@
2013-10-21Enable IPv6 routing domain supportPeter Hessler
Started by claudio@ for IPv4, lots of heavy work by sperreault@ My part started at s2k11, continued at n2k12, g2k12, c2k12 and n2k13. Lots of help and hints from claudio and bluhm OK claudio@, bluhm@
2013-10-20rt_mpath_next() was always called with 0 in the last argument. So drop it.Claudio Jeker
OK henning@
2013-10-19in order to make our life a tad easier and prevent rogue accessesMike Belopuhov
to the routing table from the hardware interrupt context defer the if_link_state_change to the process context. a token (an interface index) is passed to the workq in order to make sure that if the interface would be gone by the time syswq goes around to run the task it would just fall through. ok henning, mpi, deraadt, claudio
2013-10-19Bring back the if_detachhook. We're going to have more users now.Reyk Floeter
ok mpi@ henning@ benno@
2013-10-19When we attach an interface, do not try to reuse the last index toMartin Pieuchot
limit the possible races related to unscheduled task, or anything else, relying on an unique index. I say "limit" here because a race can still occurs if you run out of indexes and jump back to 1. A generation number can be added later to avoid this problem. ok deraadt@, claudio@, krw@, mikeb@, "I can live with it" reyk@
2013-10-17The header file netinet/in_var.h included netinet6/in6_var.h. ThisAlexander Bluhm
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@
2013-10-09Introduce in_ifdetach() a function to remove all the IPv4 addressesMartin Pieuchot
of an interface, named after its IPv6 equivalent. Make use of it instead of removing addresses by hand when detaching or destroying an interface. As a bonus, multicast records linked to the just divorced^Wdetached interface are no longer leaked. No objection from the gang, ok mikeb@
2013-09-17Change vlan(4) detach procedure to not use a hook but a list of vlansMartin Pieuchot
on the parent interface. This is similar to what bridge(4), trunk(4) or carp(4) are doing and allows us to get rid of the detachhook. ok reyk@, mikeb@
2013-09-12Revert previous diff to always increment the interface index, tun_switch()Martin Pieuchot
depends on this feature, discussed with claudio@.
2013-08-28When we attach an interface, do not try to reuse the last index to limitMartin Pieuchot
the possible races related to unscheduled task relying on an unique index. I say "limit" here because a race can still occurs if you run out of indexes and jump back to 1. ok krw@, mikeb@
2013-08-28Remove unused argument from *rtrequest()Martin Pieuchot
ok krw@, mikeb@
2013-08-20tedu netnatm and ueagle(4).Martin Pieuchot
ok mikeb@, sthen@, tedu@ (implied), doc bits ok jmc@
2013-06-20Revert previous and unbreak asr, the new include should be protected.Martin Pieuchot
Reported by naddy@
2013-06-20Allocate the various hook head descriptors as part of the ifnetMartin Pieuchot
structure rather than doing various M_WAITOK allocations during the *attach() functions, we always rely on them anyway. ok mikeb@, uebayasi@
2013-06-18Use malloc(M_WAITOK) in if_attach_common(), because this function mustMasao Uebayashi
succeed, and it's always called in sleepable context. OK mikeb@ yasuoka@
2013-04-02Instead of storing the link-level address of every interface in a globalMartin Pieuchot
array indexed by interface numbers, add a new field to the interface descriptor pointing to it. claudio@ and todd@ like it, ok mikeb@
2013-03-29Replace hand-crafted loops in if.c with the FOREACH macro.Alexander Bluhm
OK tedu@ claudio@
2013-03-28code that calls timeout functions should include timeout.hTed Unangst
slipped by on i386, but the zaurus doesn't automagically pick it up. spotted by patrick
2013-03-28no need for a lot of code to include proc.hTed Unangst
2013-03-28Replace some casts to struct in_ifaddr pointer by ifatoia() or NULL.Martin Pieuchot
ok millert@, haesbaert@, bluhm@
2013-03-26Remove various read-only *maxlen variables and use IFQ_MAXLEN directly.Martin Pieuchot
ok beck@, mikeb@
2013-03-20Introduce if_get() to retrieve an interface descriptor pointer givenMartin Pieuchot
an interface index and replace all the redondant checks and accesses to a global array by a call to this function. With imputs from and ok bluhm@, mikeb@
2013-03-15change LIST_END to literal NULL for clarity.Ted Unangst
ok claudio mpi
2013-03-07Remove unused ifa_ifwithaf() function.Martin Pieuchot
ok mikeb@, miod@
2013-03-07Remove the IFAFREE() macro, the ifafree() function it was calling alreadyMartin Pieuchot
check for the reference counter. ok mikeb@, miod@, pelikan@, kettenis@, krw@
2012-11-23Add SIOCGIFHARDMTU to allow retrieving the driver's maximum supported MTUStuart Henderson
looks fine reyk@ ok mikeb@
2012-10-23Only clear the revarp_ifp if the ifp pointing to it is detached.Claudio Jeker
Since the ifp is not detached in the SIOCSIFRDOMAIN case remove the clear there. With and OK deraadt@
2012-10-18Move revarp code into #ifdef NFSCLIENT; saving space on some media.Theo de Raadt
Resurrect the rather silly "unplug my network device while I am doing nfs diskless revarp" safety code which was disabled due to a missing "ether.h" include, found by jsg ok jsg
2012-10-05Point an interface directly to its bridgeport configuration, insteadCamiel Dobbelaar
of to the bridge itself. This is ok, since an interface can only be part of one bridge, and the parent bridge is easy to find from the bridgeport. This way we can get rid of a lot of list walks, improving performance and shortening the code. ok henning stsp sthen reyk
2012-09-19Make rt_lookup return a pointer to an rtentry struct instead ofBret Lambert
to a radix_node struct. The radix tree pushdown continues. ok claudio@
2012-09-19More radix internals pushdown; place rn_mpath_next, which accepts andBret Lambert
returns radix_node pointers, inside a new rt_mpath_next, which accepts and returns rtentry pointers, and start using that instead. ok claudio@
2012-09-18Wrap rtable_add() and rtable_l2set() calls inside ifioctl() inside softnet,Bret Lambert
as functions that modify routing information shouldn't be interruptable by network traffic. Also make sure that both of those functions assert that they are called at softnet. I'm reasonably sure that there shouldn't be any, but if there is any codepath that was missed, we're going to be here for another 4 days to deal with any fallout. While here, move the multitude of "int s" declarations inside ifioctl to the beginning of the function. okay claudio@
2012-01-03To access the ifaddr of an in_ifaddr or in6_ifaddr struct, it isAlexander Bluhm
cleaner to access the first member via ia_ifa instead of casting. No binary change. ok henning@ krw@
2011-10-24Don't detach interface from group in if_clone_destroy(),Camiel Dobbelaar
if_detach() handles this ok. carpdetach() can now lower the demote count on the carp group correctly. ok henning mpf
2011-07-09begone, fucking rotten appletalk shit. ok roomHenning Brauer
2011-07-08new priority queueing implementation, extremely low overhead, thus fast.Henning Brauer
unconditional, always on. 8 priority levels, as every better switch, the vlan header etc etc. ok ryan mpf sthen, pea tested as well
2011-07-06cosnistently use IFQ_SET_MAXLEN, surfaced in a discussion with + ok bluhmHenning Brauer
2011-07-05now of course I only noticed if_qflush is completely unused afterHenning Brauer
adjusting it to the new world order in my tree... remove it, ok ryan claudio
2011-07-04remove compat_svr4 support. ok deraadtTed Unangst
2011-03-13Add a way to enable/disable Wake On LAN with ifconfig.Stefan Sperling
ok deraadt