When sending error messages, set the length properly.
authorJustin Pettit <jpettit@nicira.com>
Mon, 13 Oct 2008 21:43:29 +0000 (14:43 -0700)
committerJustin Pettit <jpettit@nicira.com>
Mon, 13 Oct 2008 21:52:47 +0000 (14:52 -0700)
datapath/forward.c
datapath/nx_msg.c

index 6a7fcb74f7b93f3d55a0cd6ad8a6c4707972a6e1..f28ac2b9606e754216833ab6c4d022c8afd97585 100644 (file)
@@ -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;
        }
 }
index 19bdefde81185629ca6c0b31b85e0f8b6788f0d0..b8d7f13fa4f1abc1fb93b7d6999ac530fbba60c4 100644 (file)
@@ -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;
        }