From d39401f28c7c2da45253889a257acf716ea3fbef Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Fri, 22 Nov 2019 13:42:03 -0600 Subject: [PATCH] nbd: Forbid port= when using uri= When connecting as a client via a URI, the port string was inadvertently ignored instead of diagnosed as spurious. Fixes: 5a2573840f Signed-off-by: Eric Blake --- plugins/nbd/nbd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/nbd/nbd.c b/plugins/nbd/nbd.c index 3215636c..d020beec 100644 --- a/plugins/nbd/nbd.c +++ b/plugins/nbd/nbd.c @@ -222,6 +222,10 @@ nbdplug_config_complete (void) else if (uri) { struct nbd_handle *nbd = nbd_create (); + if (port) { + nbdkit_error ("cannot mix TCP hostname/port and URI parameters"); + return -1; + } if (!nbd) { nbdkit_error ("unable to query libnbd details: %s", nbd_get_error ()); return -1; -- 2.11.4.GIT