noip.c (do_implicit_bind): Handle `SAME' impbind entries properly.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 4 Jul 2018 17:40:30 +0000 (18:40 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 4 Jul 2018 17:40:30 +0000 (18:40 +0100)
For some reason this just got left out.

noip.c

diff --git a/noip.c b/noip.c
index 8dac7e4..345f325 100644 (file)
--- a/noip.c
+++ b/noip.c
@@ -1127,7 +1127,10 @@ static int do_implicit_bind(int sk, const struct sockaddr *sa, unsigned f)
        sockaddr_in_range_p(sa, &i->minaddr, &i->maxaddr)) {
       D( fprintf(stderr, "noip(%d): match!\n", pid); )
       addr.sa.sa_family = sa->sa_family;
-      ipaddr_to_sockaddr(&addr.sa, &i->bindaddr);
+      switch (i->how) {
+       case EXPLICIT: ipaddr_to_sockaddr(&addr.sa, &i->bindaddr); break;
+       case SAME: copy_sockaddr(&addr.sa, sa); break;
+      }
       port_to_sockaddr(&addr.sa, 0);
       goto found;
     }