Fix an alignment error

PR:		27766
Submitted by:	Sudish Joseph <sudish@mindspring.com>
MFC after:	2 weeks
This commit is contained in:
Brian Somers 2001-05-30 15:52:24 +00:00
parent 1acf256d96
commit 47fe010cf3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=77487

View file

@ -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);
}
}
}