summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_carp.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use interface index instead of pointer to `ifnet' in carp(4).mvs2020-07-241-4/+6
| | | | ok sashan@
* move carp_input into ether_input, instead of via an input handler.dlg2020-07-221-1/+3
| | | | | | | | carp_input is only tried after vlan and bridge handling is done, and after the ethernet packet doesnt match the parent interfaces mac address. this has been in snaps as part of a larger diff for over a week.
* Make sure packet destination address matches interface address,sashan2019-12-081-1/+15
| | | | | | | | | where such packet is bound to. This check is enforced if and only IP forwarding is disabled. Change discussed with bluhm@, claudio@, deraadt@, markus@, tobhe@ OK bluhm@, claudio@, tobhe@
* All places that call carp_lsdrop() use the interface pointer already.bluhm2018-05-211-3/+3
| | | | | | | | It does not make sense to call if_get() again, just pass ifp as parameter. Move the IFT_CARP check into the function instead of doing it everywhere. Replace the inverted match variable logic with simple returns. OK mpi@ friehm@
* have carp use standard detach hooks instead of getting special handlingdlg2018-01-121-2/+1
| | | | | | | | | | | | | if_deactivate looked for carp parent interfaces and called carp_ifdetach to have children interfaces unplug themselves. this diff has the carp interfaces register detach hooks on the parent instead. the effect is the same, but using the standard every other interface uses. while im here i shuffle the order the hooks carp_set_ifp are estabilshed so it will fail if they arent allocated. ok visa@ mpi@
* get rid of struct carp_if by moving the srpl into struct ifnet if_carp.dlg2018-01-101-2/+2
| | | | | | | | | | | | | currently carp uses a struct carp_if to hold an srp list head, which is accessed by both if_carp in struct ifnet, and via the if input handlers list. this gets rid of some indirection by making if_carp itself the list head, rather than a pointer to the list head via a struct carp_if. it also makes accessing the list consistent by only using if_carp to get to it. ok mpi@
* Replace non mp-safe carp_iamatch6() with mp-safe carp_iamatch().mpi2017-11-231-2/+1
| | | | | | | They have the same functionnality since friehm@ cleaned up balancing code. ok florian@, visa@, patrick@, bluhm@, jmatthew@
* Carp balancing ip does not work since there is a mac filter infriehm2017-05-301-2/+3
| | | | | | | ether_input(). Now we use mbuf tags instead of modifying the MAC address. ok mpi@
* Pass down the address family through the pr_input calls. Thisbluhm2017-04-141-3/+3
| | | | | allows to simplify code used for both IPv4 and IPv6. OK mikeb@ deraadt@
* carp(4) percpu countersjca2017-02-201-1/+32
| | | | ok florian@
* Change the IPv4 pr_input function to the way IPv6 is implemented,bluhm2017-01-291-2/+2
| | | | | | | 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-2/+2
| | | | | | make the variable parameters of the protocol input functions fixed. Also add the proto to make it similar to IPv6. OK mpi@ guenther@ millert@
* Get rid of the ``enaddr'' argument of carp_iamatch().mpi2016-06-061-2/+2
| | | | | | | It was only checked in balancing mode, which is currently broken, and is no longer needed. Discusssed with bluhm@ and Florian Riehm.
* Make use of srp_enter()/srp_leave() in carp_iamatch() in preparationmpi2015-11-181-2/+2
| | | | | | for unlocking the ARP input path. ok dlg@
* Retire ARP load-balacing, thanks for all the fish!mpi2015-11-021-10/+8
| | | | | | | | | One of the keys of our MP work relies on making OpenBSD's kernel simpler! In this case turning ARP processing MP-safe is quite complicated due to the way carp(4) is hooked in arpinput() and nowadays you'd better run kitchensinkd(9) anyway :) ok bluhm@, claudio@, reyk@
* Do not pass an ``ia'' just to dereference ``ia_ifp''.mpi2015-10-221-2/+2
| | | | ok claudio@, bluhm@, jsg@
* Move carp-related logic from ether_output() into carp_start().mpi2015-06-081-2/+1
| | | | ok sthen@, phessler@
* Take carp(4) out of ether_input().mpi2015-06-021-4/+1
| | | | | | Tested by <mxb AT alumni DOT chalmers DOT se>, thanks! ok bluhm@, dlg@
* add messages to #error so we know what's what (and so unifdef doesn't poop)tedu2014-12-191-2/+2
|
* ether_output: instead of assembling the ethernet header and then callinghenning2014-04-201-2/+2
| | | | | | | carp_rewrite_lladdr to overwrite the src lladdr, get the intended src lladdr before assembling the ethernet header. carp_rewrite_lladdr -> carp_get_srclladdr ok reyk claudio
* Pass the receiving interface pointer to carp_input() instead of re-mpi2014-01-221-2/+3
| | | | | | | reading it from the packet header. While here makes carp_input() take the same arguments as ether_input(). ok bluhm@, mikeb@
* Make carp_ourether() shorter and more generic. Only a mac addresscamield2012-10-081-2/+2
| | | | | | is really needed, instead of an ethernet header and selector. ok mikeb henning mpf
* Properly adjust group demotion counters when groups are added ormpf2010-04-251-2/+2
| | | | | | | removed. Extend carp demote logging to also show the reason for the demote. Return EINVAL instead of ERANGE if a carpdemote request is out range. Requested from otto. OK mcbride, henning.
* add carppeer; an option to specify a different multicast address orreyk2008-06-141-2/+3
| | | | | | | | | | | | even the unicast address of the remote carp peer. this especially helps when the multicast carp advertisements are causing problems in the network (some crappy switches don't do well with multicast), there are conflicts with VRRP, or the policy of the network does not allow multicast (most Internet eXchange points didn't allow carped OpenBGP routers because of the multicast advertisements). discussed with many ok mpf@
* Move carp load balancing (ARP/IP) to a simpler configuration scheme.mpf2008-02-051-8/+15
| | | | | | | | | | | | | | Instead of using the same IP on multiple interfaces, carp has to be configured with the new "carpnodes" and "balancing" options. # ifconfig carp0 carpnodes 1:0,2:100,3:100 balancing ip carpdev sis0 192.168.5.50 Please note, that this is a flag day for anyone using carp balancing. You'll need to adjust your configuration accordingly. Addititionally this diff adds IPv6 NDP balancing support. Tested and OK mcbride@, reyk@. Manpage help by jmc@.
* add sysctl entry points into various network layers, in particular toderaadt2007-12-141-2/+4
| | | | provide netstat(1) with data it needs; ok claudio reyk
* Factor out the virtual host portion of carp into a separate structmpf2007-11-221-3/+6
| | | | | | | | | | | | | | | | | | | | that is kept in a list per carp interface. This is the huge first step necessary to make carp load balancing nice and easy. One carp interface can now contain up to 32 virtual host instances. This doesn't do anything useful yet, but here is how an ifconfig for multiple entries now looks like: # ifconfig carp2 carpnodes 5:0,6:100 192.168.5.88 carp2: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 lladdr 00:00:5e:00:01:05 carp: carpdev sis0 advbase 1 state MASTER vhid 5 advskew 0 state BACKUP vhid 6 advskew 100 groups: carp inet 192.168.5.88 netmask 0xffffff00 broadcast 192.168.5.255 OK mcbride@
* Make use of the carp preempt counter to signal number of transitions ofjoel2007-09-031-2/+2
| | | | | | | any carp group to master status. ok dhartmei@
* Add IP load balancing support for carp(4).mpf2007-03-181-2/+3
| | | | | | | | | | | | | 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@
* Introduce attributes to interface groups.mpf2006-06-021-3/+4
| | | | | | | | | | | | | | | | | | 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@
* use underscore variants of _BYTE_ORDER macros which are always definedtedu2006-04-271-3/+3
| | | | ok deraadt millert
* in ansi c, bitfields must be done against int, unsigned int, or _Bool.deraadt2005-12-101-3/+3
| | | | so we must start to use u_int; ok cloder
* Introduce if_linkstatehooks.mpf2005-04-201-2/+2
| | | | | | | | This converts if_link_state_change() to a generic usable callback with dohooks(). OK henning@, camield@ Tested by camield@ and Alexey E. Suslikov
* Unbreak arp_input with carp; add back the call to carp_iamatch()mcbride2005-03-011-3/+3
| | | | | | | which was removed in rev 1.57. This makes arpbalance work again, and ensures that only one carp host will reply to a given arp request. ok mpf@ pascoe@ dhartmei@ deraadt@
* Rewriting the lladdr can now be done without using mbuf tags.mpf2005-01-181-4/+1
| | | | | | | | | | Advertisements run through the carp interface first. So we just take the address from ifp0. While we're there, also remove carp_macmatch6, which isn't used anymore. Proposed by mcbride@ ok mcbride@, pascoe@
* Make it possible for carp to work on fddi and token ring again.mcbride2004-12-191-3/+5
| | | | ok pascoe@ mpf@
* Reorder code in the ethernet output path, and enhance unicast addresspascoe2004-12-171-1/+2
| | | | | | | matching in the bridge receive path to make CARP operate correctly on physical interfaces that are participating in a bridge. ok mcbride@ henning@ dlg@
* protect against multiple inclusionpat2004-12-151-2/+6
| | | | mcbride ok
* move ioctls together w/ all other ifaces; mcbride@ okmickey2004-12-141-3/+1
|
* Rename carp_output() to carp_fix_lladdr().mcbride2004-12-101-3/+3
|
* Check if_type in carp_carpdev_state() to make sure we're notmcbride2004-12-081-2/+2
| | | | dealing with a carp interface.
* Convert carp(4) to behave more like a regular interface, much in the samemcbride2004-12-071-7/+16
| | | | | | | | style as vlan(4). carp interfaces no longer require the physical interface to be on the same subnet as the carp interface, or even that the physical interface has an adress at all, so CARP can now be used on /30 networks. ok deraadt@ henning@
* Document the CARP header layout.mcbride2004-07-291-2/+29
|
* Remove unused #define.mcbride2004-05-051-2/+1
|
* carp stats cleanup:mcbride2004-04-281-17/+17
| | | | | | | - convert counters to 64 bits - remove junk from netstat ok pb@
* Make carp(4) aware of its physical interface:mcbride2004-04-281-1/+2
| | | | | | | | | | | - If the physical interface goes down or the link goes down, the carp interface goes down as well. - We treat this like the preemption holdoff with pfsync. So if one of the carp interfaces is known to be bad (because the physical interface it's associated with is bad), all the other carp interfaces back off: they won't preempt, and their advskew goes to 240. ok cedric@
* convert __attribute__((__packed__)) to __packed so that parsers unawareavsm2003-11-161-2/+2
| | | | | of gcc extensions have more of a chance. ok mcbride@, no objections from millert@, deraadt@
* Check to make sure that the packet was received on a carp-enabled interface.mcbride2003-11-071-1/+2
| | | | Pointed out by Marco Pfatschbacher, ok mickey@
* Add IPv6 support to CARP.mcbride2003-10-311-3/+8
| | | | ok deraadt@
* Common Address Redundancy Protocolmcbride2003-10-171-0/+124
Allows multiple hosts to share an IP address, providing high availability and load balancing. Based on code by mickey@, with additional help from markus@ and Marco_Pfatschbacher@genua.de ok deraadt@