noip.c (do_implicit_bind): Set wildcard port if we find a match.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 4 Jul 2018 17:39:52 +0000 (18:39 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 4 Jul 2018 17:39:52 +0000 (18:39 +0100)
Otherwise it's left uninitialized, and there is sadness.

noip.c

diff --git a/noip.c b/noip.c
index b9c040b..8dac7e4 100644 (file)
--- a/noip.c
+++ b/noip.c
@@ -1128,6 +1128,7 @@ static int do_implicit_bind(int sk, const struct sockaddr *sa, unsigned f)
       D( fprintf(stderr, "noip(%d): match!\n", pid); )
       addr.sa.sa_family = sa->sa_family;
       ipaddr_to_sockaddr(&addr.sa, &i->bindaddr);
+      port_to_sockaddr(&addr.sa, 0);
       goto found;
     }
   }