From 98c63057d2144fb81681580cd84c13c93794c96e Mon Sep 17 00:00:00 2001 From: Guillaume Subiron Date: Tue, 15 Mar 2016 10:31:20 +0100 Subject: slirp: Factorizing tcpiphdr structure with an union This patch factorizes the tcpiphdr structure to put the IPv4 fields in an union, for addition of version 6 in further patch. Using some macros, retrocompatibility of the existing code is assured. This patch also fixes the SLIRP_MSIZE and margin computation in various functions, and makes them compatible with the new tcpiphdr structure, whose size will be bigger than sizeof(struct tcphdr) + sizeof(struct ip) Signed-off-by: Guillaume Subiron Signed-off-by: Samuel Thibault Reviewed-by: Thomas Huth --- slirp/mbuf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'slirp/mbuf.c') diff --git a/slirp/mbuf.c b/slirp/mbuf.c index c959758465..d688dd43f7 100644 --- a/slirp/mbuf.c +++ b/slirp/mbuf.c @@ -22,9 +22,9 @@ /* * Find a nice value for msize - * XXX if_maxlinkhdr already in mtu */ -#define SLIRP_MSIZE (IF_MTU + IF_MAXLINKHDR + offsetof(struct mbuf, m_dat) + 6) +#define SLIRP_MSIZE\ + (offsetof(struct mbuf, m_dat) + IF_MAXLINKHDR + TCPIPHDR_DELTA + IF_MTU) void m_init(Slirp *slirp) -- cgit v1.2.3