From owner-freebsd-net@FreeBSD.ORG Thu Nov 17 09:08:54 2005 Return-Path: X-Original-To: freebsd-net@FreeBSD.org Delivered-To: freebsd-net@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8B35F16A41F for ; Thu, 17 Nov 2005 09:08:54 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (cell.sick.ru [217.72.144.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 676A043D4C for ; Thu, 17 Nov 2005 09:08:53 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.13.3/8.13.3) with ESMTP id jAH98pu1021260 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 17 Nov 2005 12:08:52 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.sick.ru (8.13.3/8.13.1/Submit) id jAH98pqO021259; Thu, 17 Nov 2005 12:08:51 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.sick.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 17 Nov 2005 12:08:50 +0300 From: Gleb Smirnoff To: Kazuaki Oda Message-ID: <20051117090850.GY1647@cell.sick.ru> Mail-Followup-To: Gleb Smirnoff , Kazuaki Oda , freebsd-net@freebsd.org References: <437C21AF.2070107@highway.ne.jp> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="A9z/3b/E4MkkD+7G" Content-Disposition: inline In-Reply-To: <437C21AF.2070107@highway.ne.jp> User-Agent: Mutt/1.5.6i Cc: freebsd-net@FreeBSD.org Subject: Re: carp backup host replies to arp-request X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2005 09:08:54 -0000 --A9z/3b/E4MkkD+7G Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Kazuaki-san, On Thu, Nov 17, 2005 at 03:22:39PM +0900, Kazuaki Oda wrote: K> I have set up 2 routers with FreeBSD 6.0-RELEASE. They are using carp K> interfaces, so one is a master router and another is a backup. K> They seemed to work fine, but a few days later I noticed that not only K> master router but also backup router replies to arp-requests of the K> common IP address from a layer 3 switch. This behavior confuses the K> switch, and sometimes it makes the switch to send a packet addressed K> to the common IP address to the port which is connected to backup router. K> I googled and found that OpenBSD fixed this problem in ip_carp.c 1.62. K> I hope that someone import this into FreeBSD... Can you please confirm, that the attached patch fixes the problem for you? -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE --A9z/3b/E4MkkD+7G Content-Type: text/plain; charset=koi8-r Content-Disposition: attachment; filename="ip_carp.Ox.1.62.diff" Index: ip_carp.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/ip_carp.c,v retrieving revision 1.37 diff -u -r1.37 ip_carp.c --- ip_carp.c 14 Nov 2005 12:50:23 -0000 1.37 +++ ip_carp.c 17 Nov 2005 09:06:17 -0000 @@ -1162,7 +1162,8 @@ TAILQ_FOREACH(vh, &cif->vhif_vrs, sc_list) { if ((SC2IFP(vh)->if_flags & IFF_UP) && (SC2IFP(vh)->if_drv_flags & IFF_DRV_RUNNING) && - ia->ia_ifp == SC2IFP(vh)) { + ia->ia_ifp == SC2IFP(vh) && + vh->sc_state == MASTER) { *enaddr = IF_LLADDR(vh->sc_ifp); CARP_UNLOCK(cif); return (1); @@ -1187,7 +1188,8 @@ if (IN6_ARE_ADDR_EQUAL(taddr, &ifatoia6(ifa)->ia_addr.sin6_addr) && (SC2IFP(vh)->if_flags & IFF_UP) && - (SC2IFP(vh)->if_drv_flags & IFF_DRV_RUNNING)) { + (SC2IFP(vh)->if_drv_flags & IFF_DRV_RUNNING) && + vh->sc_state == MASTER) { CARP_UNLOCK(cif); return (ifa); } --A9z/3b/E4MkkD+7G--