Re: svn commit: r228571 - in head: . lib/libc/net sbin/ifconfig share/man/man4 sys/net sys/netinet sys/netinet6 sys/sys
On 17 December 2011 01:16, Gleb Smirnoff gleb...@freebsd.org wrote: Author: glebius Date: Fri Dec 16 12:16:56 2011 New Revision: 228571 URL: http://svn.freebsd.org/changeset/base/228571 Log: A major overhaul of the CARP implementation. The ip_carp.c was started from scratch, copying needed functionality from the old implemenation on demand, with a thorough review of all code. The main change is that interface layer has been removed from the CARP. Now redundant addresses are configured exactly on the interfaces, they run on. This commit seems to have a mistake in the PACKET_TAG_CARP mtag handling. carp_macmatch6() places the ifp pointer on the tag while carp_output() dereferences it as a softc. Andrew ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r228571 - in head: . lib/libc/net sbin/ifconfig share/man/man4 sys/net sys/netinet sys/netinet6 sys/sys
Author: glebius Date: Fri Dec 16 12:16:56 2011 New Revision: 228571 URL: http://svn.freebsd.org/changeset/base/228571 Log: A major overhaul of the CARP implementation. The ip_carp.c was started from scratch, copying needed functionality from the old implemenation on demand, with a thorough review of all code. The main change is that interface layer has been removed from the CARP. Now redundant addresses are configured exactly on the interfaces, they run on. The CARP configuration itself is, as before, configured and read via SIOCSVH/SIOCGVH ioctls. A new prefix created with SIOCAIFADDR or SIOCAIFADDR_IN6 may now be configured to a particular virtual host id, which makes the prefix redundant. ifconfig(8) semantics has been changed too: now one doesn't need to clone carpXX interface, he/she should directly configure a vhid on a Ethernet interface. To supply vhid data from the kernel to an application the getifaddrs(8) function had been changed to pass ifam_data with each address. [1] The new implementation definitely closes all PRs related to carp(4) being an interface, and may close several others. It also allows to run a single redundant IP per interface. Big thanks to Bjoern Zeeb for his help with inet6 part of patch, for idea on using ifam_data and for several rounds of reviewing! PR: kern/117000, kern/126945, kern/126714, kern/120130, kern/117448 Reviewed by: bz Submitted by: bz [1] Modified: head/UPDATING head/lib/libc/net/getifaddrs.c head/sbin/ifconfig/af_inet.c head/sbin/ifconfig/af_inet6.c head/sbin/ifconfig/ifcarp.c head/sbin/ifconfig/ifconfig.8 head/sbin/ifconfig/ifconfig.c head/sbin/ifconfig/ifconfig.h head/share/man/man4/carp.4 head/sys/net/if.c head/sys/net/if.h head/sys/net/if_ethersubr.c head/sys/net/if_types.h head/sys/net/if_var.h head/sys/net/rtsock.c head/sys/netinet/if_ether.c head/sys/netinet/if_ether.h head/sys/netinet/in.c head/sys/netinet/in_var.h head/sys/netinet/ip_carp.c head/sys/netinet/ip_carp.h head/sys/netinet6/in6.c head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_var.h head/sys/netinet6/nd6.c head/sys/netinet6/nd6_nbr.c head/sys/sys/param.h Modified: head/UPDATING == --- head/UPDATING Fri Dec 16 11:52:33 2011(r228570) +++ head/UPDATING Fri Dec 16 12:16:56 2011(r228571) @@ -22,6 +22,17 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20111215: + The carp(4) facility has been changed significantly. Configuration + of the CARP protocol via ifconfig(8) has changed, as well as format + of CARP events submitted to devd(8) has changed. See manual pages + for more information. The arpbalance feature of carp(4) is currently + not supported anymore. + + Size of struct in_aliasreq, struct in6_aliasreq has changed. User + utilities using SIOCAIFADDR, SIOCAIFADDR_IN6, e.g. ifconfig(8), + need to be recompiled. + 2022: The acpi_wmi(4) status device /dev/wmistat has been renamed to /dev/wmistat0. Modified: head/lib/libc/net/getifaddrs.c == --- head/lib/libc/net/getifaddrs.c Fri Dec 16 11:52:33 2011 (r228570) +++ head/lib/libc/net/getifaddrs.c Fri Dec 16 12:16:56 2011 (r228571) @@ -76,7 +76,7 @@ __FBSDID($FreeBSD$); #defineHAVE_IFM_DATA #endif -#if_BSDI_VERSION = 199802 +#if(_BSDI_VERSION = 199802) || (__FreeBSD_version = 103) /* ifam_data is very specific to recent versions of bsdi */ #defineHAVE_IFAM_DATA #endif Modified: head/sbin/ifconfig/af_inet.c == --- head/sbin/ifconfig/af_inet.cFri Dec 16 11:52:33 2011 (r228570) +++ head/sbin/ifconfig/af_inet.cFri Dec 16 12:16:56 2011 (r228571) @@ -84,8 +84,11 @@ in_status(int s __unused, const struct i if (ifa-ifa_flags IFF_BROADCAST) { sin = (struct sockaddr_in *)ifa-ifa_broadaddr; if (sin != NULL sin-sin_addr.s_addr != 0) - printf(broadcast %s, inet_ntoa(sin-sin_addr)); + printf(broadcast %s , inet_ntoa(sin-sin_addr)); } + + print_vhid(ifa, ); + putchar('\n'); } Modified: head/sbin/ifconfig/af_inet6.c == --- head/sbin/ifconfig/af_inet6.c Fri Dec 16 11:52:33 2011 (r228570) +++ head/sbin/ifconfig/af_inet6.c Fri Dec 16 12:16:56 2011 (r228571) @@ -307,6 +307,8 @@ in6_status(int s __unused, const struct printf(infty ); } + print_vhid(ifa,
Re: svn commit: r228571 - in head: . lib/libc/net sbin/ifconfig share/man/man4 sys/net sys/netinet sys/netinet6 sys/sys
On 12/16/11, Gleb Smirnoff gleb...@freebsd.org wrote: Author: glebius Date: Fri Dec 16 12:16:56 2011 New Revision: 228571 URL: http://svn.freebsd.org/changeset/base/228571 Log: A major overhaul of the CARP implementation. The ip_carp.c was started from scratch, copying needed functionality from the old implemenation on demand, with a thorough review of all code. The main change is that interface layer has been removed from the CARP. Now redundant addresses are configured exactly on the interfaces, they run on. The CARP configuration itself is, as before, configured and read via SIOCSVH/SIOCGVH ioctls. A new prefix created with SIOCAIFADDR or SIOCAIFADDR_IN6 may now be configured to a particular virtual host id, which makes the prefix redundant. ifconfig(8) semantics has been changed too: now one doesn't need to clone carpXX interface, he/she should directly configure a vhid on a Ethernet interface. To supply vhid data from the kernel to an application the getifaddrs(8) function had been changed to pass ifam_data with each address. [1] The new implementation definitely closes all PRs related to carp(4) being an interface, and may close several others. It also allows to run a single redundant IP per interface. Big thanks to Bjoern Zeeb for his help with inet6 part of patch, for idea on using ifam_data and for several rounds of reviewing! PR: kern/117000, kern/126945, kern/126714, kern/120130, kern/117448 Reviewed by:bz Submitted by: bz [1] Modified: head/UPDATING head/lib/libc/net/getifaddrs.c head/sbin/ifconfig/af_inet.c head/sbin/ifconfig/af_inet6.c head/sbin/ifconfig/ifcarp.c head/sbin/ifconfig/ifconfig.8 head/sbin/ifconfig/ifconfig.c head/sbin/ifconfig/ifconfig.h head/share/man/man4/carp.4 head/sys/net/if.c head/sys/net/if.h head/sys/net/if_ethersubr.c head/sys/net/if_types.h head/sys/net/if_var.h head/sys/net/rtsock.c head/sys/netinet/if_ether.c head/sys/netinet/if_ether.h head/sys/netinet/in.c head/sys/netinet/in_var.h head/sys/netinet/ip_carp.c head/sys/netinet/ip_carp.h head/sys/netinet6/in6.c head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_var.h head/sys/netinet6/nd6.c head/sys/netinet6/nd6_nbr.c head/sys/sys/param.h Modified: head/UPDATING == == --- head/share/man/man4/carp.4Fri Dec 16 11:52:33 2011 (r228570) +++ head/share/man/man4/carp.4Fri Dec 16 12:16:56 2011 (r228571) @@ -1,6 +1,7 @@ .\ $OpenBSD: carp.4,v 1.16 2004/12/07 23:41:35 jmc Exp $ .\ .\ Copyright (c) 2003, Ryan McBride. All rights reserved. +.\ Copyright (c) 2011, Gleb Smirnoff gleb...@freebsd.org .\ .\ Redistribution and use in source and binary forms, with or without .\ modification, are permitted provided that the following conditions @@ -138,36 +131,36 @@ Value of 0 means that preemption is not problems are detected. Every problem increments suppression counter. .El -.Sh ARP level load balancing -The -.Nm -has limited abilities for load balancing the incoming connections -between hosts in Ethernet network. -For load balancing operation, one needs several CARP interfaces that -are configured to the same IP address, but to a different VHIDs. -Once an ARP request is received, the CARP protocol will use a hashing -function against the source IP address in the ARP request to determine -which VHID should this request belong to. -If the corresponding CARP interface is in master state, the ARP request -will be replied, otherwise it will be ignored. -See the -.Sx EXAMPLES -section for a practical example of load balancing. -.Pp -The ARP load balancing has some limitations. -First, ARP balancing only works on the local network segment. -It cannot balance traffic that crosses a router, because the -router itself will always be balanced to the same virtual host. -Second, ARP load balancing can lead to asymmetric routing -of incoming and outgoing traffic, and thus combining it with -.Xr pfsync 4 -is dangerous, because this creates a race condition between -balanced routers and a host they are serving. -Imagine an incoming packet creating state on the first router, being -forwarded to its destination, and destination replying faster -than the state information is packed and synced with the second router. -If the reply would be load balanced to second router, it will be -dropped due to no state. +.\.Sh ARP level load balancing +.\The +.\.Nm +.\has limited abilities for load balancing the incoming connections +.\between hosts in Ethernet network. +.\For load balancing operation, one needs several CARP interfaces that +.\are configured to the same IP address, but to a different vhids. +.\Once an ARP request is received, the CARP protocol will use a hashing
Re: svn commit: r228571 - in head: . lib/libc/net sbin/ifconfig share/man/man4 sys/net sys/netinet sys/netinet6 sys/sys
Ben, On Fri, Dec 16, 2011 at 12:08:17PM -0500, Ben Kaduk wrote: B Hi Gleb, B B Perhaps the man page portions that were commented out should just be B removed entirely? They may be resurrected if arpbalancing is implemented again. -- Totus tuus, Glebius. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org