Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Apr 2018 20:33:25 +0700
From:      Eugene Grosbein <eugen@grosbein.net>
To:        Reshad Patuck <reshadpatuck1@gmail.com>, freebsd-net@freebsd.org
Subject:   Re: [netgraph] ng_bpf filter large list of IP addresses
Message-ID:  <5AC0DFA5.3000509@grosbein.net>
In-Reply-To: <36DD471B-D88D-4074-A4D3-A480F5EC2392@gmail.com>
References:  <D4E00F05-F64D-4446-A572-E1A0E06B2C47@gmail.com> <5ABF973D.5070009@grosbein.net> <36DD471B-D88D-4074-A4D3-A480F5EC2392@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
01.04.2018 15:36, Reshad Patuck пишет:
> Hi Eugene,
> ​
> Thanks for your quick reply.
> ​
> The issue that I am facing is for a list of 250 IP addresses, I can generate a bpf filter that works when I specify it on the command line.
> ```
> # ngctl msg em1-bpf: setprogram { thisHook=\"in\" ifMatch=\"out\" bpf_prog_len=258 bpf_prog=[ { code=40 jt=0 jf=0 k=12 }
> ```
> ​
> But when I try to use `-f` or the `read` command, either for a file on disk or using echo pipe or a STDIN redirect I get this error:
> ```
> ngctl: send msg: Invalid argument
> ngctl: line 1: error in file
> ```
> ​
> This is odd because when I specify arguments via the terminal (under the kern.argmax limit) everything works fine.

You have not shown file contents so I can only guess. I guess you misuse escapes \"
as they are not needed (must not be used) in file or pipe.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5AC0DFA5.3000509>