summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_ether.c
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2001-02-01 20:14:28 +0000
committerJason Wright <jason@cvs.openbsd.org>2001-02-01 20:14:28 +0000
commitb903e4b4cffc69cd803e6845fec6fa1b34d175e4 (patch)
tree9bb86c2d8cf0e1a7d2ac59675f99c9cf137769fa /sys/netinet/ip_ether.c
parentdfad7d515c21e73558487001a331eb040c42dc08 (diff)
according to the draft-housley-etherip-01, the version is in the low order
4 bits of the header
Diffstat (limited to 'sys/netinet/ip_ether.c')
-rw-r--r--sys/netinet/ip_ether.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/netinet/ip_ether.c b/sys/netinet/ip_ether.c
index 9d56493c711..5597f252af7 100644
--- a/sys/netinet/ip_ether.c
+++ b/sys/netinet/ip_ether.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ether.c,v 1.18 2001/02/01 00:14:14 jason Exp $ */
+/* $OpenBSD: ip_ether.c,v 1.19 2001/02/01 20:14:26 jason Exp $ */
/*
* The author of this code is Angelos D. Keromytis (kermit@adk.gr)
@@ -136,8 +136,7 @@ va_dcl
/* Verify EtherIP version number */
m_copydata(m, iphlen, sizeof(u_int8_t), &v);
- if (v != (ETHERIP_VERSION << 4))
- {
+ if ((v & ETHERIP_VERSION_MASK) != ETHERIP_VERSION) {
/*
* Note that the other potential failure of the above check is that the
* second nibble of the EtherIP header (the reserved part) is not
@@ -424,7 +423,7 @@ etherip_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip,
}
/* Set the version number */
- v = (ETHERIP_VERSION << 4) & 0xf0;
+ v = ETHERIP_VERSION & ETHERIP_VERSION_MASK;
m_copyback(m, hlen - sizeof(u_int8_t), sizeof(u_int8_t), &v);
*mp = m;