diff options
author | brian <brian@FreeBSD.org> | 2003-03-26 02:27:32 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2003-03-26 02:27:32 +0000 |
commit | ba277a3e140487e5ce7ceeb6d9007b0e835f84ca (patch) | |
tree | e548bd84248487abf4fde7090e110e0de3594f74 /usr.sbin | |
parent | a3b7ff0585aaa0f9babe6826da6304e1b19f827e (diff) | |
download | FreeBSD-src-ba277a3e140487e5ce7ceeb6d9007b0e835f84ca.zip FreeBSD-src-ba277a3e140487e5ce7ceeb6d9007b0e835f84ca.tar.gz |
Passing a u_char to ntohs() is guaranteed to give the wrong answer !
Submitted by: Francis Dupont <Francis.Dupont@enst-bretagne.fr>
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ppp/ip.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/ppp/ip.c b/usr.sbin/ppp/ip.c index 3c0d54b..7433458 100644 --- a/usr.sbin/ppp/ip.c +++ b/usr.sbin/ppp/ip.c @@ -280,7 +280,7 @@ FilterCheck(const unsigned char *packet, u_int32_t family, case IPPROTO_ICMP: mindata = 8; /* ICMP must be at least 8 octets */ ih = (const struct icmp *)payload; - sport = ntohs(ih->icmp_type); + sport = ih->icmp_type; if (log_IsKept(LogDEBUG)) snprintf(dbuff, sizeof dbuff, "sport = %d", sport); break; @@ -289,7 +289,7 @@ FilterCheck(const unsigned char *packet, u_int32_t family, case IPPROTO_ICMPV6: mindata = 8; /* ICMP must be at least 8 octets */ ih6 = (const struct icmp6_hdr *)payload; - sport = ntohs(ih6->icmp6_type); + sport = ih6->icmp6_type; if (log_IsKept(LogDEBUG)) snprintf(dbuff, sizeof dbuff, "sport = %d", sport); break; |