All of lore.kernel.org
 help / color / mirror / Atom feed
From: philipc@snapgear.com
To: netfilter-devel@lists.netfilter.org
Subject: [PATCH 3/4] log dropped ICMP redirects
Date: Wed, 24 May 2006 14:04:44 +1000	[thread overview]
Message-ID: <20060524040951.092582000@snapgear.com> (raw)
In-Reply-To: 20060524040441.111049000@snapgear.com

[-- Attachment #1: invalidicmpredirect.patch --]
[-- Type: text/plain, Size: 1393 bytes --]

Log dropped ICMP redirects for untracked connections.

This was required to meet a certification test.  But there are
many more locations that can drop packets without logging them,
which weren't tested for certification.  Should all instances of
NF_DROP in netfilter/iptables have a call to nf_log_packet?

Signed-off-by: Philip Craig <philipc@snapgear.com>

Index: linux-2.6.17-rc4.orig/net/ipv4/netfilter/ip_nat_standalone.c
===================================================================
--- linux-2.6.17-rc4.orig.orig/net/ipv4/netfilter/ip_nat_standalone.c	2006-05-24 11:57:28.000000000 +1000
+++ linux-2.6.17-rc4.orig/net/ipv4/netfilter/ip_nat_standalone.c	2006-05-24 13:22:38.000000000 +1000
@@ -41,6 +41,7 @@
 #include <linux/netfilter_ipv4/ip_nat_helper.h>
 #include <linux/netfilter_ipv4/ip_tables.h>
 #include <linux/netfilter_ipv4/ip_conntrack_core.h>
+#include <linux/netfilter_ipv4/ip_conntrack_protocol.h>
 #include <linux/netfilter_ipv4/listhelp.h>
 
 #if 0
@@ -132,8 +133,13 @@ ip_nat_fn(unsigned int hooknum,
 						(*pskb)->nh.iph->ihl*4,
 						sizeof(_hdr), &_hdr);
 			if (hp != NULL &&
-			    hp->type == ICMP_REDIRECT)
+			    hp->type == ICMP_REDIRECT) {
+				if (LOG_INVALID(IPPROTO_ICMP))
+					nf_log_packet(PF_INET, 0, *pskb,
+						NULL, NULL, NULL, "ip_nat: "
+						"untracked ICMP redirect ");
 				return NF_DROP;
+			}
 		}
 		return NF_ACCEPT;
 	}

--

  parent reply	other threads:[~2006-05-24  4:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-24  4:04 [PATCH 0/4] netfilter patches for consideration philipc
2006-05-24  4:04 ` [PATCH 1/4] TCPMSS: dont drop packets philipc
2006-05-24 16:16   ` Patrick McHardy
2006-05-24 23:42     ` Philip Craig
2006-05-26 14:40       ` Patrick McHardy
2006-05-24  4:04 ` [PATCH 2/4] TCPMSS: clamp to input interface MTU too philipc
2006-05-24 16:18   ` Patrick McHardy
2006-05-24  4:04 ` philipc [this message]
2006-05-24 16:26   ` [PATCH 3/4] log dropped ICMP redirects Patrick McHardy
2006-05-25  2:34     ` Philip Craig
2006-05-26 14:49       ` Patrick McHardy
2006-05-24  4:04 ` [PATCH 4/4] drop ftp bounce attacks philipc
2006-05-24 16:31   ` Patrick McHardy
2006-05-25  2:55     ` Philip Craig
2006-05-26 14:51       ` Patrick McHardy

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=20060524040951.092582000@snapgear.com \
    --to=philipc@snapgear.com \
    --cc=netfilter-devel@lists.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.