diff options
author | des <des@FreeBSD.org> | 2008-10-23 15:53:51 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2008-10-23 15:53:51 +0000 |
commit | 66f807ed8b3634dc73d9f7526c484e43f094c0ee (patch) | |
tree | 21e792ce590e1bcf9b343890605a1b4c6a9016b3 /sys/netgraph/ng_bpf.c | |
parent | a779c60ce0a41cd14710a8a12cfa22955108b27a (diff) | |
download | FreeBSD-src-66f807ed8b3634dc73d9f7526c484e43f094c0ee.zip FreeBSD-src-66f807ed8b3634dc73d9f7526c484e43f094c0ee.tar.gz |
Retire the MALLOC and FREE macros. They are an abomination unto style(9).
MFC after: 3 months
Diffstat (limited to 'sys/netgraph/ng_bpf.c')
-rw-r--r-- | sys/netgraph/ng_bpf.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/netgraph/ng_bpf.c b/sys/netgraph/ng_bpf.c index 7d7aa26..50a6bf7 100644 --- a/sys/netgraph/ng_bpf.c +++ b/sys/netgraph/ng_bpf.c @@ -277,7 +277,7 @@ ng_bpf_newhook(node_p node, hook_p hook, const char *name) int error; /* Create hook private structure */ - MALLOC(hip, hinfo_p, sizeof(*hip), M_NETGRAPH_BPF, M_NOWAIT | M_ZERO); + hip = malloc(sizeof(*hip), M_NETGRAPH_BPF, M_NOWAIT | M_ZERO); if (hip == NULL) return (ENOMEM); hip->hook = hook; @@ -288,7 +288,7 @@ ng_bpf_newhook(node_p node, hook_p hook, const char *name) /* Attach the default BPF program */ if ((error = ng_bpf_setprog(hook, &ng_bpf_default_prog)) != 0) { - FREE(hip, M_NETGRAPH_BPF); + free(hip, M_NETGRAPH_BPF); NG_HOOK_SET_PRIVATE(hook, NULL); return (error); } @@ -445,7 +445,7 @@ ng_bpf_rcvdata(hook_p hook, item_p item) /* Need to put packet in contiguous memory for bpf */ if (m->m_next != NULL && totlen > MHLEN) { if (usejit) { - MALLOC(data, u_char *, totlen, M_NETGRAPH_BPF, M_NOWAIT); + data = malloc(totlen, M_NETGRAPH_BPF, M_NOWAIT); if (data == NULL) { NG_FREE_ITEM(item); return (ENOMEM); @@ -475,7 +475,7 @@ ng_bpf_rcvdata(hook_p hook, item_p item) else len = bpf_filter(hip->prog->bpf_prog, (u_char *)m, totlen, 0); if (needfree) - FREE(data, M_NETGRAPH_BPF); + free(data, M_NETGRAPH_BPF); ready: /* See if we got a match and find destination hook */ if (len > 0) { @@ -532,12 +532,12 @@ ng_bpf_disconnect(hook_p hook) /* Remove our reference from other hooks data. */ NG_NODE_FOREACH_HOOK(node, ng_bpf_remrefs, hook, tmp); - FREE(hip->prog, M_NETGRAPH_BPF); + free(hip->prog, M_NETGRAPH_BPF); #ifdef BPF_JITTER if (hip->jit_prog != NULL) bpf_destroy_jit_filter(hip->jit_prog); #endif - FREE(hip, M_NETGRAPH_BPF); + free(hip, M_NETGRAPH_BPF); if ((NG_NODE_NUMHOOKS(node) == 0) && (NG_NODE_IS_VALID(node))) { ng_rmnode_self(node); @@ -569,7 +569,7 @@ ng_bpf_setprog(hook_p hook, const struct ng_bpf_hookprog *hp0) /* Make a copy of the program */ size = NG_BPF_HOOKPROG_SIZE(hp0->bpf_prog_len); - MALLOC(hp, struct ng_bpf_hookprog *, size, M_NETGRAPH_BPF, M_NOWAIT); + hp = malloc(size, M_NETGRAPH_BPF, M_NOWAIT); if (hp == NULL) return (ENOMEM); bcopy(hp0, hp, size); @@ -579,7 +579,7 @@ ng_bpf_setprog(hook_p hook, const struct ng_bpf_hookprog *hp0) /* Free previous program, if any, and assign new one */ if (hip->prog != NULL) - FREE(hip->prog, M_NETGRAPH_BPF); + free(hip->prog, M_NETGRAPH_BPF); hip->prog = hp; #ifdef BPF_JITTER if (hip->jit_prog != NULL) |