summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_carp.c
AgeCommit message (Collapse)Author
2014-07-22Fewer <netinet/in_systm.h> !Martin Pieuchot
2014-07-12add a size argument to free. will be used soon, but for now default to 0.Ted Unangst
after discussions with beck deraadt kettenis.
2014-07-09bpf code surgery / shuffling / simplification.Henning Brauer
the various bpf_mtap_* are very similiar, they differ in what (and to some extent how) they prepend something, and what copy function they pass to bpf_catchpacket. use an internal _bpf_mtap as "backend" for bpf_mtap and friends. extend bpf_mtap_hdr so that it covers all common cases: if dlen is 0, nothing gets prepended. copy function can be given, if NULL the default bpf_mcopy is used. adjust the existing bpf_mtap_hdr users to pass a NULL ptr for the copy fn. re-implement bpf_mtap_af as simple wrapper for bpf_mtap_hdr. re-implement bpf_mtap_ether using bpf_map_hdr re-implement bpf_mtap_pflog as trivial bpf_mtap_hdr wrapper ok bluhm benno
2014-06-30Kill dead code, what does a negative number of addresses on a carp(4)Martin Pieuchot
mean? ok deraadt@
2014-04-30Remove carp_seroute() it no longer does anything useful but mess withMartin Pieuchot
your IPv4 routes. mcbride@ says that this function has been introduced in order to be able to reach the MASTER node from a BACKUP node using the CARP address. The reasons are: 1) For troubleshooting, so I can ping or otherwise monitor the MASTER host. 2) In some cases it's undesirable (or even not possible) to run services on other IP addresses. For example, services that only allow you to configure 1 listening IP, or services where you wish to avoid users connecting to anything but the MASTER server. Sadly this function becames a horrible hack. So if somebody thinks the reasons explained before justify such logic, feel free to submit a correct diff. ok bluhm@, henning@, mikeb@
2014-04-21ip_output() using varargs always struck me as bizarre, esp since it's onlyHenning Brauer
ever used to pass on uint32 (for ipsec). stop that madness and just pass the uint32, 0 in all cases but the two that pass the ipsec flowinfo. ok deraadt reyk guenther
2014-04-20ether_output: instead of assembling the ethernet header and then callingHenning Brauer
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
2014-04-14"struct pkthdr" holds a routing table ID, not a routing domain one.Martin Pieuchot
Avoid the confusion by using an appropriate name for the variable. Note that since routing domain IDs are a subset of the set of routing table IDs, the following idiom is correct: rtableid = rdomain But to get the routing domain ID corresponding to a given routing table ID, you must call rtable_l2(9). claudio@ likes it, ok mikeb@
2014-03-27Stop mixing interface address flags with routing entry ones.Martin Pieuchot
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@
2014-03-21Global lists of addresses are species near extinction, even carp doMartin Pieuchot
not like them! Since carp(4) interfaces do some magic tricks to find a compatible interface if you do not specify a `carpdev' argument, make them iterate over &ifnet instead of &in{,6}_ifaddr. ok benno@, mikeb@, florian@
2014-03-18Rename rt_gettable() into rtable_get(), swap its arguments to beMartin Pieuchot
coherent with the existing rtable_* functions and document it. While here fix some other manpage glitches pointed out by jmc@.
2014-02-13When sending a neighbor advertisement, correctly use the carp macMartin Pieuchot
address and not the mac of the physical interface as target lladdr. This allows us to get rid of the hack adding and removing the route to loopback of a carp node when its status switch to master and backup respectively. Now the route entry will no longer be updated to use the mac address of the physical interface of the master node as gateway. While here send the ARP request through the carp interface for consistency. Analysed with and ok mikeb@, ok bluhm@
2014-02-07Make carp send IPv6 neighbour advertisements with the 'router' flagStefan Sperling
if we're acting as router. Otherwise clients lose the default route learned from router advertisements during carp failover. Patch by Ole Myhre; ok bluhm@
2014-01-22Pass the receiving interface pointer to carp_input() instead of re-Martin Pieuchot
reading it from the packet header. While here makes carp_input() take the same arguments as ether_input(). ok bluhm@, mikeb@
2014-01-13Call all local valiables of type struct in6_ifaddr "ia6". This isAlexander Bluhm
consistent with struct ifaddr "ifa" and struct in_ifaddr "ia". OK mpi@
2014-01-09bzero/bcmp -> memset/memcmp. ok matthewTed Unangst
2013-11-28Use the local variable referencing the receiving interface instead ofMartin Pieuchot
dereferencing the mbuf various times. No functional change. ok mpf@, bluhm@
2013-11-21Remove unneeded include.Martin Pieuchot
ok deraadt@
2013-10-28tedu FDDI support and the 3 flavors the driver for DEC devices, evenMartin Pieuchot
miod@ cannot find two boards using the same media. With precious punctuation review from guenther@, thanks! ok deraadt@, henning@
2013-10-20Put a large chunk of the IPv6 rdomain support in-tree.Peter Hessler
Still some important missing pieces, and this is not yet enabled. OK bluhm@
2013-10-19Now carp_set_addr() and carp_set_addr6() break out of the loop afterAlexander Bluhm
they have found the interface address, so we can get rid of the additional variable ia_if. No functional change. OK mpi@ phessler@
2013-10-19In carp_set_addr6() break out of the loop after the interface addressAlexander Bluhm
has been found. This makes the IPv6 code work like IPv4. OK mpi@
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-08-12In the common IPv4 and IPv6 file ip_carp.c an #ifdef INET6 wasAlexander Bluhm
missing. Especially the IN6_IS_ADDR_LINKLOCAL() macro should not be necessary in IPv4 only code. No binary change. OK henning@ claudio@
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 TAILQ_FOREACH() instead of handrolling our own version and stopMartin Pieuchot
iterating once we found a matching address. ok mpf@, yasuoka@, henning@
2013-06-03fix typo in commentYASUOKA Masahiko
2013-06-02Exclude the mac address for the HMAC calculation if lladdr is the realYASUOKA Masahiko
one so that we can use the real MAC address for carp(4) like an example following. ifconfig carp0 carpdev REALIF lladdr <real interface's lladdr> ok reyk mcbride
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-28do not include machine/cpu.h from a .c file; it is the responsibility ofTheo de Raadt
.h files to pull it in, if needed ok tedu
2013-03-28no need for a lot of code to include proc.hTed Unangst
2013-03-26Remove various read-only *maxlen variables and use IFQ_MAXLEN directly.Martin Pieuchot
ok beck@, mikeb@
2013-03-25Substitute the handcrafted list of IPv6 addresses by a proper TAILQ.Martin Pieuchot
ok bluhm@, mikeb@
2013-03-22simple replacement of LIST_END with NULL. ok mpiTed Unangst
2012-10-08Make carp_ourether() shorter and more generic. Only a mac addressCamiel Dobbelaar
is really needed, instead of an ethernet header and selector. ok mikeb henning mpf
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-19inherit IFCAP_CSUM_* from the parent interfaceHenning Brauer
in my tree for a while and I forgot what exactly triggered it, but in one way or another this comes from the netbsd camp ok benno mpf
2012-04-11fix all the suser calls which pass an incorrect p_acflag argument;Mike Belopuhov
figured out by and ok guenther
2011-11-19Select a routing table according to the rdomain. Allows oneMike Belopuhov
to connect to the carp address when the carpdev interface has an ip address too in the non-default rdomain. ok claudio
2011-10-30In the advbase 0 case, we have to use three timesMarco Pfatschbacher
the advskew as the master down timeout. OK henning.
2011-10-24Lower carp demote count on interface detach, fixes a bug introduced by rev ↵Camiel Dobbelaar
1.175. ok henning mpf
2011-10-16Use m_pullup() instead of IP6_EXTHDR_GET() to get the carp headerMarco Pfatschbacher
in the v6 input path. IP6_EXTHDR_GET() internally uses m_pulldown(), which might return a pointer to a different mbuf in the chain. In this case, carp_cksum() will be called with the wrong mbuf. This fixes occasional checksum mismatches. Problem found and initial fix by stsp@ OK stsp@
2011-09-06Properly initialize struct carp_if (especially vhif_nvrs) with M_ZERO.Marco Pfatschbacher
This lets carp delete IFF_PROMISC on its carpdev upon destroy. Fix from Stefan Rinkes. OK sthen, bluhm, deraadt.
2011-07-08mark carp advertisements to be queued at priority 6. losing them is bad,Henning Brauer
mkay? ok ryan
2011-07-04Don't make copy multicast packets for carp interfacesMarco Pfatschbacher
that are not up. OK henning.
2011-07-04Allow advbase to be set to zero, which makes it possible to runMarco Pfatschbacher
with advertisement intervals of less than a second. This is needed in setups where takover times < 3s are needed. Don't use this unless you really need it. Running with too agressive timeouts might lead to false positive takeovers. OK mcbride, claudio.
2011-07-03avoid void * pointer arithmeticDavid Hill
OK claudio@
2011-07-03Do not use LINK_STATE_UNKNOWN for the INIT state. LINK_STATE_UNKNOWN hasClaudio Jeker
a special meaning and should only be set if the link state is not known because it is considered as being up. Use LINK_STATE_INVALID instead. OK mpf@ mcbride@ henning@
2011-05-04Collapse m_pullup and m_pullup2 into a single function, as they'reBret Lambert
essentially identical; the only difference being that m_pullup2 is capable of handling mbuf clusters, but called m_pullup for shorter lengths (!). testing dlg@ ok claudio@