All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Josefsson <gandalf@wlug.westbo.se>
To: Netfilter-devel <netfilter-devel@lists.samba.org>
Subject: [PATCH] don't try to track broadcasts or multicasts (4/4)
Date: 06 Jun 2002 14:24:05 +0200	[thread overview]
Message-ID: <1023366027.845.30.camel@tux> (raw)

[-- Attachment #1: Type: text/plain, Size: 469 bytes --]

There exists code to disable tracking of broadcasts but it's insice a
#if 0 / #endif in ip_conntrack_core.c and looks like some old debugging
code as it has printk's and stuff.

this patch removes that chunk and replaces it with a check so if the
packet is a broadcast or multicast we just return NF_ACCEPT since
there's not much point in us trying to track it.

-- 
/Martin

Never argue with an idiot. They drag you down to their level, then beat
you with experience.

[-- Attachment #2: ip_conntrack_core.c-broadmulti-diff --]
[-- Type: text/plain, Size: 1053 bytes --]

--- linux-2.4.19-pre9/net/ipv4/netfilter/ip_conntrack_core.c.orig	Mon Jun  3 20:32:28 2002
+++ linux-2.4.19-pre9/net/ipv4/netfilter/ip_conntrack_core.c	Tue Jun  4 20:56:18 2002
@@ -737,20 +737,9 @@
 	/* FIXME: Do this right please. --RR */
 	(*pskb)->nfcache |= NFC_UNKNOWN;
 
-/* Doesn't cover locally-generated broadcast, so not worth it. */
-#if 0
-	/* Ignore broadcast: no `connection'. */
-	if ((*pskb)->pkt_type == PACKET_BROADCAST) {
-		printk("Broadcast packet!\n");
+	/* Don't try to track broadcasts or multicasts. */
+	if ((*pskb)->pkt_type == PACKET_BROADCAST || (*pskb)->pkt_type == PACKET_MULTICAST)
 		return NF_ACCEPT;
-	} else if (((*pskb)->nh.iph->daddr & htonl(0x000000FF)) 
-		   == htonl(0x000000FF)) {
-		printk("Should bcast: %u.%u.%u.%u->%u.%u.%u.%u (sk=%p, ptype=%u)\n",
-		       NIPQUAD((*pskb)->nh.iph->saddr),
-		       NIPQUAD((*pskb)->nh.iph->daddr),
-		       (*pskb)->sk, (*pskb)->pkt_type);
-	}
-#endif
 
 	/* Previously seen (loopback)?  Ignore.  Do this before
            fragment check. */

             reply	other threads:[~2002-06-06 12:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-06 12:24 Martin Josefsson [this message]
2002-06-08  7:35 ` [PATCH] don't try to track broadcasts or multicasts (4/4) Harald Welte
2002-06-08 14:51   ` Martin Josefsson
2002-06-09 17:18     ` Harald Welte
2002-06-09 19:35       ` Henrik Nordstrom

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=1023366027.845.30.camel@tux \
    --to=gandalf@wlug.westbo.se \
    --cc=netfilter-devel@lists.samba.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.