Skip to contentSkip to conversation

nbd: correctly manage default port

PATCH Applied Laurent Vivier 2 participants 2 messages Sep 17, 2010 – Sep 20, 2010 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nbd: correctly manage default port

block/nbd.c: use default port number when none is specified
qemu-nbd.c:  use IANA-assigned port number: 10809
---
 block/nbd.c |    2 --
 qemu-nbd.c  |    6 +++---
 2 files changed, 3 insertions(+), 5 deletions(-)
block/nbd.c +0 -2
index 5e9d6cb..c8dc763 100644
@@ -95,8 +95,6 @@ static int nbd_open(BlockDriverState *bs, const char* filename, int flags)
             if (r == p) {
                 goto out;
             }
-        } else if (name == NULL) {
-            goto out;
         }
 
         sock = tcp_socket_outgoing(hostname, port);
qemu-nbd.c +3 -3
index 91b569f..2c7cc11 100644
@@ -44,7 +44,7 @@ static void usage(const char *name)
 "Usage: %s [OPTIONS] FILE\n"
 "QEMU Disk Network Block Device Server\n"
 "\n"
-"  -p, --port=PORT      port to listen on (default `1024')\n"
+"  -p, --port=PORT      port to listen on (default `%d')\n"
 "  -o, --offset=OFFSET  offset into the image\n"
 "  -b, --bind=IFACE     interface to bind to (default `0.0.0.0')\n"
 "  -k, --socket=PATH    path to the unix socket\n"
@@ -62,7 +62,7 @@ static void usage(const char *name)
 "  -V, --version        output version information and exit\n"
 "\n"
 "Report bugs to <[email protected]>\n"
-    , name, "DEVICE");
+    , name, NBD_DEFAULT_PORT, "DEVICE");
 }
 
 static void version(const char *name)
@@ -188,7 +188,7 @@ int main(int argc, char **argv)
     bool readonly = false;
     bool disconnect = false;
     const char *bindto = "0.0.0.0";
-    int port = 1024;
+    int port = NBD_DEFAULT_PORT;
     struct sockaddr_in addr;
     socklen_t addr_len = sizeof(addr);
     off_t fd_size;
Signature · 1 line
1.7.0.4
Applied
#1 lore raw

Am 17.09.2010 20:37, schrieb Laurent Vivier:

Quoted 4 lines
block/nbd.c: use default port number when none is specified
qemu-nbd.c:  use IANA-assigned port number: 10809

Thanks, applied to the block branch.

Kevin