From 2dc0a37b6bbba8bccac20478b3bc3d3b9b872b9b Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 14 Jul 2008 13:53:28 -0700 Subject: [PATCH] vconn: Add assertions to vconn_send() to check consistency of outgoing messages. --- lib/vconn.c | 2 ++ 1 file changed, 2 insertions(+) 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 { -- 2.30.2