From 7c14da72024b6b95c64fc7d0972da12689e4abb0 Mon Sep 17 00:00:00 2001 From: Andre Oppermann Date: Sat, 24 Aug 2013 19:58:36 +0000 Subject: [PATCH] Add mtodo(m, o) macro taking an additional offset into the mbuf data section. Sponsored by: The FreeBSD Foundation --- sys/sys/mbuf.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index fc5711dc112..4e6e59ebccd 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -67,8 +67,10 @@ * type: * * mtod(m, t) -- Convert mbuf pointer to data pointer of correct type. + * mtodo(m, o) -- Same as above but with offset 'o' into data. */ #define mtod(m, t) ((t)((m)->m_data)) +#define mtodo(m, o) ((void *)(((m)->m_data) + (o))) /* * Argument structure passed to UMA routines during mbuf and packet