From: Patrick McHardy <kaber@trash.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Maik Hentsche <netfilter@mm-double.de>,
netfilter-devel@lists.netfilter.org
Subject: Re: [PATCH] libnfnetlink
Date: Wed, 11 Oct 2006 12:32:59 +0200 [thread overview]
Message-ID: <452CC85B.4000105@trash.net> (raw)
In-Reply-To: <4521185D.8040005@netfilter.org>
Pablo Neira Ayuso wrote:
> what do you think about the following solution?
>
>
>> if (len < sizeof(struct nlmsgerr)
>> || len < sizeof(struct nlmsghdr))
>
>
> errno = EBADMSG;
>
>
>>[...]
>> if (addrlen != sizeof(peer))
>
>
> errno = EINVAL;
>
>
>> return -1;
>>
>> if (peer.nl_pid != 0)
>
>
> errno = ENOMSG;
The above all seem fine.
>
>> return -1;
>>
>> nlh = (struct nlmsghdr *)buf;
>> if (nlh->nlmsg_flags & MSG_TRUNC || status > len)
>
>
> errno = ENOSPC;
ENOSPC is fine for MSG_TRUNC, but it is a msghdr flag, not nlmsg.
status > len implies serious recvmsg brokeness and it doesn't
really make sense to check for kernel bugs, so I'd remove it.
next prev parent reply other threads:[~2006-10-11 10:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-29 12:10 [PATCH] libnfnetlink Maik Hentsche
2006-09-29 14:18 ` Patrick McHardy
2006-10-02 13:47 ` Pablo Neira Ayuso
2006-10-11 10:32 ` Patrick McHardy [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-10-09 15:07 Maik Hentsche
2006-10-09 15:14 ` Pablo Neira Ayuso
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=452CC85B.4000105@trash.net \
--to=kaber@trash.net \
--cc=netfilter-devel@lists.netfilter.org \
--cc=netfilter@mm-double.de \
--cc=pablo@netfilter.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.