diff options
Diffstat (limited to 'sbin/ipf/libipf/dupmbt.c')
| -rw-r--r-- | sbin/ipf/libipf/dupmbt.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sbin/ipf/libipf/dupmbt.c b/sbin/ipf/libipf/dupmbt.c new file mode 100644 index 000000000000..722d92e2705c --- /dev/null +++ b/sbin/ipf/libipf/dupmbt.c @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2012 by Darren Reed. + * + * See the IPFILTER.LICENCE file for details on licencing. + * + * $Id: dupmbt.c,v 1.3.2.2 2012/07/22 08:04:24 darren_r Exp $ + */ + +#include "ipf.h" + +mb_t * +dupmbt(mb_t *orig) +{ + mb_t *m; + + m = (mb_t *)malloc(sizeof(mb_t)); + if (m == NULL) + return (NULL); + m->mb_len = orig->mb_len; + m->mb_next = NULL; + m->mb_data = (char *)m->mb_buf + (orig->mb_data - (char *)orig->mb_buf); + bcopy(orig->mb_data, m->mb_data, m->mb_len); + return (m); +} |
