in-band: Fix status checks that could prevent in-band updates
authorJustin Pettit <jpettit@nicira.com>
Thu, 27 Aug 2009 22:13:59 +0000 (15:13 -0700)
committerJustin Pettit <jpettit@nicira.com>
Tue, 1 Sep 2009 21:48:34 +0000 (14:48 -0700)
The method the status callback was using to retrieve the local and
remote MAC addresses pushed back the refresh timer.  If this were done
frequently, it could prevent in-band control from updating its rules.

secchan/in-band.c

index 9b699ca3554eaebca11604af0765e7b882267a76..eb8c33625a9d52f38459112c9ba230a29ed10bc9 100644 (file)
@@ -163,19 +163,15 @@ static void
 in_band_status_cb(struct status_reply *sr, void *in_band_)
 {
     struct in_band *in_band = in_band_;
-    const uint8_t *local_mac;
-    const uint8_t *controller_mac;
 
-    local_mac = get_local_mac(in_band);
-    if (local_mac) {
+    if (!eth_addr_is_zero(in_band->local_mac)) {
         status_reply_put(sr, "local-mac="ETH_ADDR_FMT,
-                         ETH_ADDR_ARGS(local_mac));
+                         ETH_ADDR_ARGS(in_band->local_mac));
     }
 
-    controller_mac = get_controller_mac(in_band);
-    if (controller_mac) {
+    if (!eth_addr_is_zero(in_band->mac)) {
         status_reply_put(sr, "controller-mac="ETH_ADDR_FMT,
-                         ETH_ADDR_ARGS(controller_mac));
+                         ETH_ADDR_ARGS(in_band->mac));
     }
 }