[PATCH] ip_masq compile prob in 2.3.8-2 (was Re: [patch] Re: Compile error report pre-2.3.8-2)

Steve Dodd (dirk@loth.demon.co.uk)
Wed, 23 Jun 1999 00:40:23 +0100


On Tue, Jun 22, 1999 at 06:11:48PM -0300, Marcelo Tosatti wrote:

> Lots of places missing #ifdef __SMP__
> Should compile with this patch...

> +#ifdef __SMP__
> spin_lock_irq(&masq_port_lock);
> +#endif
[..times lots]

Blech.

Much easier to just always declare the spinlock. On UP, spinlock_t doesn't
take any space and spin_{un,}lock* are optimized away anyway:

--- linux/net/ipv4/ip_masq.c.orig Wed Jun 23 00:25:20 1999
+++ linux/net/ipv4/ip_masq.c Wed Jun 23 00:25:39 1999
@@ -315,9 +315,7 @@
* Will cycle in MASQ_PORT boundaries.
*/
static __u16 masq_port = PORT_MASQ_BEGIN;
-#ifdef __SMP__
static spinlock_t masq_port_lock = SPIN_LOCK_UNLOCKED;
-#endif

/*
* free ports counters (UDP & TCP)

PS, I think we're supposed to be moving to CONFIG_SMP instead of __SMP__
anyway, aren't we?

-- 
The URL nobody must see: http://<CENSORED BY DEMON INTERNET's LEGAL DROIDS>

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/