ofp-util: Work on decoding OF1.1 flow_mods.
[openvswitch] / lib / stp.c
index ba273061f0a84b994c3b8b412285b5bc45d0b7ec..ee5c8bcde84527c4509d46231915e56d272eeb8a 100644 (file)
--- a/lib/stp.c
+++ b/lib/stp.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010, 2011 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -1068,6 +1068,8 @@ stp_set_port_state(struct stp_port *p, enum stp_state state)
 static void
 stp_topology_change_detection(struct stp *stp)
 {
+    static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
+
     if (stp_is_root_bridge(stp)) {
         stp->topology_change = true;
         stp_start_timer(&stp->topology_change_timer, 0);
@@ -1077,6 +1079,7 @@ stp_topology_change_detection(struct stp *stp)
     }
     stp->fdb_needs_flush = true;
     stp->topology_change_detected = true;
+    VLOG_INFO_RL(&rl, "%s: detected topology change.", stp->name);
 }
 
 static void
@@ -1368,7 +1371,7 @@ stp_unixctl_tcn(struct unixctl_conn *conn, int argc,
         struct stp *stp = stp_find(argv[1]);
 
         if (!stp) {
-            unixctl_command_reply(conn, 501, "no such stp object");
+            unixctl_command_reply_error(conn, "no such stp object");
             return;
         }
         stp_topology_change_detection(stp);
@@ -1380,5 +1383,5 @@ stp_unixctl_tcn(struct unixctl_conn *conn, int argc,
         }
     }
 
-    unixctl_command_reply(conn, 200, "OK");
+    unixctl_command_reply(conn, "OK");
 }