Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Feb 2009 21:48:19 GMT
From:      Andrew Daugherity <adaugherity@tamu.edu>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/132112: [patch] devd unnecessarily reconfigures carp(4) interfaces
Message-ID:  <200902252148.n1PLmJrT051436@www.freebsd.org>
Resent-Message-ID: <200902252150.n1PLo17v003569@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         132112
>Category:       bin
>Synopsis:       [patch] devd unnecessarily reconfigures carp(4) interfaces
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 25 21:50:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Andrew Daugherity
>Release:        7.1
>Organization:
Texas A&M University
>Environment:
FreeBSD imslb4.tamu.edu 7.1-RELEASE-p1 FreeBSD 7.1-RELEASE-p1 #0: Wed Jan 14 15:03:53 CST 2009     root@imslb4.tamu.edu:/usr/obj/usr/src/sys/IMS  amd64

>Description:
While debugging some other problems with carp, I discovered that devd reconfigures carp interfaces after they have already been brought up by the netif rc script.  This is unnecessary and prints useless error messages, and due to the bug in kern/132107, breaks my carp setup.

Looking at the console scrollback when rc_debug is enabled, I see that the following happens:
* '/etc/rc.d/netif start' brings up network interfaces, including carp interfaces
* some time later, devd is started via '/etc/rc.d/devd start'
* devd calls pccard_ether on interfaces it thinks aren't "up", including carp interfaces -- e.g. '/etc/pccard_ether carp0 start'
* pccard_ether calls '/etc/rc.d/netif start carp0' (which then causes the problem in kern/132107)
* pccard_ether does the equivalent of '/etc/rc.d/routing static'; this prints error messages to the console about the routes already existing
>How-To-Repeat:
Configure a carp interface as described in the handbook:
cloned_interfaces="carp0"
ifconfig_carp0="vhid 16 $carp_advskew pass XXXXXXXX 10.95.0.1/21"

Note in the console output that carp0 is configured at the same time as other ethernet interfaces, and then configured again some time later, followed by the routing error messages.  If you set rc_debug="YES" you will see the execution trace described above.
>Fix:
Copy into devd.conf:
====
# don't have devd call network_start on carp interfaces; for some reason this
#   loses the advskew setting (kern/132107) and is entirely superfluous.

notify 100 {
	match "system" "IFNET";
	match "subsystem" "carp[0-9]+";
	match "type"	"ATTACH";
	action "echo devd called on $subsystem, type $type";
};
====

There's probably a better action line to use than the echo statement, but the important thing is that it overrides the default attach behavior (action "/etc/pccard_ether $subsystem start").

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902252148.n1PLmJrT051436>