From owner-cvs-src-old@FreeBSD.ORG Thu Oct 7 00:38:04 2010 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 886CC1065698 for ; Thu, 7 Oct 2010 00:38:04 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 5CBCF8FC0A for ; Thu, 7 Oct 2010 00:38:04 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id o970c4EK034931 for ; Thu, 7 Oct 2010 00:38:04 GMT (envelope-from delphij@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id o970c4kc034930 for cvs-src-old@freebsd.org; Thu, 7 Oct 2010 00:38:04 GMT (envelope-from delphij@repoman.freebsd.org) Message-Id: <201010070038.o970c4kc034930@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to delphij@repoman.freebsd.org using -f From: Xin LI Date: Thu, 7 Oct 2010 00:37:40 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: RELENG_7 Subject: cvs commit: src/sys/netinet ip_carp.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2010 00:38:04 -0000 delphij 2010-10-07 00:37:40 UTC FreeBSD src repository Modified files: (Branch: RELENG_7) sys/netinet ip_carp.c Log: SVN rev 213506 on 2010-10-07 00:37:40Z by delphij MFC r211059: Address an edge condition that we found at work, where the carp(4) interface goes to issue LINK_UP, then LINK_DOWN, then LINK_UP at cold boot. This behavior is not observed when carp(4) interface is created slightly later, when the underlying interface is fully up. Before this change what happen at boot is roughly: - ifconfig creates em0 interface; - ifconfig clones a carp device using em0; (em0's link state is DOWN at this point) - carp state: INIT -> BACKUP [*] - carp state: BACKUP -> MASTER - [Some negotiate between em0 and switch] - em0 kicks up link state change event (em0's link state is now up DOWN at this point) - do_link_state_change() -> carp_carpdev_state() - carp state: MASTER -> INIT (via carp_set_state(sc, INIT)) [+] - carp state: INIT -> BACKUP - carp state: BACKUP -> MASTER At the [*] stage, em0 did not received any broadcast message from other node, and assume our node is the master, thus carp(4) sets the link state to "UP" after becoming a master. At [+], the master status is forcely set to "INIT", then an election is casted, after which our node would actually become a master. We believe that at the [*] stage, the master status should remain as "INIT" since the underlying parent interface's link state is not up. Obtained from: iXsystems, Inc. Reported by: jpaetzel Revision Changes Path 1.52.2.4 +2 -1 src/sys/netinet/ip_carp.c