chiark
/
gitweb
/
~mdw
/
preload-hacks
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
noip.c (acl_allows_p): Check that the ACL node address family is right.
[preload-hacks]
/
noip.c
diff --git
a/noip.c
b/noip.c
index 085b0be9983922b5a4a9100e70eadee4b6fe5b08..0fab12eed73685e0f5fc9217ad24e2325f20868a 100644
(file)
--- 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); )
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"); )
a->minport <= port && port <= a->maxport) {
D( fprintf(stderr, "noip(%d): aha! %s\n", pid,
a->act ? "ALLOW" : "DENY"); )
@@
-1316,7
+1317,8
@@
static void parse_autoports(char **pp)
SKIPSPC;
NEXTNUMBER(q, del); x = strtoul(q, 0, 0); RESCAN(del);
SKIPSPC;
SKIPSPC;
NEXTNUMBER(q, del); x = strtoul(q, 0, 0); RESCAN(del);
SKIPSPC;
- if (*p != '-') goto bad; p++;
+ if (*p != '-') goto bad;
+ p++;
NEXTNUMBER(q, del); y = strtoul(q, 0, 0); RESCAN(del);
minautoport = x; maxautoport = y;
SKIPSPC; if (*p) goto bad;
NEXTNUMBER(q, del); y = strtoul(q, 0, 0); RESCAN(del);
minautoport = x; maxautoport = y;
SKIPSPC; if (*p) goto bad;