From: Ben Pfaff Date: Mon, 14 Jul 2008 20:53:28 +0000 (-0700) Subject: vconn: Add assertions to vconn_send() to check consistency of outgoing messages. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2dc0a37b6bbba8bccac20478b3bc3d3b9b872b9b;p=openvswitch vconn: Add assertions to vconn_send() to check consistency of outgoing messages. --- diff --git a/lib/vconn.c b/lib/vconn.c index f0615d43..db1cc4c5 100644 --- a/lib/vconn.c +++ b/lib/vconn.c @@ -292,6 +292,8 @@ vconn_send(struct vconn *vconn, struct buffer *msg) { int retval = vconn_connect(vconn); if (!retval) { + assert(msg->size >= sizeof(struct ofp_header)); + assert(((struct ofp_header *) msg->data)->length == htons(msg->size)); if (!VLOG_IS_DBG_ENABLED()) { retval = (vconn->class->send)(vconn, msg); } else {