kern/125003: incorrect EtherIP header format.
Shunsuke SHINOMIYA
shino at fornext.org
Thu Jun 26 08:20:04 UTC 2008
The following reply was made to PR kern/125003; it has been noted by GNATS.
From: Shunsuke SHINOMIYA <shino at fornext.org>
To: bug-followup at FreeBSD.org,
shino at fornext.org
Cc:
Subject: Re: kern/125003: incorrect EtherIP header format.
Date: Thu, 26 Jun 2008 16:49:11 +0900
Sorry, a part of submitted PR is missing.
Description:
RFC3378 says:
In summary, the EtherIP Header has two fields:
Bits 0-3: Protocol version
Bits 4-15: Reserved for future use
But, EtherIP is implemented as follows.
struct etherip_header {
u_int8_t eip_ver; /* version/reserved */
u_int8_t eip_pad; /* required padding byte */
};
By this one, FreeBSD box has no interoperability against other EtherIP
implementations.
Fix:
I modified if_gif.h as follows.
> diff -u if_gif.h-1.17.2.2 if_gif.h
--- if_gif.h-1.17.2.2 2006-02-01 00:56:46.000000000 +0900
+++ if_gif.h 2008-06-26 15:34:22.000000000 +0900
@@ -93,8 +93,8 @@
#define MTAG_GIF_CALLED 0
struct etherip_header {
- u_int8_t eip_ver; /* version/reserved */
- u_int8_t eip_pad; /* required padding byte */
+ u_int16_t eip_ver: 4; /* version/reserved */
+ u_int16_t eip_pad: 12; /* required padding byte */
};
#define ETHERIP_VER_VERS_MASK 0x0f
#define ETHERIP_VER_RSVD_MASK 0xf0
>
--
Shunsuke SHINOMIYA <shino at fornext.org>
More information about the freebsd-bugs
mailing list