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 b0f37c206cd4f2766c1910a70964ee1411afe702..5cd6c40c283e9b0ea1b1f256bf3b7e05301a65ae 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 02a1dd4bb00567114a1b51d3f44160511b1247f5..ced0cac62db75577ddd407fac29c0795c561da21 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 29f5dcf7d2c4e1f0247dfffe0f0bc9a6b45936ff..0d8ee05f564d54e778b1ca4429c0279f2ed03206 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);
     }
 }