Prevent switch implementations from complaining about echo-reply messages.
authorBen Pfaff <blp@nicira.com>
Tue, 15 Jul 2008 19:43:59 +0000 (12:43 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 15 Jul 2008 19:43:59 +0000 (12:43 -0700)
Thanks to Reid Price <reid@nicira.com> for reporting the issue (which
only caused spurious warning messages).

datapath/forward.c
switch/datapath.c

index 4c43cd9..ac04446 100644 (file)
@@ -361,6 +361,13 @@ recv_echo_request(struct sw_chain *chain, const struct sender *sender,
        return dp_send_echo_reply(chain->dp, sender, msg);
 }
 
+static int
+recv_echo_reply(struct sw_chain *chain, const struct sender *sender,
+                 const void *msg) 
+{
+       return 0;
+}
+
 static int
 add_flow(struct sw_chain *chain, const struct ofp_flow_mod *ofm)
 {
@@ -495,6 +502,10 @@ fwd_control_input(struct sw_chain *chain, const struct sender *sender,
                        sizeof (struct ofp_header),
                        recv_echo_request,
                },
+               [OFPT_ECHO_REPLY] = {
+                       sizeof (struct ofp_header),
+                       recv_echo_reply,
+               },
        };
 
        const struct openflow_packet *pkt;
index 487677a..3d639ff 100644 (file)
@@ -1501,6 +1501,13 @@ recv_echo_request(struct datapath *dp, const struct sender *sender,
     return send_openflow_buffer(dp, make_echo_reply(oh), sender);
 }
 
+static int
+recv_echo_reply(struct datapath *dp UNUSED, const struct sender *sender UNUSED,
+                  const void *oh UNUSED)
+{
+    return 0;
+}
+
 /* 'msg', which is 'length' bytes long, was received from the control path.
  * Apply it to 'chain'. */
 int
@@ -1545,6 +1552,10 @@ fwd_control_input(struct datapath *dp, const struct sender *sender,
             sizeof (struct ofp_header),
             recv_echo_request,
         },
+        [OFPT_ECHO_REPLY] = {
+            sizeof (struct ofp_header),
+            recv_echo_reply,
+        },
     };
 
     const struct openflow_packet *pkt;