From: Ben Pfaff Date: Tue, 15 Apr 2008 03:08:14 +0000 (-0700) Subject: Add missing calls to htons/ntohs in accesses to miss_send_len. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9cdc6413504fec18a1aae73884033c8c41a3cfb;p=openvswitch Add missing calls to htons/ntohs in accesses to miss_send_len. Thanks to Justin for pointing out the problem. --- diff --git a/datapath/datapath.c b/datapath/datapath.c index b0f37c20..5cd6c40c 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -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)) diff --git a/datapath/forward.c b/datapath/forward.c index 02a1dd4b..ced0cac6 100644 --- a/datapath/forward.c +++ b/datapath/forward.c @@ -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); } } diff --git a/switch/datapath.c b/switch/datapath.c index 29f5dcf7..0d8ee05f 100644 --- a/switch/datapath.c +++ b/switch/datapath.c @@ -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); } }