Possible devd bug

Bartłomiej Rutkowski brutkowski at lerkins.com
Fri Jul 20 07:56:08 UTC 2007

Hi all,

I have been playing with OpenOspf lately, and I came to a place, when I needed to ensure that an ethernet interface should always go into DOWN state when it loses its link (physically, for example the switch becames turned off). I have tried to hire the devd daemon to do the job with such small definitions:

notify 100 {
        match "system"          "IFNET";
        match "type"            "LINK_DOWN";
        media-type              "ethernet";
        action "/sbin/ifconfig $subsystem down";
notify 200 {
        match "system"          "IFNET";
        match "type"            "LINK_UP";
        media-type              "ethernet";
        action "/sbin/ifconfig $subsystem up";

And what is happening? Well, basically, when the interface detects that eth cable has been detached, devd triggers and makes it DOWN, which is ok. But, when the card got the cable attached once again (and interface detects the media type and gets ACTIVE state) devd never triggers the second rule, which should get the interface UP again. 
I have tried that with replacing action statements with ones with proper logging actions, and when interface is UP devd gets the proper state changes information. 

Now the question is: why devd doesent receive any information from interfaces in DOWN state? Is that proper behaviour, or a bug? Thanks for any reply, and for your attention.

Bartłomiej Rutkowski <brutkowski at lerkins.com>

More information about the freebsd-questions mailing list