netdev
[Top] [All Lists]

[PATCH 2.6] fix ipt_ULOG bogus error messages

To: David Miller <davem@xxxxxxxxxxxxx>
Subject: [PATCH 2.6] fix ipt_ULOG bogus error messages
From: Harald Welte <laforge@xxxxxxxxxxxxx>
Date: Mon, 25 Oct 2004 09:44:03 +0200
Cc: Linux Netdev List <netdev@xxxxxxxxxxx>, Netfilter Development Mailinglist <netfilter-devel@xxxxxxxxxxxxxxxxxxx>
Mail-followup-to: Harald Welte <laforge@xxxxxxxxxxxxx>, David Miller <davem@xxxxxxxxxxxxx>, Linux Netdev List <netdev@xxxxxxxxxxx>, Netfilter Development Mailinglist <netfilter-devel@xxxxxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.6+20040907i
Hi Dave!

Please apply the fix below, it addresses some bogus error messages
("error during NLMSG_PUT") that were printed because of a wrong
calculation of the 'len' parameter to NLMSG_PUT().

2.4.x fix will follow.

Thanks!

--- linux-2.6.9/net/ipv4/netfilter/ipt_ULOG.c   2004-10-18 23:53:46.000000000 
+0200
+++ linux-2.6.9-ulog/net/ipv4/netfilter/ipt_ULOG.c      2004-10-25 
09:39:28.150582258 +0200
@@ -1,7 +1,7 @@
 /*
  * netfilter module for userspace packet logging daemons
  *
- * (C) 2000-2002 by Harald Welte <laforge@xxxxxxxxxxxxx>
+ * (C) 2000-2004 by Harald Welte <laforge@xxxxxxxxxxxxx>
  *
  * 2000/09/22 ulog-cprange feature added
  * 2001/01/04 in-kernel queue as proposed by Sebastian Zander 
@@ -13,6 +13,8 @@
  * 2002/07/07 remove broken nflog_rcv() function -HW
  * 2002/08/29 fix shifted/unshifted nlgroup bug -HW
  * 2002/10/30 fix uninitialized mac_len field - <Anders K. Pedersen>
+ * 2004/10/25 fix erroneous calculation of 'len' parameter to NLMSG_PUT
+ *           resulting in bogus 'error during NLMSG_PUT' messages.
  *
  * (C) 1999-2001 Paul `Rusty' Russell
  * (C) 2002-2004 Netfilter Core Team <coreteam@xxxxxxxxxxxxx>
@@ -212,7 +214,7 @@
 
        /* NLMSG_PUT contains a hidden goto nlmsg_failure !!! */
        nlh = NLMSG_PUT(ub->skb, 0, ub->qlen, ULOG_NL_EVENT, 
-                       size - sizeof(*nlh));
+                       sizeof(*pm)+copy_len);
        ub->qlen++;
 
        pm = NLMSG_DATA(nlh);
-- 
- Harald Welte <laforge@xxxxxxxxxxxxx>             http://www.netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie

Attachment: signature.asc
Description: Digital signature

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH 2.6] fix ipt_ULOG bogus error messages, Harald Welte <=