Add missing calls to htons/ntohs in accesses to miss_send_len.
authorBen Pfaff <blp@cs.stanford.edu>
Tue, 15 Apr 2008 03:08:14 +0000 (20:08 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 15 Apr 2008 16:56:36 +0000 (09:56 -0700)
Thanks to Justin for pointing out the problem.

datapath/datapath.c
datapath/forward.c
switch/datapath.c

index b0f37c2..5cd6c40 100644 (file)
@@ -240,7 +240,7 @@ static int new_dp(int dp_idx)
 #endif
 
        dp->config.flags = 0;
-       dp->config.miss_send_len = OFP_DEFAULT_MISS_SEND_LEN;
+       dp->config.miss_send_len = htons(OFP_DEFAULT_MISS_SEND_LEN);
 
        dp->dp_task = kthread_run(dp_maint_func, dp, "dp%d", dp_idx);
        if (IS_ERR(dp->dp_task))
index 02a1dd4..ced0cac 100644 (file)
@@ -44,7 +44,7 @@ void fwd_port_input(struct sw_chain *chain, struct sk_buff *skb, int in_port)
                                flow->actions, flow->n_actions);
        } else {
                dp_output_control(chain->dp, skb, fwd_save_skb(skb), 
-                                 chain->dp->config.miss_send_len,
+                                 ntohs(chain->dp->config.miss_send_len),
                                  OFPR_NO_MATCH);
        }
 }
index 29f5dcf..0d8ee05 100644 (file)
@@ -198,7 +198,7 @@ dp_new(struct datapath **dp_, uint64_t dpid, struct rconn *rconn)
 
     list_init(&dp->port_list);
     dp->config.flags = 0;
-    dp->config.miss_send_len = OFP_DEFAULT_MISS_SEND_LEN;
+    dp->config.miss_send_len = htons(OFP_DEFAULT_MISS_SEND_LEN);
     *dp_ = dp;
     return 0;
 }
@@ -762,7 +762,7 @@ void fwd_port_input(struct datapath *dp, struct buffer *buffer, int in_port)
         execute_actions(dp, buffer, in_port, &key,
                         flow->actions, flow->n_actions);
     } else {
-        dp_output_control(dp, buffer, in_port, dp->config.miss_send_len,
+        dp_output_control(dp, buffer, in_port, ntohs(dp->config.miss_send_len),
                           OFPR_NO_MATCH);
     }
 }