projects
/
swifty.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e3bff5f
)
If port 0 is provided for binding, bind the socket to the next free port from the...
author
Adrian Bondrescu
<adi.bondrescu@gmail.com>
Sun, 8 Jul 2012 18:04:00 +0000
(21:04 +0300)
committer
Razvan Deaconescu
<razvan.deaconescu@cs.pub.ro>
Mon, 18 Mar 2013 16:26:52 +0000
(18:26 +0200)
src/kernel/mptp.c
patch
|
blob
|
history
diff --git
a/src/kernel/mptp.c
b/src/kernel/mptp.c
index
e7c3396
..
513a95f
100644
(file)
--- a/
src/kernel/mptp.c
+++ b/
src/kernel/mptp.c
@@
-97,6
+97,8
@@
static int mptp_bind(struct socket *sock, struct sockaddr *addr, int addr_len)
log_debug("Bind received port=%u (network order)\n", mptp_addr->dests[0].port);
port = ntohs(mptp_addr->dests[0].port);
+ if (port == 0)
+ port = get_next_free_port();
if (unlikely(port == 0 || port >= MAX_MPTP_PORT)) {
log_error("Invalid value for sockaddr port (%u)\n", port);