[netgraph] ng_bpf filter large list of IP addresses

Eugene Grosbein eugen at grosbein.net
Sun Apr 1 13:33:39 UTC 2018


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.



More information about the freebsd-net mailing list