Don't abort if TUNSETSNDBUF fails where no sndbuf= arg is supplied
authorMark McLoughlin <markmc@redhat.com>
Wed, 1 Jul 2009 15:45:30 +0000 (16:45 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Thu, 9 Jul 2009 21:58:07 +0000 (16:58 -0500)
If no tap,sndbuf= arg is supplied, we use a default value. If
TUNSETSNDBUF fails in this case, we should not abort.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
net.c

diff --git a/net.c b/net.c
index 49f4016cf857077e798b91e306a037f44d24f6b2..1507f3769addc1c15814d06bfd0d813dd5f80024 100644 (file)
--- a/net.c
+++ b/net.c
@@ -1416,7 +1416,7 @@ static void tap_set_sndbuf(TAPState *s, const char *sndbuf_str, Monitor *mon)
         sndbuf = INT_MAX;
     }
 
-    if (ioctl(s->fd, TUNSETSNDBUF, &sndbuf) == -1) {
+    if (ioctl(s->fd, TUNSETSNDBUF, &sndbuf) == -1 && sndbuf_str) {
         config_error(mon, "TUNSETSNDBUF ioctl failed: %s\n",
                      strerror(errno));
     }