summaryrefslogtreecommitdiff
path: root/sys/net/if.c
AgeCommit message (Collapse)Author
2008-05-07Prevent virtual interfaces from adding to the random pool.Marco Pfatschbacher
Also move the sampling into ether_input() where it can happen at the interrupt and not within splnet() processing, which might be less random. Discussed with mickey. OK markus@, mcbride@
2008-04-10introduce mitigation for the calling of an interfaces start routine.David Gwynne
decent drivers prefer to have a lot of packets on the send queue so they can queue a lot of them up on the tx ring and then post them all in one big chunk. unfortunately our stack queues one packet onto the send queue and then calls the start handler immediately. this mitigates against that queue, send, queue, send behaviour by trying to call the start routine only once per softnet. now its queue, queue, queue, send. this is the result of a lot of discussion with claudio@ tested by many.
2008-01-05make sure all callers of rtlabel_id2name check for a null return value.Henning Brauer
all the original ones did, the recently added ones for labels per interface didn't. no cookie for reyk ;( ok deraadt
2008-01-05rtlabel_id2name() can return NULL if there is no route label..Theo de Raadt
from chris@nmedia.net
2007-09-15malloc sweep:Henning Brauer
-remove useless casts -MALLOC/FREE -> malloc/free -use M_ZERO where appropriate instead of seperate bzero feedback & ok krw, hshoexer
2007-07-06btintrq has been removed from bt_input.c, don't reference it here.Christian Weisgerber
Makes bluetooth build again. ok uwe@
2007-07-04Fix a use after free crash in in_delmulti(). If a interface is detachedClaudio Jeker
before it is removed from the multicast group in_delmulti() will try to access the no longer available ifp. We invalidate the ifa_ifp back pointer in the ifa in if_detach() now and use the ifa_ifp in in_delmulti() instead of the internal inm_ifp. By doing it this way we know if the interface was removed. This fixes a kernel panic triggered by ospfd and gif(4) tunnels. looks good henning@ reyk@
2007-06-17add back missing bcopy & break, got lost when removing arcnet.Henning Brauer
spotted by Mike Belopuhov <mkb@crypt.org.ru>
2007-06-14Add a new "rtlabel" option to ifconfig. It allows to specify a route labelReyk Floeter
which will be used for new interface routes. For example, ifconfig em0 10.1.1.0 255.255.255.0 rtlabel RING_1 will set the new interface address and attach the route label RING_1 to the corresponding route. manpage bits from jmc@ ok claudio@ henning@
2007-06-08kill arcnet leftovers, some pt out by Mike Belopuhov <mkb@crypt.org.ru>,Henning Brauer
some I found afterwards, ok dlg
2007-06-06remove remaining IPX hooks. all inside #ifdef IPX, so no actual changeHenning Brauer
2007-05-29Spaces, no binary changes.Claudio Jeker
2007-05-28Only call add_net_randomness() once per interrupt instead of once per ↵Ryan Thomas McBride
packet. If multiple packets come in on a single interrupt the times mixed into the randomness pool will be identical or predictably close anyways, and nanotime() is expensive. ok toby jason miod claudio
2007-03-25Synchronise carp advertisements on group demotion.Marco Pfatschbacher
This reduces group failover time to a few milliseconds. Diff from Nathanael. OK henning@
2007-03-18Add IP load balancing support for carp(4).Marco Pfatschbacher
This provides a similar functionality as ARP balancing, but also works for traffic that comes across routers. IPv6 is supported as well. The configuration scheme will change as soon we have sth better. Also add support for changing the MAC address on carp(4) interfaces. (code from mcbride) Tested by pyr@ and reyk@ OK mcbride@
2007-02-14Consistently spell FALLTHROUGH to appease lint.Jonathan Gray
ok kettenis@ cloder@ tom@ henning@
2007-02-12Don't pass random flags to SIOIFFLAGS when changing the lladdr.Marco Pfatschbacher
OK tedu@
2006-12-03Add Rapid Spanning Tree Protocol support (802.1d-2004) based on workReyk Floeter
by Andrew Thompson (thompsa@freebsd.org). The local changes include adoption to our bridge code, reduced stack usage and many other bits. If stp is enabled, RSTP will now be used by default. Thanks for help from Andrew. This code has been in snaps for while now, commit encouraged by deraadt@
2006-11-24Check the reference count for interface addresses when detachingCan Erkin Acar
an interface. Fixes a double free panic. ok claudio@, looks fine henning@
2006-11-16introduce if_creategroup() to create an empty interface group.Henning Brauer
code factored out from if_addgroup(), previously a group always had to have members. ok mpf mcbride
2006-10-21the create and destroy functions for clonable interfaces return 0 onHenning Brauer
success, not -1 on error. fix check in 2 cases. ok mpf mcbride
2006-08-29allow the carp demotion counter to be changed by arbitary values as longHenning Brauer
as the resulting demotion counter value is in range. previously, we only allowed +/- 1. ok mpf mcbride deraadt
2006-07-18typoMichael Shalayeff
2006-06-02Introduce attributes to interface groups.Marco Pfatschbacher
As a first user, move the global carp(4) demotion counter into the interface group. Thus we have the possibility to define which carp interfaces are demoted together. Put the demotion counter into the reserved field of the carp header. With this, we can have carp act smarter if multiple errors occur. It now always takes over other carp peers, that are advertising with a higher demote count. As a side effect, we can also have group failovers without the need of running in preempt mode. The protocol change does not break compability with older implementations. Collaborative work with mcbride@ OK mcbride@, henning@
2006-03-22prevent anything outside rote.c from accessing the routing table headsHenning Brauer
directly. rather provide a rt_lookup function for regular lookups, and a rt_gettable for those that need access to the head for some reason. the latter cases should be revisted later probably so that nothing outside the routing core code accesses the heads at all... tested claudio jolan me, ok claudio markus
2006-03-20introduce rt_if_remove which takes care of routing table updates for anHenning Brauer
interface that is removed. use that from if.c and if_tun.c instead of re-implementing in the latter case. ok claudio
2006-03-04With the exception of two other small uncommited diffs this movesBrad Smith
the remainder of the network stack from splimp to splnet. ok miod@
2006-02-09add an interface detach hook and use it with the vlan(4) driver. thisReyk Floeter
fixes a possible crash if the parent interface has been destroyed (like vlan on trunk) before destroying the vlan interface. ok brad@
2006-01-05bzero buffers after malloc, or clear string buffer before strlcpy'ingTheo de Raadt
into them, if you are gonna copy it out to userland some ok dhartmei, some ok tedu
2005-12-22Do not check ifp->if_bpf before detaching from bpf. It is only a signalCan Erkin Acar
to the driver that there is a listener. Somehow I assumed that it was a handle, and was trying to figure out why it was becoming zero. Corrected by and ok claudio@
2005-11-29something in the eurobsdcon route-a-thon broke my simple home networkJolan Luff
router so back out the routing stuff to pre-eurobsdcon where my machine doesn't crash immediately. i am happy to test diffs and report success/failures but i am not happy to have instantaneous crashes when i reboot with a new kernel that was compiled from pristine sources. if you are going to be an elitist asshole then you could at least make sure your code works. ok and "be crass towards them" deraadt@
2005-11-27don't let anything outside route.c access the routing table heads directly,Henning Brauer
but go through a provided wrapper. also provide rt_lookup() instead of doing the lookup manually in many places. ryan ok
2005-11-25move the code to delete routes having a specific interface as outputHenning Brauer
when the interface is deleted to a function in route.c, and replace the copies of that code by calls to that function from basel almost-hackathon
2005-07-04in if_group_routechange(), when checking wether a default route was changedHenning Brauer
to trigger an if_group_egress_build() call, stop looking at the mask in the v4 case, at least until I figured out why we sometimes see masks full of crap.
2005-06-23update if_lastchange for evey IFF_UP change not only SIOCSIFFLAGS; henning@ okMichael Shalayeff
2005-06-14rename function and define to reflect the external -> egress name changeHenning Brauer
so it is clear what it is all about
2005-06-13check wether mask is NULL in if_group_routechange before dereferencingHenning Brauer
2005-06-12add SIOCGIFGMEMB ioctl, returns a list of all interfaces who are member ofHenning Brauer
the given group, markus ok
2005-06-08if a cloned interface's destroy function fails, re-join the interface classHenning Brauer
group, spotted by and ok markus
2005-06-08kill NS and DECNET bitsHenning Brauer
2005-06-08more inet6 stuff that got exposedTheo de Raadt
2005-06-08handle ramdisks, and kernels without inet6; henning okTheo de Raadt
2005-06-07introduce a default "external" interface group, containing the interface(s)Henning Brauer
the the default route(s) point to. handles IPv4 and IPv6 as well as multipath routes. follows default route changes, of course. eases writing pf rulesets especially on laptops etc. that use different interfaces depending on the environment (wired, wireless, ...) ok theo ryan
2005-06-07do not handle CCITT any longerHenning Brauer
2005-06-06use a define instead of hardcoding "all" in 3 placesHenning Brauer
2005-06-06make cloned interfaces join an interface class group (carp for carpX, tunHenning Brauer
for tunX etc) in if_clone_create and leave it in if_clone_destroy, ryan ok
2005-06-05const'ify the char *groupname param to if_addgroup and if_delgroupHenning Brauer
2005-05-26deny groupnames ending in digits in if_addgroup, frantzen okHenning Brauer
(this has been on my todo, mike beat me to it with the check in ifconfig, but we want it here too)
2005-05-26oups another unused varHenning Brauer
2005-05-26unused varHenning Brauer