[prev in list] [next in list] [prev in thread] [next in thread] 

List:       netfilter-devel
Subject:    Re: [PATCH] libnfnetlink
From:       Patrick McHardy <kaber () trash ! net>
Date:       2006-09-29 14:18:35
Message-ID: 451D2B3B.7070604 () trash ! net
[Download RAW message or body]

Maik Hentsche wrote:
> Hello Pablo, hello readers of the list,
> I found another bug in libnfnetlink. The comment of nfnl_recv states, in
> case of success 0 is returned. In fact at success the returnvalue of
> recvfrom is returned, which is the number of received bytes
> (libnfnetlink_recv_comment.patch). The second issue is a little more
> serious. The comment states, in case of an error, errno is set when in
> fact it is not. I appended a patch for two occurences, but I since I
> don't know, in which case addrlen might be != sizeof(peer) and what
> peer.nl_pid means (and therefore why it is a problem, if it's not 0)
> two error cases without appropriate errno value still exist.

addrlen != sizeof(peer) should never happen. I can't think of anything
better than EINVAL. nl_pid != 0 means the message originated in
userspace and some other program is trying to feed us messages.
We could handle this by just calling recvmsg again. But this is mainly
because I can't think of a proper errno code for this either :)

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic