From: Daniel Borkmann <daniel@iogearbox.net>
To: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Cc: linux-kselftest@vger.kernel.org, netdev@vger.kernel.org,
willemb@google.com, davem@davemloft.net, shuah@kernel.org
Subject: Re: [PATCH v3 net-next 1/2] tools: psock_lib: tighten conditions checked in sock_setfilter
Date: Wed, 04 Jan 2017 23:59:54 +0100 [thread overview]
Message-ID: <586D7E6A.5080009@iogearbox.net> (raw)
In-Reply-To: <20170104224848.GB31756@oracle.com>
On 01/04/2017 11:48 PM, Sowmini Varadhan wrote:
> On (01/04/17 23:26), Daniel Borkmann wrote:
[...]
>>>> 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.
next prev parent reply other threads:[~2017-01-04 23:20 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-04 18:45 [PATCH v3 net-next 0/2] tools: psock_tpacket bug fixes Sowmini Varadhan
2017-01-04 18:45 ` [PATCH v3 net-next 1/2] tools: psock_lib: tighten conditions checked in sock_setfilter Sowmini Varadhan
2017-01-04 22:16 ` Daniel Borkmann
2017-01-04 22:22 ` Sowmini Varadhan
2017-01-04 22:26 ` Daniel Borkmann
2017-01-04 22:48 ` Sowmini Varadhan
2017-01-04 22:59 ` Daniel Borkmann [this message]
2017-01-04 22:37 ` Shuah Khan
2017-01-04 22:49 ` Sowmini Varadhan
2017-01-04 22:55 ` Sowmini Varadhan
2017-01-04 23:26 ` Shuah Khan
2017-01-05 15:54 ` Sowmini Varadhan
2017-01-05 18:46 ` Shuah Khan
2017-01-04 18:45 ` [PATCH v3 net-next 2/2] tools: psock_tpacket: block Rx until socket filter has been added and socket has been bound to loopback Sowmini Varadhan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=586D7E6A.5080009@iogearbox.net \
--to=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=sowmini.varadhan@oracle.com \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).