]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/ipfilter/lib/dupmbt.c
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / contrib / ipfilter / lib / dupmbt.c
1 /*
2  * Copyright (C) 2012 by Darren Reed.
3  *
4  * See the IPFILTER.LICENCE file for details on licencing.
5  *
6  * $Id: dupmbt.c,v 1.3.2.2 2012/07/22 08:04:24 darren_r Exp $
7  */
8
9 #include "ipf.h"
10
11 mb_t *dupmbt(orig)
12         mb_t *orig;
13 {
14         mb_t *m;
15
16         m = (mb_t *)malloc(sizeof(mb_t));
17         if (m == NULL)
18                 return NULL;
19         m->mb_len = orig->mb_len;
20         m->mb_next = NULL;
21         m->mb_data = (char *)m->mb_buf + (orig->mb_data - (char *)orig->mb_buf);
22         bcopy(orig->mb_data, m->mb_data, m->mb_len);
23         return m;
24 }