From: deraadt Date: Mon, 14 Jul 2014 12:18:30 +0000 (+0000) Subject: In the next step, stop accepting the nibble-swapped protocol for 5.6. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1611710df026d50c00a884662630c5c1a4287c8f;p=openbsd In the next step, stop accepting the nibble-swapped protocol for 5.6. This completes the transition. A cvs log and diff will tell the story of why we went through this. with david.dahlberg@fkie.fraunhofer.de and claudio --- diff --git a/sys/netinet/ip_ether.c b/sys/netinet/ip_ether.c index 5ad8a94ec8b..ab2778bca6f 100644 --- a/sys/netinet/ip_ether.c +++ b/sys/netinet/ip_ether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ether.c,v 1.66 2014/04/14 09:06:42 mpi Exp $ */ +/* $OpenBSD: ip_ether.c,v 1.67 2014/07/14 12:18:30 deraadt Exp $ */ /* * The author of this code is Angelos D. Keromytis (kermit@adk.gr) * @@ -189,19 +189,8 @@ etherip_decap(struct mbuf *m, int iphlen) /* Verify EtherIP version number */ m_copydata(m, iphlen, sizeof(struct etherip_header), (caddr_t)&eip); - if (eip.eip_ver == ETHERIP_VERSION && eip.eip_oldver == 0) { + if (eip.eip_ver == ETHERIP_VERSION) { /* Correct */ - } else if (eip.eip_oldver == ETHERIP_VERSION && eip.eip_ver == 0) { - /* - * OpenBSD developers convinced IETF folk to create a - * "version 3" protocol which would solve a byte order - * problem -- our discussion placed "3" into the first byte. - * They knew we were starting to deploy this. When IETF - * published the standard this had changed to a nibble... - * but they failed to inform us. Awesome. - * - * For backwards compat, for a while, we must accept either. - */ } else { DPRINTF(("etherip_input(): received EtherIP version number " "%d not suppoorted\n", eip.eip_ver)); @@ -572,7 +561,7 @@ etherip_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int proto) * We will transition step by step to the new model. */ eip.eip_ver = ETHERIP_VERSION; - eip.eip_oldver = 0; + eip.eip_res = 0; eip.eip_pad = 0; m_copyback(m, hlen - sizeof(struct etherip_header), sizeof(struct etherip_header), &eip, M_NOWAIT); diff --git a/sys/netinet/ip_ether.h b/sys/netinet/ip_ether.h index 9600b3d674c..d25b6254d68 100644 --- a/sys/netinet/ip_ether.h +++ b/sys/netinet/ip_ether.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ether.h,v 1.17 2013/01/14 23:06:10 deraadt Exp $ */ +/* $OpenBSD: ip_ether.h,v 1.18 2014/07/14 12:18:30 deraadt Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@adk.gr) * @@ -43,12 +43,12 @@ struct etheripstat { struct etherip_header { #if BYTE_ORDER == LITTLE_ENDIAN - u_int eip_oldver:4; /* reserved */ + u_int eip_res:4; /* reserved */ u_int eip_ver:4; /* version */ #endif #if BYTE_ORDER == BIG_ENDIAN u_int eip_ver:4; /* version */ - u_int eip_oldver:4; /* reserved */ + u_int eip_res:4; /* reserved */ #endif u_int8_t eip_pad; /* required padding byte */ } __packed;