Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Feb 2010 14:17:40 +0000 (UTC)
From:      Luigi Rizzo <luigi@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r203344 - user/luigi/ipfw3-head/sys/netinet
Message-ID:  <201002011417.o11EHeta075725@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: luigi
Date: Mon Feb  1 14:17:40 2010
New Revision: 203344
URL: http://svn.freebsd.org/changeset/base/203344

Log:
  use u_char instead of u_int for short bitfields, so tcc and MSC
  do not get the wrong alignment

Modified:
  user/luigi/ipfw3-head/sys/netinet/ip.h
  user/luigi/ipfw3-head/sys/netinet/tcp.h

Modified: user/luigi/ipfw3-head/sys/netinet/ip.h
==============================================================================
--- user/luigi/ipfw3-head/sys/netinet/ip.h	Mon Feb  1 14:13:44 2010	(r203343)
+++ user/luigi/ipfw3-head/sys/netinet/ip.h	Mon Feb  1 14:17:40 2010	(r203344)
@@ -48,11 +48,11 @@
  */
 struct ip {
 #if BYTE_ORDER == LITTLE_ENDIAN
-	u_int	ip_hl:4,		/* header length */
+	u_char	ip_hl:4,		/* header length */
 		ip_v:4;			/* version */
 #endif
 #if BYTE_ORDER == BIG_ENDIAN
-	u_int	ip_v:4,			/* version */
+	u_char	ip_v:4,			/* version */
 		ip_hl:4;		/* header length */
 #endif
 	u_char	ip_tos;			/* type of service */
@@ -142,11 +142,11 @@ struct	ip_timestamp {
 	u_char	ipt_len;		/* size of structure (variable) */
 	u_char	ipt_ptr;		/* index of current entry */
 #if BYTE_ORDER == LITTLE_ENDIAN
-	u_int	ipt_flg:4,		/* flags, see below */
+	u_char	ipt_flg:4,		/* flags, see below */
 		ipt_oflw:4;		/* overflow counter */
 #endif
 #if BYTE_ORDER == BIG_ENDIAN
-	u_int	ipt_oflw:4,		/* overflow counter */
+	u_char	ipt_oflw:4,		/* overflow counter */
 		ipt_flg:4;		/* flags, see below */
 #endif
 	union ipt_timestamp {

Modified: user/luigi/ipfw3-head/sys/netinet/tcp.h
==============================================================================
--- user/luigi/ipfw3-head/sys/netinet/tcp.h	Mon Feb  1 14:13:44 2010	(r203343)
+++ user/luigi/ipfw3-head/sys/netinet/tcp.h	Mon Feb  1 14:17:40 2010	(r203344)
@@ -52,11 +52,11 @@ struct tcphdr {
 	tcp_seq	th_seq;			/* sequence number */
 	tcp_seq	th_ack;			/* acknowledgement number */
 #if BYTE_ORDER == LITTLE_ENDIAN
-	u_int	th_x2:4,		/* (unused) */
+	u_char	th_x2:4,		/* (unused) */
 		th_off:4;		/* data offset */
 #endif
 #if BYTE_ORDER == BIG_ENDIAN
-	u_int	th_off:4,		/* data offset */
+	u_char	th_off:4,		/* data offset */
 		th_x2:4;		/* (unused) */
 #endif
 	u_char	th_flags;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002011417.o11EHeta075725>