From: Mark Wooding Date: Wed, 6 Jun 2018 19:11:56 +0000 (+0100) Subject: noip.c (acl_allows_p): Check that the ACL node address family is right. X-Git-Tag: 1.2.0~31 X-Git-Url: https://git.distorted.org.uk/~mdw/preload-hacks/commitdiff_plain/deedf22d7c74bec2330fd0e555d1dda49e96b26e noip.c (acl_allows_p): Check that the ACL node address family is right. Oops. `sockaddr_in_range_p' can't check this, because it can only see one address family. --- diff --git a/noip.c b/noip.c index b10f6bb..0fab12e 100644 --- a/noip.c +++ b/noip.c @@ -597,7 +597,8 @@ static int acl_allows_p(const aclnode *a, const struct sockaddr *sa) present_sockaddr(sa, 0, buf, sizeof(buf))); }) for (; a; a = a->next) { D( dump_aclnode(a); ) - if (sockaddr_in_range_p(sa, &a->minaddr, &a->maxaddr) && + if (a->af == sa->sa_family && + sockaddr_in_range_p(sa, &a->minaddr, &a->maxaddr) && a->minport <= port && port <= a->maxport) { D( fprintf(stderr, "noip(%d): aha! %s\n", pid, a->act ? "ALLOW" : "DENY"); )