From: Justin Pettit Date: Mon, 13 Oct 2008 21:43:29 +0000 (-0700) Subject: When sending error messages, set the length properly. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14c0252da769d6f8aac86f31c65d76b3384a37c0;p=openvswitch When sending error messages, set the length properly. --- diff --git a/datapath/forward.c b/datapath/forward.c index 6a7fcb74..f28ac2b9 100644 --- a/datapath/forward.c +++ b/datapath/forward.c @@ -349,7 +349,7 @@ recv_vendor(struct sw_chain *chain, const struct sender *sender, if (net_ratelimit()) printk("Uknown vendor: %#x\n", ntohl(ovh->vendor)); dp_send_error_msg(chain->dp, sender, OFPET_BAD_REQUEST, - OFPBRC_BAD_VENDOR, msg, ovh->header.length); + OFPBRC_BAD_VENDOR, msg, ntohs(ovh->header.length)); return -EINVAL; } } diff --git a/datapath/nx_msg.c b/datapath/nx_msg.c index 19bdefde..b8d7f13f 100644 --- a/datapath/nx_msg.c +++ b/datapath/nx_msg.c @@ -33,7 +33,7 @@ nx_recv_msg(struct sw_chain *chain, const struct sender *sender, default: dp_send_error_msg(chain->dp, sender, OFPET_BAD_REQUEST, - OFPBRC_BAD_SUBTYPE, msg, nh->header.length); + OFPBRC_BAD_SUBTYPE, msg, ntohs(nh->header.length)); return -EINVAL; }