sending NGM_BPF_SET_PROGRAM message to a bpf node from a program

Gleb Smirnoff glebius at FreeBSD.org
Wed Aug 30 14:22:35 UTC 2006


On Wed, Aug 30, 2006 at 06:01:10PM +0530, Rajkumar S wrote:
R> and messaging the bpf: using the following code fragment.
R> 
R>        if (NgSendMsg(cfd, "bpf:", NGM_GENERIC_COOKIE,
R>                      NGM_BPF_SET_PROGRAM, bpf_hookprog, (sizeof
R> (struct ng_bpf_hookprog) + fp.bf_len * sizeof (struct bpf_insn))) < 0)
R> {
R>                perror ("Setup bpf program");
R>                return (-1);
R>        }

The cookie shouldn't be NGM_GENERIC_COOKIE, but should be NGM_BPF_COOKIE.

-- 
Totus tuus, Glebius.
GLEBIUS-RIPN GLEB-RIPE


More information about the freebsd-net mailing list