]> git.ipfire.org Git - thirdparty/iproute2.git/commit
bpf: Make bytecode-file reading a little more robust
authorPhil Sutter <phil@nwl.cc>
Wed, 2 Aug 2017 12:57:56 +0000 (14:57 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 3 Aug 2017 22:56:48 +0000 (15:56 -0700)
commit3da3ebfca85b8f1e8252b898453d8cb383c5c398
tree540896d808c820e03adbadd08fe6a177a8824037
parentf73ac674d0abf414c44b87bd5da3af01a6fb64f6
bpf: Make bytecode-file reading a little more robust

bpf_parse_string() will now correctly handle:

- Extraneous whitespace,
- OPs on multiple lines and
- overlong file names.

The added feature of allowing to have OPs on multiple lines (like e.g.
tcpdump prints them) is rather a side effect of fixing detection of
malformed bytecode files having random content on a second line, like
e.g.:

| 4,40 0 0 12,21 0 1 2048,6 0 0 262144,6 0 0 0
| foobar

Cc: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Phil Sutter <phil@nwl.cc>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
lib/bpf.c