On 02/26/2010 01:01 PM, Li Zhao wrote:
Actually the configuration is very simple to reproduce the problem on Linux.

With the attached patch (on top of my tree), your config starts w/out
crashing, but I don't know that it's actually doing anything useful.

It certainly complains about adding a MAC that already exists and then
later trying to remove it when it's the only MAC around.  I just made
the errors non-fatal, but probably some logic in vrrp is busted
and should be fixed.

I can't see how the VrrpPacket::finalize() method ever failed to
assert that assert that I commented out, but surely someone successfully
got VRRP working at one time?

Thanks,
Ben

--
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com

diff --git a/fea/xrl_fea_target.cc b/fea/xrl_fea_target.cc
index d9fe8cb..5b1a717 100644
--- a/fea/xrl_fea_target.cc
+++ b/fea/xrl_fea_target.cc
@@ -2136,9 +2136,12 @@ XrlFeaTarget::add_remove_mac(bool add, const string& 
ifname, const Mac& mac,
        // Sanity check
        if (macs.find(mac) != macs.end() || current_mac == mac) {
            error_msg = c_format("Cannot add MAC address %s on interface %s: "
-                                "MAC already added",
-                                mac.str().c_str(), ifname.c_str());
-           return (XORP_ERROR);
+                                "MAC already exists, current_mac: %s  mac 
count: %i",
+                                mac.str().c_str(), ifname.c_str(), 
current_mac.str().c_str(),
+                                (int)(macs.size()));
+           // This doesn't seem so bad to me...going to log it and pass back 
success. --Ben
+           XLOG_WARNING("%s", error_msg.c_str());
+           return XORP_OK;
        }
 
        if (macs.size())
@@ -2171,7 +2174,8 @@ XrlFeaTarget::add_remove_mac(bool add, const string& 
ifname, const Mac& mac,
                error_msg = c_format("Cannot remove MAC address %s "
                                     "on interface %s: last address",
                                     mac.str().c_str(), ifname.c_str());
-               return (XORP_ERROR);
+               XLOG_WARNING("%s", error_msg.c_str());
+               return XORP_OK;
            }
            candidate_mac = *(macs.begin());
 
diff --git a/vrrp/vrrp_packet.cc b/vrrp/vrrp_packet.cc
index e5ea6cb..86e078b 100644
--- a/vrrp/vrrp_packet.cc
+++ b/vrrp/vrrp_packet.cc
@@ -169,8 +169,9 @@ VrrpPacket::finalize()
     _ip.compute_checksum();
 
     XLOG_ASSERT(size <= VRRP_MAX_PACKET_SIZE);
-    XLOG_ASSERT(_data.size() == _data.capacity() 
-                && _data.size() == VRRP_MAX_PACKET_SIZE);
+    // I don't see how this assert can possibly be correct! --Ben
+    //XLOG_ASSERT(_data.size() == _data.capacity() 
+    //            && _data.size() == VRRP_MAX_PACKET_SIZE);
 
     _data.resize(size);
 }
_______________________________________________
Xorp-hackers mailing list
[email protected]
http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers

Reply via email to