summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2001-01-15 22:40:31 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2001-01-15 22:40:31 +0000
commit8a74d54e33b40beab42b5032e5b5158c8c792714 (patch)
tree870c5ee145d0fac6876f41e72f844ec5abc38613 /sys
parent23c8829afd0c6edab7b222a2cfe32bd1af5bd83e (diff)
Careful with bitmasks (henric@aimnet.com)
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/ip_ether.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/netinet/ip_ether.c b/sys/netinet/ip_ether.c
index bee459b6ec6..9d6e8425f85 100644
--- a/sys/netinet/ip_ether.c
+++ b/sys/netinet/ip_ether.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ether.c,v 1.13 2001/01/09 03:09:10 angelos Exp $ */
+/* $OpenBSD: ip_ether.c,v 1.14 2001/01/15 22:40:30 angelos Exp $ */
/*
* The author of this code is Angelos D. Keromytis (kermit@adk.gr)
@@ -142,13 +142,13 @@ va_dcl
* second nibble of the EtherIP header (the reserved part) is not
* zero; this is also invalid protocol behaviour.
*/
- if (v & 0xffff)
+ if (v & 0x0f)
{
DPRINTF(("etherip_input(): received invalid EtherIP header (reserved field non-zero\n"));
}
else
{
- DPRINTF(("etherip_input(): received EtherIP version number %d not suppoorted\n", (v >> 4) & 0xffff));
+ DPRINTF(("etherip_input(): received EtherIP version number %d not suppoorted\n", (v >> 4) & 0xff));
}
etheripstat.etherip_adrops++;
m_freem(m);
@@ -392,7 +392,7 @@ etherip_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip,
}
/* Set the version number */
- v = (ETHERIP_VERSION << 4) & 0xffff0000;
+ v = (ETHERIP_VERSION << 4) & 0xf0;
m_copyback(m, hlen - sizeof(u_int8_t), sizeof(u_int8_t), &v);
*mp = m;