summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2003-03-26 02:27:32 +0000
committerbrian <brian@FreeBSD.org>2003-03-26 02:27:32 +0000
commitba277a3e140487e5ce7ceeb6d9007b0e835f84ca (patch)
treee548bd84248487abf4fde7090e110e0de3594f74 /usr.sbin
parenta3b7ff0585aaa0f9babe6826da6304e1b19f827e (diff)
downloadFreeBSD-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.c4
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;
OpenPOWER on IntegriCloud