[ovs-dev] [tests 09/22] netdev-dummy: Drop "nobody listened" reply from netdev-dummy/receive.

Ben Pfaff blp at nicira.com
Fri Oct 26 00:02:05 UTC 2012


Ethan pointed out that this wasn't very useful.

Signed-off-by: Ben Pfaff <blp at nicira.com>
---
 lib/netdev-dummy.c    |   16 +++-------------
 tests/ofproto-dpif.at |    6 ++----
 2 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c
index 3aaace3..9b9e251 100644
--- a/lib/netdev-dummy.c
+++ b/lib/netdev-dummy.c
@@ -417,24 +417,19 @@ eth_from_packet_or_flow(const char *s)
     return packet;
 }
 
-static int
+static void
 netdev_dummy_queue_packet(struct netdev_dev_dummy *dummy_dev,
                           const void *data, size_t size)
 {
     struct netdev_dummy *dev;
-    int n_listeners;
 
-    n_listeners = 0;
     LIST_FOR_EACH (dev, node, &dummy_dev->devs) {
         if (dev->listening && dev->recv_queue_len < NETDEV_DUMMY_MAX_QUEUE) {
             struct ofpbuf *packet = ofpbuf_clone_data(data, size);
             list_push_back(&dev->recv_queue, &packet->list_node);
             dev->recv_queue_len++;
-            n_listeners++;
         }
     }
-
-    return n_listeners;
 }
 
 static void
@@ -461,16 +456,11 @@ netdev_dummy_receive(struct unixctl_conn *conn,
             return;
         }
 
-        n_listeners += netdev_dummy_queue_packet(dummy_dev,
-                                                 packet->data, packet->size);
+        netdev_dummy_queue_packet(dummy_dev, packet->data, packet->size);
         ofpbuf_delete(packet);
     }
 
-    if (!n_listeners) {
-        unixctl_command_reply(conn, "packets queued but nobody listened");
-    } else {
-        unixctl_command_reply(conn, "success");
-    }
+    unixctl_command_reply(conn, NULL);
 }
 
 static void
diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index bc2362d..79b3c55 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -1168,8 +1168,7 @@ AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
 # flow stats updates are mainly what implements the fin_timeout
 # feature, we warp forward a couple of times to ensure that flow stats
 # run before re-checking the flow table.)
-AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f908004500003c2e2440004006465dac11370dac11370b828b0016751e267b00000000a00216d017360000020405b40402080a2d25085f0000000001030307], [0], [success
-])
+AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f908004500003c2e2440004006465dac11370dac11370b828b0016751e267b00000000a00216d017360000020405b40402080a2d25085f0000000001030307])
 AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
 warped
 ])
@@ -1178,8 +1177,7 @@ AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
  n_packets=1, n_bytes=74, idle_timeout=60, actions=fin_timeout(idle_timeout=5)
 ])
 # Check that a TCP FIN packet does change the timeout.
-AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f90800451000342e3e40004006463bac11370dac11370b828b0016751e319dfc96399b801100717ae800000101080a2d250a9408579588], [0], [success
-])
+AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f90800451000342e3e40004006463bac11370dac11370b828b0016751e319dfc96399b801100717ae800000101080a2d250a9408579588])
 AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
 warped
 ])
-- 
1.7.2.5




More information about the dev mailing list