netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@kernel.org>
To: David Miller <davem@davemloft.net>
Cc: david-b@pacbell.net, randy.dunlap@oracle.com,
	toralf.foerster@gmx.de, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
Subject: [2.6 patch] ipv4/arp.c:arp_process(): remove bogus #ifdef mess
Date: Sun, 25 Nov 2007 17:30:03 +0100	[thread overview]
Message-ID: <20071125163003.GC21947@stusta.de> (raw)
In-Reply-To: <20071119.212639.217993660.davem@davemloft.net>

On Mon, Nov 19, 2007 at 09:26:39PM -0800, David Miller wrote:
> From: Adrian Bunk <bunk@kernel.org>
> Date: Thu, 8 Nov 2007 04:30:10 +0100
> 
> > @davem:
> > 
> > Please look at net/ipv4/arp.c:arp_process()
> > 
> > Am I right that CONFIG_NET_ETHERNET=n and CONFIG_NETDEV_1000=y or 
> > CONFIG_NETDEV_10000=y will not be handled correctly there?
> > 
> > And the best solution is to nuke all #ifdef's in this function and make 
> > the code unconditionally available?
> 
> I think removing those specific ifdefs in arp_process()
> is the best option, yes.

Patch below.

cu
Adrian


<--  snip  -->


The #ifdef's in arp_process() were not only a mess, they were also wrong 
in the CONFIG_NET_ETHERNET=n and (CONFIG_NETDEV_1000=y or 
CONFIG_NETDEV_10000=y) cases.

Since they are not required this patch removes them.

Also removed are some #ifdef's around #include's that caused compile 
errors after this change.

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---

 net/ipv4/arp.c |   19 -------------------
 1 file changed, 19 deletions(-)

759b820456b1400b2a6b061eca9667bf7a6f053d 
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 36d6798..0c5d549 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -111,12 +111,8 @@
 #include <net/tcp.h>
 #include <net/sock.h>
 #include <net/arp.h>
-#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
 #include <net/ax25.h>
-#if defined(CONFIG_NETROM) || defined(CONFIG_NETROM_MODULE)
 #include <net/netrom.h>
-#endif
-#endif
 #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE)
 #include <net/atmclip.h>
 struct neigh_table *clip_tbl_hook;
@@ -731,20 +727,10 @@ static int arp_process(struct sk_buff *skb)
 		    htons(dev_type) != arp->ar_hrd)
 			goto out;
 		break;
-#ifdef CONFIG_NET_ETHERNET
 	case ARPHRD_ETHER:
-#endif
-#ifdef CONFIG_TR
 	case ARPHRD_IEEE802_TR:
-#endif
-#ifdef CONFIG_FDDI
 	case ARPHRD_FDDI:
-#endif
-#ifdef CONFIG_NET_FC
 	case ARPHRD_IEEE802:
-#endif
-#if defined(CONFIG_NET_ETHERNET) || defined(CONFIG_TR) || \
-    defined(CONFIG_FDDI)	 || defined(CONFIG_NET_FC)
 		/*
 		 * ETHERNET, Token Ring and Fibre Channel (which are IEEE 802
 		 * devices, according to RFC 2625) devices will accept ARP
@@ -759,21 +745,16 @@ static int arp_process(struct sk_buff *skb)
 		    arp->ar_pro != htons(ETH_P_IP))
 			goto out;
 		break;
-#endif
-#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
 	case ARPHRD_AX25:
 		if (arp->ar_pro != htons(AX25_P_IP) ||
 		    arp->ar_hrd != htons(ARPHRD_AX25))
 			goto out;
 		break;
-#if defined(CONFIG_NETROM) || defined(CONFIG_NETROM_MODULE)
 	case ARPHRD_NETROM:
 		if (arp->ar_pro != htons(AX25_P_IP) ||
 		    arp->ar_hrd != htons(ARPHRD_NETROM))
 			goto out;
 		break;
-#endif
-#endif
 	}
 
 	/* Understand only these message types */

  reply	other threads:[~2007-11-25 16:30 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200711012024.57412.toralf.foerster@gmx.de>
2007-11-01 21:11 ` build #337 failed for 2.6.24-rc1-gb1d08ac In function `usbnet_set_settings': Randy Dunlap
2007-11-01 23:32   ` David Brownell
2007-11-01 23:44     ` Adrian Bunk
2007-11-02 18:45       ` David Brownell
2007-11-02 18:57         ` Adrian Bunk
2007-11-02 19:30           ` David Brownell
2007-11-02 19:55             ` Adrian Bunk
2007-11-07 22:34               ` David Brownell
2007-11-07 22:52                 ` Adrian Bunk
2007-11-08  2:53                   ` David Brownell
2007-11-08  3:23                     ` Adrian Bunk
2007-11-08  3:30                   ` Adrian Bunk
2007-11-08 16:08                     ` Randy Dunlap
2007-11-20  5:26                     ` David Miller
2007-11-25 16:30                       ` Adrian Bunk [this message]
2007-11-26 15:19                         ` [2.6 patch] ipv4/arp.c:arp_process(): remove bogus #ifdef mess Herbert Xu
2007-11-26 20:25                           ` Adrian Bunk
2007-11-02 20:05         ` build #337 failed for 2.6.24-rc1-gb1d08ac In function `usbnet_set_settings': Adrian Bunk
2007-11-07  8:20     ` David Miller
2007-11-07 22:15       ` David Brownell
2007-11-01 22:25 ` [2.6 patch] let USB_USBNET always select MII Adrian Bunk
2007-11-01 23:52   ` David Brownell
2007-11-02 15:46     ` [2.6 patch] usbnet.c: check for the right MII variable Adrian Bunk
2007-11-07 22:31       ` David Brownell
2007-11-07  8:10   ` [2.6 patch] let USB_USBNET always select MII David Miller

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=20071125163003.GC21947@stusta.de \
    --to=bunk@kernel.org \
    --cc=davem@davemloft.net \
    --cc=david-b@pacbell.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=randy.dunlap@oracle.com \
    --cc=toralf.foerster@gmx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).