1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-19 10:53:58 +00:00

Added the missing ntohs() conversion when matching IP packet with

the IP_FW_IF_IPID rule.  (We have recently decided to keep the
ip_id field in network byte order inside the kernel, see revision
1.140 of src/sys/netinet/ip_input.c).

I did not like to have the conversion happen in userland, and I
think that the similar conversions for fw_tcp(seq|ack|win) should
be moved out of userland (src/sbin/ipfw/ipfw.c) into the kernel.
This commit is contained in:
Ruslan Ermilov 2000-10-03 12:18:11 +00:00
parent 10d5f4e72e
commit 60f9125458
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=66582

View File

@ -1141,7 +1141,7 @@ ip_fw_chk(struct ip **pip, int hlen,
continue;
if (f->fw_ipflg & IP_FW_IF_IPLEN && f->fw_iplen != ip->ip_len)
continue;
if (f->fw_ipflg & IP_FW_IF_IPID && f->fw_ipid != ip->ip_id)
if (f->fw_ipflg & IP_FW_IF_IPID && f->fw_ipid != ntohs(ip->ip_id))
continue;
if (f->fw_ipflg & IP_FW_IF_IPTOS && !iptos_match(ip, f))
continue;