diff options
| author | Brian Somers <brian@FreeBSD.org> | 2001-05-30 15:52:24 +0000 |
|---|---|---|
| committer | Brian Somers <brian@FreeBSD.org> | 2001-05-30 15:52:24 +0000 |
| commit | 47fe010cf38cb496eb2a888fc79fc9b77af86d0a (patch) | |
| tree | 4dcd8f50ccc51f54aac323a7b74f8ef529a11ab4 | |
| parent | 1acf256d96ab7ec881c40f4eeeef2e064c7e7d20 (diff) | |
Notes
| -rw-r--r-- | usr.sbin/ppp/ip.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/usr.sbin/ppp/ip.c b/usr.sbin/ppp/ip.c index 6857c137c9a8..82f80925fd1f 100644 --- a/usr.sbin/ppp/ip.c +++ b/usr.sbin/ppp/ip.c @@ -450,7 +450,7 @@ ip_LogDNS(const struct udphdr *uh, const char *direction) struct dns_header header; const u_short *pktptr; const u_char *ptr; - u_short *hptr; + u_short *hptr, tmp; int len; ptr = (const char *)uh + sizeof *uh; @@ -489,11 +489,16 @@ ip_LogDNS(const struct udphdr *uh, const char *direction) n += len; } *n = '\0'; - qtype = dns_Qtype2Txt(ntohs(*(const u_short *)end)); - qclass = dns_Qclass2Txt(ntohs(*(const u_short *)(end + 2))); - log_Printf(LogDNS, "%sbound query %s %s %s\n", - direction, qclass, qtype, namewithdot); + if (log_IsKept(LogDNS)) { + memcpy(&tmp, end, sizeof tmp); + qtype = dns_Qtype2Txt(ntohs(tmp)); + memcpy(&tmp, end + 2, sizeof tmp); + qclass = dns_Qclass2Txt(ntohs(tmp)); + + log_Printf(LogDNS, "%sbound query %s %s %s\n", + direction, qclass, qtype, namewithdot); + } } } |
