The OpenBSD PF-MIB stuff is incredibly useful -- especially the PF-MIB:CarpIFTable objects. Thanks to all involved with that. I've also had success with Net-SNMP 5.4 (opti@'s version) with those patches; will try to port them to other PF-enabled OSs soon.

In the mean time, I want to keep going with additional debugging and monitoring functionality in CARP. Here is a small patch that is incredibly useful for troubleshooting and debugging cumbersome issues. Silence is killer, especially when you turn on "logging" and receive nothing:

This adds functionality similar to "debug standby" in Cisco-land:

*Mar 1 02:56:13: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet3/0, changed state to up
*Mar 1 02:56:14: SB0: FastEthernet3/0 state Listen -> Init
*Mar 1 02:56:20: SB0: FastEthernet3/0 state Init -> Listen
*Mar 1 02:56:30: SB0: FastEthernet3/0 state Listen -> Speak
*Mar 1 02:56:40: SB0: FastEthernet3/0 state Speak -> Standby
*Mar 1 02:56:41: SB0: FastEthernet3/0 state Standby -> Active

With this patch:

# ifconfig carp40 vhid 40 carpdev pcn0 pass foo up

Jun 20 03:05:46 vmware-openbsd-lab /bsd: carp40: state transition from: MASTER 
-> to: INIT
Jun 20 03:05:46 vmware-openbsd-lab /bsd: carp40: state transition from: INIT -> 
to: BACKUP
Jun 20 03:05:46 vmware-openbsd-lab /bsd: carp40: state transition from: BACKUP 
-> to: INIT
Jun 20 03:05:46 vmware-openbsd-lab /bsd: carp40: state transition from: INIT -> 
to: BACKUP
Jun 20 03:05:46 vmware-openbsd-lab /bsd: carp40: state transition from: BACKUP 
-> to: INIT
Jun 20 03:05:46 vmware-openbsd-lab /bsd: carp40: state transition from: INIT -> 
to: BACKUP
Jun 20 03:05:49 vmware-openbsd-lab /bsd: carp40: state transition from: BACKUP 
-> to: MASTER


I think there are probably ~20 other CARP_LOG() calls that could improve the experience, but this is a good place to start and we'll move on from there.

Against the OPENBSD_4_1 tree (rev 1.132.2.1):

# cvs diff -u ip_carp.c
Index: ip_carp.c
===================================================================
RCS file: /cvs/src/sys/netinet/ip_carp.c,v
retrieving revision 1.132.2.1
diff -u -r1.132.2.1 ip_carp.c
--- ip_carp.c   2007/04/30 20:39:44     1.132.2.1
+++ ip_carp.c   2007/06/20 07:03:15
@@ -2111,6 +2111,8 @@
 void
 carp_set_state(struct carp_softc *sc, int state)
 {
+       static const char *carp_states[] = { CARP_STATES };
+ CARP_LOG(sc, ("state transition from: %s -> to: %s", carp_states[sc->sc_state], carp_states[state]));
        if (sc->sc_state == state)
                return;



l8*
        -lava (Brian A. Seklecki - Pittsburgh, PA, USA)
               http://www.spiritual-machines.org/

    "Guilty? Yeah. But he knows it. I mean, you're guilty.
    You just don't know it. So who's really in jail?"
    ~Maynard James Keenan

Reply via email to