Message ID | 1510625498-4821-2-git-send-email-jasowang@redhat.com |
---|---|
State | New |
Headers | show |
Series | [PULL,1/8] net: fix check for number of parameters to -netdev socket | expand |
diff --git a/net/socket.c b/net/socket.c index e6b471c..83a2a31 100644 --- a/net/socket.c +++ b/net/socket.c @@ -695,8 +695,8 @@ int net_init_socket(const Netdev *netdev, const char *name, assert(netdev->type == NET_CLIENT_DRIVER_SOCKET); sock = &netdev->u.socket; - if (sock->has_listen + sock->has_connect + sock->has_mcast + - sock->has_udp > 1) { + if (sock->has_fd + sock->has_listen + sock->has_connect + sock->has_mcast + + sock->has_udp != 1) { error_setg(errp, "exactly one of listen=, connect=, mcast= or udp=" " is required"); return -1;