diff options
author | phk <phk@FreeBSD.org> | 2002-10-20 22:52:07 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-10-20 22:52:07 +0000 |
commit | 419afbc0d3d9432a72ea3e36f9c4974b31428c35 (patch) | |
tree | 3085be4699af33492ff2fa83133fe4d6b7d15a25 /sys/netinet/ip.h | |
parent | 58072098f10aafb040901741472830c4d8efcb3a (diff) | |
download | FreeBSD-src-419afbc0d3d9432a72ea3e36f9c4974b31428c35.zip FreeBSD-src-419afbc0d3d9432a72ea3e36f9c4974b31428c35.tar.gz |
Fix two instances of variant struct definitions in sys/netinet:
Remove the never completed _IP_VHL version, it has not caught on
anywhere and it would make us incompatible with other BSD netstacks
to retain this version.
Add a CTASSERT protecting sizeof(struct ip) == 20.
Don't let the size of struct ipq depend on the IPDIVERT option.
This is a functional no-op commit.
Approved by: re
Diffstat (limited to 'sys/netinet/ip.h')
-rw-r--r-- | sys/netinet/ip.h | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/sys/netinet/ip.h b/sys/netinet/ip.h index 7bb0988..1683349 100644 --- a/sys/netinet/ip.h +++ b/sys/netinet/ip.h @@ -47,9 +47,6 @@ * Structure of an internet header, naked of options. */ struct ip { -#ifdef _IP_VHL - u_char ip_vhl; /* version << 4 | header length >> 2 */ -#else #if BYTE_ORDER == LITTLE_ENDIAN u_int ip_hl:4, /* header length */ ip_v:4; /* version */ @@ -58,7 +55,6 @@ struct ip { u_int ip_v:4, /* version */ ip_hl:4; /* header length */ #endif -#endif /* not _IP_VHL */ u_char ip_tos; /* type of service */ u_short ip_len; /* total length */ u_short ip_id; /* identification */ @@ -71,13 +67,10 @@ struct ip { u_char ip_p; /* protocol */ u_short ip_sum; /* checksum */ struct in_addr ip_src,ip_dst; /* source and dest address */ -}; +} __attribute__((__packed__)); -#ifdef _IP_VHL -#define IP_MAKE_VHL(v, hl) ((v) << 4 | (hl)) -#define IP_VHL_HL(vhl) ((vhl) & 0x0f) -#define IP_VHL_V(vhl) ((vhl) >> 4) -#define IP_VHL_BORING 0x45 +#ifdef CTASSERT +CTASSERT(sizeof (struct ip) == 20); #endif #define IP_MAXPACKET 65535 /* maximum packet size */ |