diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-01-15 22:40:31 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-01-15 22:40:31 +0000 |
commit | 8a74d54e33b40beab42b5032e5b5158c8c792714 (patch) | |
tree | 870c5ee145d0fac6876f41e72f844ec5abc38613 /sys | |
parent | 23c8829afd0c6edab7b222a2cfe32bd1af5bd83e (diff) |
Careful with bitmasks (henric@aimnet.com)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/ip_ether.c | 8 |
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; |