diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2001-02-01 20:14:28 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2001-02-01 20:14:28 +0000 |
commit | b903e4b4cffc69cd803e6845fec6fa1b34d175e4 (patch) | |
tree | 9bb86c2d8cf0e1a7d2ac59675f99c9cf137769fa /sys/netinet | |
parent | dfad7d515c21e73558487001a331eb040c42dc08 (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')
-rw-r--r-- | sys/netinet/ip_ether.c | 7 | ||||
-rw-r--r-- | sys/netinet/ip_ether.h | 5 |
2 files changed, 6 insertions, 6 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; diff --git a/sys/netinet/ip_ether.h b/sys/netinet/ip_ether.h index e203d5e7218..c332ccf7139 100644 --- a/sys/netinet/ip_ether.h +++ b/sys/netinet/ip_ether.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ether.h,v 1.4 2001/01/09 02:47:19 angelos Exp $ */ +/* $OpenBSD: ip_ether.h,v 1.5 2001/02/01 20:14:27 jason Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@adk.gr) @@ -40,7 +40,8 @@ struct etheripstat u_int64_t etherip_obytes; /* output bytes */ }; -#define ETHERIP_VERSION 0x2 +#define ETHERIP_VERSION 0x02 +#define ETHERIP_VERSION_MASK 0x0f /* * Names for Ether-IP sysctl objects |