Thread (14 messages) flat view 14 messages, 3 authors, 2017-01-05

Re: [PATCH v3 net-next 1/2] tools: psock_lib: tighten conditions checked in sock_setfilter

From: Daniel Borkmann <daniel@iogearbox.net>
Date: 2017-01-04 23:20:27

On 01/04/2017 11:48 PM, Sowmini Varadhan wrote:
On (01/04/17 23:26), Daniel Borkmann wrote:
[...]
quoted
quoted
quoted
As it stands it makes it a bit harder to parse / less readable with macros
actually. Rest seems fine, thanks.
Usually macros are there (a) as an abstraction so you
dont have to hard-code things, and, (b) to make things
more readable. (maybe that's why the 1992 VJ paper on
BPF came up with these macros?)

I think we differ on code-aesthetics (not correctness) here.
It was not immediately obvious to me that "0x15 is actually
BPF_JMP + BPF_JEQ + BPF_K" etc, when I wanted to extend
the bpf_prog to harden the checks in the existing code.

Would it be ok to leave the extremely subjective
"make this more readable" part for you to tackle later?
Or I can just drop patch1, and you can fix it to your
satisfaction later.
I think we're talking past each other (?), my suggestion
from my original email was to use bpf_asm and paste the
(human readable) program as a comment above as done also
elsewhere. But just leave it as it is then, no big deal
either.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help