From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick McHardy Subject: Re: Netlink error datagrams Date: Tue, 10 Apr 2007 18:50:02 +0200 Message-ID: <461BC03A.7010501@trash.net> References: <20070410040840.GA23429@kallisti.us> <461B4350.3000102@trash.net> <20070410162545.GA25386@kallisti.us> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: netfilter-devel@lists.netfilter.org, Ross Vandegrift To: Ross Vandegrift Return-path: In-Reply-To: <20070410162545.GA25386@kallisti.us> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: netfilter-devel-bounces@lists.netfilter.org Errors-To: netfilter-devel-bounces@lists.netfilter.org List-Id: netfilter-devel.vger.kernel.org Ross Vandegrift wrote: > On Tue, Apr 10, 2007 at 09:57:04AM +0200, Patrick McHardy wrote: > >>What error code does the header contain? > > > Reading through libipq source, ipq_read seems to hand me a (struct nlmsghdr *), > so I've been treating it like so. I'm kind of a newbie at netlink as > well as netfilter, and I don't really see an error code field in > struct nlmsgdr. I'm guessing it's in the ancillary data field, but > I'm not sure how to interpret the data: An error contains a struct nlmsghdr followed by a struct nlmsgerr followed by the message that caused the error. > (gdb) hexdump buf > BFFE0E80 : 24 00 00 00 02 00 00 00 - 00 00 00 00 4A 37 00 00 $...........J7.. ^^ nlmsghdr > BFFE0E90 : FE FF FF FF 1C 00 00 00 - 12 00 01 00 00 00 00 00 ................ nlmsgerr: ^^ error ^^ original msg > BFFE0EA0 : 4A 37 00 00 65 74 68 30 - 00 00 00 00 00 00 00 00 J7..eth0........ So the error is 0xFEFFFFFF, which (assuming your machine is big-endian) is -2 or -ENOENT. The only case where this can happen is if you send a verdict for a non-existant queue entry.