summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-07-18 10:15:37 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-07-18 10:15:37 +0000
commit95c21c07dae3e8d8ab888a71b10c738506b4e354 (patch)
treeac70f48a63a4eb8b47aaef84565c2455a1efd27a
parent4a4dbe2c38ceac260d45f9d5627d3e9b065b01cc (diff)
downloadrsyslog-95c21c07dae3e8d8ab888a71b10c738506b4e354.tar.gz
rsyslog-95c21c07dae3e8d8ab888a71b10c738506b4e354.tar.xz
rsyslog-95c21c07dae3e8d8ab888a71b10c738506b4e354.zip
fixed bug that caused $AllowedSenders to handle IPv6 scopes incorrectly;
also fixed but that could grabble $AllowedSender wildcards. Thanks to mildew@gmail.com for the patch
-rw-r--r--syslogd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/syslogd.c b/syslogd.c
index 53653ac9..4109f52e 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -919,7 +919,7 @@ static rsRetVal AddAllowedSender(struct AllowedSenders **ppRoot, struct AllowedS
iSignificantBits);
iSignificantBits = 128;
}
-
+
MaskIP6 (&(SIN6(iAllow->addr.NetAddr)->sin6_addr), iSignificantBits);
break;
default:
@@ -1133,7 +1133,8 @@ static inline int MaskCmp(struct NetAddr *pAllow, uint8_t bits, struct sockaddr
ip.s6_addr32[i] = 0;
return (memcmp (ip.s6_addr, net.s6_addr, sizeof ip.s6_addr) == 0 &&
- SIN6(pFrom)->sin6_scope_id == SIN6(pAllow->addr.NetAddr)->sin6_scope_id);
+ (SIN6(pAllow->addr.NetAddr)->sin6_scope_id != 0 ?
+ SIN6(pFrom)->sin6_scope_id == SIN6(pAllow->addr.NetAddr)->sin6_scope_id : 1));
}
case AF_INET: {
struct in6_addr *ip6 = &(SIN6(pFrom))->sin6_addr;