From 619780e1beef691fd871273276ad213ee444f72a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 24 Sep 2008 07:33:03 +0000 Subject: [PATCH] * Patch by tqh from ticket #2761 that adds max_hdr, and puts some extra parenthesis around the mtod() definition. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27719 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/libs/compat/freebsd_network/compat/sys/mbuf.h | 3 ++- src/libs/compat/freebsd_network/mbuf.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libs/compat/freebsd_network/compat/sys/mbuf.h b/src/libs/compat/freebsd_network/compat/sys/mbuf.h index c6d2d42539..f26227cbc6 100644 --- a/src/libs/compat/freebsd_network/compat/sys/mbuf.h +++ b/src/libs/compat/freebsd_network/compat/sys/mbuf.h @@ -129,7 +129,7 @@ void m_extadd(struct mbuf *m, caddr_t buffer, u_int size, void (*freeHook)(void *, void *), void *args, int flags, int type); -#define mtod(m, type) (type)((m)->m_data) +#define mtod(m, type) ((type)((m)->m_data)) #define m_tag_delete(mb, tag) \ panic("m_tag_delete unsupported."); @@ -144,6 +144,7 @@ void m_extadd(struct mbuf *m, caddr_t buffer, u_int size, extern int max_linkhdr; extern int max_protohdr; +extern int max_hdr; #include diff --git a/src/libs/compat/freebsd_network/mbuf.c b/src/libs/compat/freebsd_network/mbuf.c index 46a8114247..a496ea73ec 100644 --- a/src/libs/compat/freebsd_network/mbuf.c +++ b/src/libs/compat/freebsd_network/mbuf.c @@ -25,6 +25,8 @@ static object_cache *sChunkCache; int max_linkhdr = 16; int max_protohdr = 40 + 20; /* ip6 + tcp */ +/* max_linkhdr + max_protohdr, but that's not allowed by gcc. */ +int max_hdr = 16 + 40 + 20; static int m_to_oc_flags(int how)