mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-22 17:54:52 +00:00
Fix an alignment error
PR: 27766 Submitted by: Sudish Joseph <sudish@mindspring.com> MFC after: 2 weeks
This commit is contained in:
parent
1acf256d96
commit
47fe010cf3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=77487
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue