From f57b5979f4fa890c62537677c27c8b89434d82c3 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 4 Apr 2008 16:02:46 -0700 Subject: [PATCH] Fix bug in vconn-tcp, vconn-ssl that prevented minimum-length OpenFlow packets from being received correctly. --- lib/vconn-ssl.c | 5 +++++ lib/vconn-tcp.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/lib/vconn-ssl.c b/lib/vconn-ssl.c index 30d8caf6..2bdcfb1b 100644 --- a/lib/vconn-ssl.c +++ b/lib/vconn-ssl.c @@ -361,6 +361,11 @@ again: return EPROTO; } want_bytes = length - rx->size; + if (!want_bytes) { + *bufferp = rx; + sslv->rxbuf = NULL; + return 0; + } } buffer_reserve_tailroom(rx, want_bytes); diff --git a/lib/vconn-tcp.c b/lib/vconn-tcp.c index 1fe5919f..5f468ae4 100644 --- a/lib/vconn-tcp.c +++ b/lib/vconn-tcp.c @@ -191,6 +191,11 @@ again: return EPROTO; } want_bytes = length - rx->size; + if (!want_bytes) { + *bufferp = rx; + tcp->rxbuf = NULL; + return 0; + } } buffer_reserve_tailroom(rx, want_bytes); -- 2.30.2