summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/ip.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2000-03-29 09:31:52 +0000
committerbrian <brian@FreeBSD.org>2000-03-29 09:31:52 +0000
commita12619f86801d28316676a19a0267008ccb8ceff (patch)
tree6fe044d24586b27ba85aa43d05899aec2978e76a /usr.sbin/ppp/ip.c
parent657714f28b4882b431d947e9e54ff90261a40375 (diff)
downloadFreeBSD-src-a12619f86801d28316676a19a0267008ccb8ceff.zip
FreeBSD-src-a12619f86801d28316676a19a0267008ccb8ceff.tar.gz
Log information about packets being dropped (probably due to
``nat deny_incoming yes'') by libalias.
Diffstat (limited to 'usr.sbin/ppp/ip.c')
-rw-r--r--usr.sbin/ppp/ip.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/usr.sbin/ppp/ip.c b/usr.sbin/ppp/ip.c
index 1fdd6c2..fd651b5 100644
--- a/usr.sbin/ppp/ip.c
+++ b/usr.sbin/ppp/ip.c
@@ -443,7 +443,8 @@ PacketCheck(struct bundle *bundle, char *cp, int nb, struct filter *filter)
int mask, len, n, pri, logit, loglen, result;
char logbuf[200];
- logit = (log_IsKept(LogTCPIP) || log_IsKept(LogDNS)) && filter->logok;
+ logit = (log_IsKept(LogTCPIP) || log_IsKept(LogDNS)) &&
+ (!filter || filter->logok);
loglen = 0;
pri = 0;
@@ -451,7 +452,10 @@ PacketCheck(struct bundle *bundle, char *cp, int nb, struct filter *filter)
uh = NULL;
if (logit && loglen < sizeof logbuf) {
- snprintf(logbuf + loglen, sizeof logbuf - loglen, "%s ", filter->name);
+ if (filter)
+ snprintf(logbuf + loglen, sizeof logbuf - loglen, "%s ", filter->name);
+ else
+ snprintf(logbuf + loglen, sizeof logbuf - loglen, " ");
loglen += strlen(logbuf + loglen);
}
ptop = (cp + (pip->ip_hl << 2));
@@ -584,7 +588,7 @@ PacketCheck(struct bundle *bundle, char *cp, int nb, struct filter *filter)
break;
}
- if (FilterCheck(pip, filter)) {
+ if (filter && FilterCheck(pip, filter)) {
if (logit)
log_Printf(LogTCPIP, "%s - BLOCKED\n", logbuf);
#ifdef notdef
@@ -595,7 +599,7 @@ PacketCheck(struct bundle *bundle, char *cp, int nb, struct filter *filter)
} else {
/* Check Keep Alive filter */
if (logit && log_IsKept(LogTCPIP)) {
- if (FilterCheck(pip, &bundle->filter.alive))
+ if (filter && FilterCheck(pip, &bundle->filter.alive))
log_Printf(LogTCPIP, "%s - NO KEEPALIVE\n", logbuf);
else
log_Printf(LogTCPIP, "%s\n", logbuf);
@@ -603,7 +607,7 @@ PacketCheck(struct bundle *bundle, char *cp, int nb, struct filter *filter)
result = pri;
}
- if (uh && ntohs(uh->uh_dport) == 53 && log_IsKept(LogDNS))
+ if (filter && uh && ntohs(uh->uh_dport) == 53 && log_IsKept(LogDNS))
ip_LogDNS(uh, filter->name);
return result;
OpenPOWER on IntegriCloud