]> pilppa.org Git - linux-2.6-omap-h63xx.git/log
linux-2.6-omap-h63xx.git
17 years agoARM: OMAP2: Clean up 24xx clock code
Tony Lindgren [Tue, 18 Mar 2008 09:56:39 +0000 (11:56 +0200)]
ARM: OMAP2: Clean up 24xx clock code

Clean up 24xx clock code to sync it with linux-omap tree.

Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoARM: OMAP2: Remove old 24xx specific clock functions
Paul Walmsley [Tue, 18 Mar 2008 08:53:16 +0000 (10:53 +0200)]
ARM: OMAP2: Remove old 24xx specific clock functions

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoARM: OMAP: Add rest of 24xx clocks
Paul Walmsley [Tue, 18 Mar 2008 13:47:55 +0000 (15:47 +0200)]
ARM: OMAP: Add rest of 24xx clocks

This patch adds the rest of clocks for 24xx.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoARM: OMAP2: Change 24xx to use shared clock code and new reg access
Paul Walmsley [Tue, 18 Mar 2008 08:35:15 +0000 (10:35 +0200)]
ARM: OMAP2: Change 24xx to use shared clock code and new reg access

This patch changes 24xx to use shared clock code and new register
access.

Note that patch adds some temporary OLD_CK defines to keep patch
more readable. These temporary defines will be removed in the next
patch. Also not all clocks are changed in this patch to limit the
size.

Also, the patch fixes few incorrect clock defines in clock24xx.h.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoARM: OMAP2: Add common clock framework for 24xx and 34xx
Paul Walmsley [Tue, 18 Mar 2008 08:22:06 +0000 (10:22 +0200)]
ARM: OMAP2: Add common clock framework for 24xx and 34xx

This patch adds a common clock framework for 24xx and 34xx.
Note that this patch does not add it to Makefile until in
next patch. Some functions are modified from earlier 24xx
clock framework code.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoARM: OMAP2: Move clock.c to clock24xx.c
Paul Walmsley [Tue, 18 Mar 2008 12:41:40 +0000 (14:41 +0200)]
ARM: OMAP2: Move clock.c to clock24xx.c

This patch moves clock.h to clock24xx.c to make room for
adding common clock code for 24xx and 34xx.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoARM: OMAP2: Move clock.h to clock24xx.h
Paul Walmsley [Tue, 18 Mar 2008 08:15:28 +0000 (10:15 +0200)]
ARM: OMAP2: Move clock.h to clock24xx.h

This patch moves clock.h to clock24xx.h to make room for
adding common clock code for 24xx and 34xx.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoARM: OMAP2: Remove old 24xx PM code
Tony Lindgren [Tue, 18 Mar 2008 08:59:00 +0000 (10:59 +0200)]
ARM: OMAP2: Remove old 24xx PM code

This patch removes old 24xx PM code that does not really work for sleep
states, and uses old power management register access. Working PM code
will be added later.

Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoARM: OMAP2: Change 24xx to use new register access
Paul Walmsley [Tue, 18 Mar 2008 08:04:51 +0000 (10:04 +0200)]
ARM: OMAP2: Change 24xx to use new register access

This patch changes 24xx to use new register access, except for clock
framework. Clock framework register access will get updates in the
next patch.

Note that board-*.c files change GPMC (General Purpose Memory Controller)
access to use gpmc_cs_write_reg() instead of accessing the registers
directly. The code also uses gpmc_fck instead of it's parent clock
core_l3_ck for GPMC clock.

The H4 board file also adds h4_init_flash() function, which specify the
flash start and end addresses.

Also note that sleep.S removes some unused registers addresses.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoARM: OMAP2: Add register access for 34xx
Tony Lindgren [Tue, 18 Mar 2008 12:53:17 +0000 (14:53 +0200)]
ARM: OMAP2: Add register access for 34xx

This patch adds register access for 34xx power and clock management.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoARM: OMAP2: Add common register access for 24xx and 34xx
Paul Walmsley [Tue, 18 Mar 2008 08:02:50 +0000 (10:02 +0200)]
ARM: OMAP2: Add common register access for 24xx and 34xx

This patch adds common register access for 24xx and 34xx power
and clock management in order to share code between 24xx and 34xx.

Only change USB platform init code to use new register access, other
access will be changed in later patches.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoARM: OMAP2: Clean-up mux code
Tony Lindgren [Fri, 25 Jan 2008 01:24:15 +0000 (17:24 -0800)]
ARM: OMAP2: Clean-up mux code

Misc clean-up for the mux code and remove some unnecessary
ifdefs. Patch changes debug function so it can be used on
both 24xx and 34xx.

Changes are mostly for omap2, but patch also cleans up some
omap1 and common mux code.

Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoARM: OMAP2: Add new pin multiplexing configurations
Tony Lindgren [Thu, 20 Mar 2008 14:56:26 +0000 (16:56 +0200)]
ARM: OMAP2: Add new pin multiplexing configurations

Add new pin multiplexing configurations

Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoARM: OMAP: TimerMPU: Remove MPU-timer based sched_clock()
Kevin Hilman [Tue, 13 Nov 2007 07:24:04 +0000 (23:24 -0800)]
ARM: OMAP: TimerMPU: Remove MPU-timer based sched_clock()

Remove MPU-timer based sched_clock() in favor of the common one based
on 32k sync timer which works across all OMAP1/2/3 platforms.

Using 32k based one also gives a valid sched_clock() very early in the
boot process.

Signed-off-by: Kevin Hilman <khilman@mvista.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoARM: OMAP: TimerMPU: Remove unused cycles-to-nsec conversions
Kevin Hilman [Thu, 13 Dec 2007 02:25:56 +0000 (18:25 -0800)]
ARM: OMAP: TimerMPU: Remove unused cycles-to-nsec conversions

These are no longer used and similar conversions are provided
by the clocksource/clockevent code.

Signed-off-by: Kevin Hilman <khilman@mvista.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoARM: OMAP1: Timer32K: Fix timer32K for clockevents and clean it up
Tony Lindgren [Thu, 13 Mar 2008 06:47:21 +0000 (08:47 +0200)]
ARM: OMAP1: Timer32K: Fix timer32K for clockevents and clean it up

This patch fixes timer32k for clockevents and syncs it with
linux-omap tree.

Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoARM: OMAP: Timer32K: Move timer32k to mach-omap1
Kevin Hilman [Tue, 13 Nov 2007 07:24:05 +0000 (23:24 -0800)]
ARM: OMAP: Timer32K: Move timer32k to mach-omap1

Move now OMAP1-specific timer32k code to mach-omap1 since OMAP2/3 32k
timers are done in gptimer code.

Signed-off-by: Kevin Hilman <khilman@mvista.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoARM: OMAP: Timer32K: Move 32k-based sched_clock() to common code
Kevin Hilman [Tue, 13 Nov 2007 07:24:03 +0000 (23:24 -0800)]
ARM: OMAP: Timer32K: Move 32k-based sched_clock() to common code

Since 32k timer code is moving to OMAP1 specific dir, move the
32k-based sched_clock() into common code where it is based on the 32k
sync counter and can be used even when using MPU timer.

While moving, change the ticks-to-nsecs conversion to use the helper
functions provided by clocksource.h.

Also removed the unused ticks_to_usec, leaving only ticks_to_nsec.

Signed-off-by: Kevin Hilman <khilman@mvista.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoARM: OMAP: Timer32K: Re-organize duplicated 32k-timer code
Kevin Hilman [Tue, 13 Nov 2007 07:24:02 +0000 (23:24 -0800)]
ARM: OMAP: Timer32K: Re-organize duplicated 32k-timer code

On OMAP2/3, the gp-timer code can be used for a 32kHz timer simply by
setting the source to be the 32k clock instead of sys_clk.

This patch uses the mach-omap2/timer-gp.c code for 32kHz timer on
OMAP2, moving the logic into mach-omap2/timer-gp.c, and not using
plat-omap/timer32k.c which, for OMAP2, is redundant with the timer-gp
code.

Also, if CONFIG_OMAP_32K_TIMER is enabled, the gptimer-based
clocksource is not used.  Instead the default 32k sync counter is used
as the clocksource (see the clocksource in plat-omap/common.c.)  This
is important for sleep/suspend so there is a valid counter during
sleep.  Note that the suspend/sleep code needs fixing to check for
overflows of this counter.

In addition, the OMAP2/3 details are removed from timer32k.c leaving
that with only OMAP1 specifics.  A follow-up patch will move it from
plat-omap common code to mach-omap1.

Signed-off-by: Kevin Hilman <khilman@mvista.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoARM: OMAP: Split omap_cfg_reg() into omap processor specific functions
Tony Lindgren [Fri, 25 Jan 2008 08:42:48 +0000 (00:42 -0800)]
ARM: OMAP: Split omap_cfg_reg() into omap processor specific functions

Use omap processor specific function depending on system type.
Based on an earlier patch by Klaus Pedersen <klaus.k.pedersen@nokia.com>.

Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoARM: OMAP: Allow registering pin mux function
Tony Lindgren [Fri, 25 Jan 2008 08:42:48 +0000 (00:42 -0800)]
ARM: OMAP: Allow registering pin mux function

This patch changes pin multiplexing init to allow registering
custom function. The omap_cfg_reg() func will be split into
omap processor specific functions in later patch.

This is done to make adding omap3 pin multiplexing easier.

Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoARM: OMAP: use edge/level handlers from generic IRQ framework
Kevin Hilman [Thu, 17 Jan 2008 05:56:16 +0000 (21:56 -0800)]
ARM: OMAP: use edge/level handlers from generic IRQ framework

Currently, the GPIO interrupt handling is duplicating some of the work
done by the generic IRQ handlers (handle_edge_irq, handle_level_irq)
such as detecting nesting, handling re-triggers etc.  Remove this
duplication and use generic hooks based on IRQ type.

Using generic IRQ handlers ensures correct behavior when using
threaded interrupts introduced by the -rt patch.

Signed-off-by: Kevin Hilman <khilman@mvista.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoARM: OMAP: Clear level-triggered GPIO interrupts in unmask hook
Kevin Hilman [Thu, 17 Jan 2008 05:56:15 +0000 (21:56 -0800)]
ARM: OMAP: Clear level-triggered GPIO interrupts in unmask hook

The clearing was moved to the unmask hook because it is known to run
after the interrupt handler has actually run.  Before this patch, if
interrupts are threaded, the clearing/unmasking of level triggered
interrupts would be done before the threaded handler actually ran.

Signed-off-by: Kevin Hilman <khilman@mvista.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoARM: OMAP: Use gpiolib with tps65010 for OSK 5912
David Brownell [Fri, 29 Feb 2008 06:09:15 +0000 (22:09 -0800)]
ARM: OMAP: Use gpiolib with tps65010 for OSK 5912

Convert OSK board to use new tps65010 gpiolib support.  This
includes moving its LED support from leds-osk to gpio-leds,
giving more trigger options and a net platform code shrink.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoARM: OMAP: I2C: tps65010 driver converts to gpiolib
David Brownell [Fri, 29 Feb 2008 06:07:28 +0000 (22:07 -0800)]
ARM: OMAP: I2C: tps65010 driver converts to gpiolib

Make the tps65010 driver use gpiolib to expose its GPIOs.

Note: This patch will get merged via omap tree instead of I2C
as it will cause some board updates. This has been discussed
at on the I2C list:

http://lists.lm-sensors.org/pipermail/i2c/2008-March/003031.html

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: i2c@lm-sensors.org
Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoARM: OMAP: 5912 OSK GPIO updates
David Brownell [Tue, 26 Feb 2008 08:01:23 +0000 (00:01 -0800)]
ARM: OMAP: 5912 OSK GPIO updates

Start cleaning up GPIO handling for OMAP5912 OSK board:

 - Initialize GPIOs using the cross-platform calls, not the old
   OMAP-private ones.

 - Move touchscreen setup out of ads7846 code into board-specfic
   setup code, where it belongs.

This doesn't depend on the patches to update OMAP to use the
gpiolib implementation framework.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoARM: OMAP: Use gpiolib
David Brownell [Mon, 3 Mar 2008 20:43:23 +0000 (12:43 -0800)]
ARM: OMAP: Use gpiolib

Update OMAP to use the new GPIO implementation framework.  This is just a
quick'n'dirty update ... more code could now be removed, ideally as part
of cleaning up the entire OMAP GPIO infrastructure ...

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
17 years agoslub: No need for per node slab counters if !SLUB_DEBUG
Christoph Lameter [Mon, 14 Apr 2008 15:53:02 +0000 (18:53 +0300)]
slub: No need for per node slab counters if !SLUB_DEBUG

The per node counters are used mainly for showing data through the sysfs API.
If that API is not compiled in then there is no point in keeping track of this
data. Disable counters for the number of slabs and the number of total slabs
if !SLUB_DEBUG. Incrementing the per node counters is also accessing a
potentially contended cacheline so this could actually be a performance
benefit to embedded systems.

SLABINFO support is also affected. It now must depends on SLUB_DEBUG (which
is on by default).

Patch also avoids a check for a NULL kmem_cache_node pointer in new_slab()
if the system is not compiled with NUMA support.

[penberg@cs.helsinki.fi: fix oops and move ->nr_slabs into CONFIG_SLUB_DEBUG]
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
17 years agoslub: Move map/flag clearing to __free_slab
Christoph Lameter [Mon, 14 Apr 2008 15:52:18 +0000 (18:52 +0300)]
slub: Move map/flag clearing to __free_slab

__free_slab does some diagnostics. The resetting of mapcount etc
in discard_slab() can interfere with debug processing. So move
the reset immediately before the page is freed.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
17 years agoslub: Fixes to per cpu stat output in sysfs
Christoph Lameter [Mon, 14 Apr 2008 15:52:05 +0000 (18:52 +0300)]
slub: Fixes to per cpu stat output in sysfs

Only output per cpu stats if the kernel is build for SMP.

Use a capital "C" as a leading character for the processor number
(same as the numa statistics that also use a capital letter "N").

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
17 years agoslub: Deal with config variable dependencies
Christoph Lameter [Mon, 14 Apr 2008 15:51:34 +0000 (18:51 +0300)]
slub: Deal with config variable dependencies

count_partial() is used by both slabinfo and the sysfs proc support. Move
the function directly before the beginning of the sysfs code so that it can
be easily found. Rework the preprocessor conditional to take into account
that slub sysfs support depends on CONFIG_SYSFS *and* CONFIG_SLUB_DEBUG.

Make CONFIG_SLUB_STATS depend on CONFIG_SLUB_DEBUG and CONFIG_SYSFS. There
is no point of keeping statistics if no one can restrive them.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
17 years agoslub: Reduce #ifdef ZONE_DMA by moving kmalloc_caches_dma near dma logic
Christoph Lameter [Mon, 14 Apr 2008 15:51:18 +0000 (18:51 +0300)]
slub: Reduce #ifdef ZONE_DMA by moving kmalloc_caches_dma near dma logic

Move the definition of kmalloc_caches_dma() into a later #ifdef CONFIG_ZONE_DMA.
This saves one #ifdef and leaves us with a total of two #ifdefs for dma slab support.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
17 years agoslub: Initialize per-cpu stats
Pekka Enberg [Mon, 14 Apr 2008 15:50:44 +0000 (18:50 +0300)]
slub: Initialize per-cpu stats

As spotted by kmemcheck, we need to initialize the per-CPU ->stat array before
using it.

[kmem_cache_cpu structures are usually allocated from arrays defined via
DEFINE_PER_CPU that are zeroed so we have not noticed this so far --cl].

Reported-by: Vegard Nossum <vegard.nossum@gmail.com>
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
17 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux...
Linus Torvalds [Mon, 14 Apr 2008 15:10:27 +0000 (08:10 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched-devel

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched-devel:
  revert "sched: fix fair sleepers"

17 years agoMerge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzi...
Linus Torvalds [Mon, 14 Apr 2008 14:57:07 +0000 (07:57 -0700)]
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  [libata] make ali_atapi_dma static
  [libata] sata_svw: fix reversed port count

17 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Mon, 14 Apr 2008 14:56:24 +0000 (07:56 -0700)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (31 commits)
  [BRIDGE]: Fix crash in __ip_route_output_key with bridge netfilter
  [NETFILTER]: ipt_CLUSTERIP: fix race between clusterip_config_find_get and _entry_put
  [IPV6] ADDRCONF: Don't generate temporary address for ip6-ip6 interface.
  [IPV6] ADDRCONF: Ensure disabling multicast RS even if privacy extensions are disabled.
  [IPV6]: Use appropriate sock tclass setting for routing lookup.
  [IPV6]: IPv6 extension header structures need to be packed.
  [IPV6]: Fix ipv6 address fetching in raw6_icmp_error().
  [NET]: Return more appropriate error from eth_validate_addr().
  [ISDN]: Do not validate ISDN net device address prior to interface-up
  [NET]: Fix kernel-doc for skb_segment
  [SOCK] sk_stamp: should be initialized to ktime_set(-1L, 0)
  net: check for underlength tap writes
  net: make struct tun_struct private to tun.c
  [SCTP]: IPv4 vs IPv6 addresses mess in sctp_inet[6]addr_event.
  [SCTP]: Fix compiler warning about const qualifiers
  [SCTP]: Fix protocol violation when receiving an error lenght INIT-ACK
  [SCTP]: Add check for hmac_algo parameter in sctp_verify_param()
  [NET_SCHED] cls_u32: refcounting fix for u32_delete()
  [DCCP]: Fix skb->cb conflicts with IP
  [AX25]: Potential ax25_uid_assoc-s leaks on module unload.
  ...

17 years agoFRV: Correctly determine the address of an illegal instruction
David Howells [Mon, 14 Apr 2008 10:20:59 +0000 (11:20 +0100)]
FRV: Correctly determine the address of an illegal instruction

Correctly determine the address of an illegal instruction.  The EPCR0 register
holds this value (masked by EPCR0_PC) if the validity bit is set (masked by
EPCR0_V).  So the test as to whether the contents of the register are usable
should be involve checking the _V bit, not the _PC bits.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agorevert "sched: fix fair sleepers"
Ingo Molnar [Mon, 14 Apr 2008 06:50:02 +0000 (08:50 +0200)]
revert "sched: fix fair sleepers"

revert "sched: fix fair sleepers" (e22ecef1d2658ba54ed7d3fdb5d60829fb434c23),
because it is causing audio skipping, see:

   http://bugzilla.kernel.org/show_bug.cgi?id=10428

the patch is correct and the real cause of the skipping is not
understood (tracing makes it go away), but time has run out so we'll
revert it and re-try in 2.6.26.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
17 years ago[POWERPC] Fix handling of unrecoverable SLB miss interrupts
Paul Mackerras [Mon, 14 Apr 2008 03:59:02 +0000 (13:59 +1000)]
[POWERPC] Fix handling of unrecoverable SLB miss interrupts

If an SLB miss interrupt happens while the RI bit of MSR is zero, we
can't just return, because RI being zero indicates that SRR0/SRR1
potentially had live values in them, and the process of taking an
interrupt overwrites them.

This should never happen, but if it does, we try to print a nice oops
message.  That doesn't work, however, because the code at unrecov_slb
assumes that the MMU has been turned on, but we call it with the MMU
off (and have done so since the SLB miss handler was rewritten to run
without turning the MMU on) -- except on iSeries, where everything runs
with the MMU on.

This fixes it by adding the necessary code to turn the MMU on if
necessary.

Signed-off-by: Paul Mackerras <paulus@samba.org>
17 years agoMerge branch 'linux-2.6'
Paul Mackerras [Mon, 14 Apr 2008 11:11:02 +0000 (21:11 +1000)]
Merge branch 'linux-2.6'

17 years ago[TCP]: Format addresses appropriately in debug messages.
YOSHIFUJI Hideaki [Mon, 14 Apr 2008 11:09:36 +0000 (04:09 -0700)]
[TCP]: Format addresses appropriately in debug messages.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[IPV4]: Use NIPQUAD_FMT to format ipv4 addresses.
YOSHIFUJI Hideaki [Mon, 14 Apr 2008 11:09:00 +0000 (04:09 -0700)]
[IPV4]: Use NIPQUAD_FMT to format ipv4 addresses.

And use %u to format port.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2...
David S. Miller [Mon, 14 Apr 2008 10:50:43 +0000 (03:50 -0700)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6.26

17 years ago[SOCK]: Add some notes about per-bind-bucket sock lookup.
Pavel Emelyanov [Mon, 14 Apr 2008 09:42:27 +0000 (02:42 -0700)]
[SOCK]: Add some notes about per-bind-bucket sock lookup.

I was asked about "why don't we perform a sk_net filtering in
bind_conflict calls, like we do in other sock lookup places"
for a couple of times.

Can we please add a comment about why we do not need one?

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[DCCP]: Fix comment about control sockets.
Pavel Emelyanov [Mon, 14 Apr 2008 09:38:45 +0000 (02:38 -0700)]
[DCCP]: Fix comment about control sockets.

These sockets now have a bit other names and are no longer global.

Shame on me, I haven't provided a good comment for this when
sending DCCP netnsization patches.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
David S. Miller [Mon, 14 Apr 2008 09:30:23 +0000 (02:30 -0700)]
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

Conflicts:

drivers/net/ehea/ehea_main.c
drivers/net/wireless/iwlwifi/Kconfig
drivers/net/wireless/rt2x00/rt61pci.c
net/ipv4/inet_timewait_sock.c
net/ipv6/raw.c
net/mac80211/ieee80211_sta.c

17 years ago[NETFILTER]: nf_conntrack: fix incorrect check for expectations
Patrick McHardy [Mon, 14 Apr 2008 09:21:01 +0000 (11:21 +0200)]
[NETFILTER]: nf_conntrack: fix incorrect check for expectations

The expectation classes changed help->expectations to an array,
fix use as scalar value.

Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: bridge: add ebt_nflog watcher
Peter Warasin [Mon, 14 Apr 2008 09:15:54 +0000 (11:15 +0200)]
[NETFILTER]: bridge: add ebt_nflog watcher

This patch adds the ebtables nflog watcher to the kernel in order to
allow ebtables log through the nfnetlink_log backend.

Signed-off-by: Peter Warasin <peter@endian.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: nf_conntrack: replace NF_CT_DUMP_TUPLE macro indrection by function...
Jan Engelhardt [Mon, 14 Apr 2008 09:15:54 +0000 (11:15 +0200)]
[NETFILTER]: nf_conntrack: replace NF_CT_DUMP_TUPLE macro indrection by function call

Directly call IPv4 and IPv6 variants where the address family is
easily known.

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: nf_conntrack: const annotations in nf_conntrack_sctp, nf_nat_proto_gre
Jan Engelhardt [Mon, 14 Apr 2008 09:15:54 +0000 (11:15 +0200)]
[NETFILTER]: nf_conntrack: const annotations in nf_conntrack_sctp, nf_nat_proto_gre

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: nf_nat: use bool type in nf_nat_proto
Jan Engelhardt [Mon, 14 Apr 2008 09:15:53 +0000 (11:15 +0200)]
[NETFILTER]: nf_nat: use bool type in nf_nat_proto

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: nf_conntrack: use bool type in struct nf_conntrack_tuple.h
Jan Engelhardt [Mon, 14 Apr 2008 09:15:53 +0000 (11:15 +0200)]
[NETFILTER]: nf_conntrack: use bool type in struct nf_conntrack_tuple.h

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: nf_conntrack: use bool type in struct nf_conntrack_l4proto
Jan Engelhardt [Mon, 14 Apr 2008 09:15:53 +0000 (11:15 +0200)]
[NETFILTER]: nf_conntrack: use bool type in struct nf_conntrack_l4proto

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: nf_conntrack: use bool type in struct nf_conntrack_l3proto
Jan Engelhardt [Mon, 14 Apr 2008 09:15:52 +0000 (11:15 +0200)]
[NETFILTER]: nf_conntrack: use bool type in struct nf_conntrack_l3proto

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: Remove unused callbacks in nf_conntrack_l3proto
Jan Engelhardt [Mon, 14 Apr 2008 09:15:52 +0000 (11:15 +0200)]
[NETFILTER]: Remove unused callbacks in nf_conntrack_l3proto

These functions are never called.

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: nf_conntrack: add tuplehash l3num/protonum accessors
Patrick McHardy [Mon, 14 Apr 2008 09:15:52 +0000 (11:15 +0200)]
[NETFILTER]: nf_conntrack: add tuplehash l3num/protonum accessors

Add accessors for l3num and protonum and get rid of some overly long
expressions.

Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: nf_conntrack_tcp: catch invalid state updates over ctnetlink
Patrick McHardy [Mon, 14 Apr 2008 09:15:52 +0000 (11:15 +0200)]
[NETFILTER]: nf_conntrack_tcp: catch invalid state updates over ctnetlink

Invalid states can cause out-of-bound memory accesses of the state table.
Also don't insist on having a new state contained in the netlink message.

Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: nf_nat: kill helper and seq_adjust hooks
Patrick McHardy [Mon, 14 Apr 2008 09:15:52 +0000 (11:15 +0200)]
[NETFILTER]: nf_nat: kill helper and seq_adjust hooks

Connection tracking helpers (specifically FTP) need to be called
before NAT sequence numbers adjustments are performed to be able
to compare them against previously seen ones. We've introduced
two new hooks around 2.6.11 to maintain this ordering when NAT
modules were changed to get called from conntrack helpers directly.

The cost of netfilter hooks is quite high and sequence number
adjustments are only rarely needed however. Add a RCU-protected
sequence number adjustment function pointer and call it from
IPv4 conntrack after calling the helper.

Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: nf_conntrack_extend: warn on confirmed conntracks
Patrick McHardy [Mon, 14 Apr 2008 09:15:51 +0000 (11:15 +0200)]
[NETFILTER]: nf_conntrack_extend: warn on confirmed conntracks

New extensions may only be added to unconfirmed conntracks to avoid races
when reallocating the storage.

Also change NF_CT_ASSERT to use WARN_ON to get backtraces.

Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: nf_nat: don't add NAT extension for confirmed conntracks
Patrick McHardy [Mon, 14 Apr 2008 09:15:51 +0000 (11:15 +0200)]
[NETFILTER]: nf_nat: don't add NAT extension for confirmed conntracks

Adding extensions to confirmed conntracks is not allowed to avoid races
on reallocation. Don't setup NAT for confirmed conntracks in case NAT
module is loaded late.

The has one side-effect, the connections existing before the NAT module
was loaded won't enter the bysource hash. The only case where this actually
makes a difference is in case of SNAT to a multirange where the IP before
NAT is also part of the range. Since old connections don't enter the
bysource hash the first new connection from the IP will have a new address
selected. This shouldn't matter at all.

Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: nf_nat: remove obsolete check for ICMP redirects
Patrick McHardy [Mon, 14 Apr 2008 09:15:50 +0000 (11:15 +0200)]
[NETFILTER]: nf_nat: remove obsolete check for ICMP redirects

Locally generated ICMP packets have a reference to the conntrack entry
of the original packet manually attached by icmp_send(). Therefore the
check for locally originated untracked ICMP redirects can never be
true.

Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: nf_nat: add SCTP protocol support
Patrick McHardy [Mon, 14 Apr 2008 09:15:50 +0000 (11:15 +0200)]
[NETFILTER]: nf_nat: add SCTP protocol support

Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: nf_nat: add DCCP protocol support
Patrick McHardy [Thu, 20 Mar 2008 14:15:57 +0000 (15:15 +0100)]
[NETFILTER]: nf_nat: add DCCP protocol support

Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: nf_conntrack: add DCCP protocol support
Patrick McHardy [Thu, 20 Mar 2008 14:15:55 +0000 (15:15 +0100)]
[NETFILTER]: nf_conntrack: add DCCP protocol support

Add DCCP conntrack helper. Thanks to Gerrit Renker <gerrit@erg.abdn.ac.uk>
for review and testing.

Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: Add partial checksum validation helper
Patrick McHardy [Thu, 20 Mar 2008 14:15:53 +0000 (15:15 +0100)]
[NETFILTER]: Add partial checksum validation helper

Move the UDP-Lite conntrack checksum validation to a generic helper
similar to nf_checksum() and make it fall back to nf_checksum()
in case the full packet is to be checksummed and hardware checksums
are available. This is to be used by DCCP conntrack, which also
needs to verify partial checksums.

Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: nf_nat: add UDP-Lite support
Patrick McHardy [Thu, 20 Mar 2008 14:15:51 +0000 (15:15 +0100)]
[NETFILTER]: nf_nat: add UDP-Lite support

Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: nf_nat: remove unused name from struct nf_nat_protocol
Patrick McHardy [Thu, 20 Mar 2008 14:15:49 +0000 (15:15 +0100)]
[NETFILTER]: nf_nat: remove unused name from struct nf_nat_protocol

Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: nf_conntrack_netlink: clean up NAT protocol parsing
Patrick McHardy [Mon, 14 Apr 2008 09:15:47 +0000 (11:15 +0200)]
[NETFILTER]: nf_conntrack_netlink: clean up NAT protocol parsing

Move responsibility for setting the IP_NAT_RANGE_PROTO_SPECIFIED flag
to the NAT protocol, properly propagate errors and get rid of ugly
return value convention.

Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: nf_nat: move NAT ctnetlink helpers to nf_nat_proto_common
Patrick McHardy [Mon, 14 Apr 2008 09:15:47 +0000 (11:15 +0200)]
[NETFILTER]: nf_nat: move NAT ctnetlink helpers to nf_nat_proto_common

Move to nf_nat_proto_common and rename to nf_nat_proto_... since they're
also used by protocols that don't have port numbers.

Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: nf_nat: fix random mode not to overwrite port rover
Patrick McHardy [Mon, 14 Apr 2008 09:15:46 +0000 (11:15 +0200)]
[NETFILTER]: nf_nat: fix random mode not to overwrite port rover

The port rover should not get overwritten when using random mode,
otherwise other rules will also use more or less random ports.

Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: nf_nat: add helpers for common NAT protocol operations
Patrick McHardy [Thu, 20 Mar 2008 14:15:47 +0000 (15:15 +0100)]
[NETFILTER]: nf_nat: add helpers for common NAT protocol operations

Add generic ->in_range and ->unique_tuple ops to avoid duplicating them
again and again for future NAT modules and save a few bytes of text:

net/ipv4/netfilter/nf_nat_proto_tcp.c:
  tcp_in_range     |  -62 (removed)
  tcp_unique_tuple | -259 # 271 -> 12, # inlines: 1 -> 0, size inlines: 7 -> 0
 2 functions changed, 321 bytes removed

net/ipv4/netfilter/nf_nat_proto_udp.c:
  udp_in_range     |  -62 (removed)
  udp_unique_tuple | -259 # 271 -> 12, # inlines: 1 -> 0, size inlines: 7 -> 0
 2 functions changed, 321 bytes removed

net/ipv4/netfilter/nf_nat_proto_gre.c:
  gre_in_range |  -62 (removed)
 1 function changed, 62 bytes removed

vmlinux:
 5 functions changed, 704 bytes removed

Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: {ip,ip6,arp}_tables: return EAGAIN for invalid SO_GET_ENTRIES size
Patrick McHardy [Mon, 14 Apr 2008 09:15:45 +0000 (11:15 +0200)]
[NETFILTER]: {ip,ip6,arp}_tables: return EAGAIN for invalid SO_GET_ENTRIES size

Rule dumping is performed in two steps: first userspace gets the
ruleset size using getsockopt(SO_GET_INFO) and allocates memory,
then it calls getsockopt(SO_GET_ENTRIES) to actually dump the
ruleset. When another process changes the ruleset in between the
sizes from the first getsockopt call doesn't match anymore and
the kernel aborts. Unfortunately it returns EAGAIN, as for multiple
other possible errors, so userspace can't distinguish this case
from real errors.

Return EAGAIN so userspace can retry the operation.

Fixes (with current iptables SVN version) netfilter bugzilla #104.

Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: nf_conntrack_sip: clear address in parse_addr()
Patrick McHardy [Mon, 14 Apr 2008 09:15:45 +0000 (11:15 +0200)]
[NETFILTER]: nf_conntrack_sip: clear address in parse_addr()

Some callers pass uninitialized structures, clear the address to make
sure later comparisions work properly.

Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: Explicitly initialize .priority in arptable_filter
Jan Engelhardt [Mon, 14 Apr 2008 09:15:44 +0000 (11:15 +0200)]
[NETFILTER]: Explicitly initialize .priority in arptable_filter

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: remove arpt_(un)register_target indirection macros
Jan Engelhardt [Mon, 14 Apr 2008 09:15:44 +0000 (11:15 +0200)]
[NETFILTER]: remove arpt_(un)register_target indirection macros

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: remove arpt_target indirection macro
Jan Engelhardt [Mon, 14 Apr 2008 09:15:43 +0000 (11:15 +0200)]
[NETFILTER]: remove arpt_target indirection macro

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: remove arpt_table indirection macro
Jan Engelhardt [Mon, 14 Apr 2008 09:15:43 +0000 (11:15 +0200)]
[NETFILTER]: remove arpt_table indirection macro

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: annotate rest of nf_nat_* with const
Jan Engelhardt [Mon, 14 Apr 2008 09:15:42 +0000 (11:15 +0200)]
[NETFILTER]: annotate rest of nf_nat_* with const

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: annotate rest of nf_conntrack_* with const
Jan Engelhardt [Mon, 14 Apr 2008 09:15:42 +0000 (11:15 +0200)]
[NETFILTER]: annotate rest of nf_conntrack_* with const

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: annotate {arp,ip,ip6,x}tables with const
Jan Engelhardt [Mon, 14 Apr 2008 09:15:35 +0000 (11:15 +0200)]
[NETFILTER]: annotate {arp,ip,ip6,x}tables with const

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: annotate xtables targets with const and remove casts
Jan Engelhardt [Mon, 14 Apr 2008 07:56:05 +0000 (09:56 +0200)]
[NETFILTER]: annotate xtables targets with const and remove casts

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: xt_sctp: simplify xt_sctp.h
Jan Engelhardt [Mon, 14 Apr 2008 07:56:04 +0000 (09:56 +0200)]
[NETFILTER]: xt_sctp: simplify xt_sctp.h

The use of xt_sctp.h flagged up -Wshadow warnings in userspace, which
prompted me to look at it and clean it up. Basic operations have been
directly replaced by library calls (memcpy, memset is both available
in the kernel and userspace, and usually faster than a self-made
loop). The is_set and is_clear functions now use a processing time
shortcut, too.

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: Use non-deprecated __RW_LOCK_UNLOCKED macro
Robert P. J. Day [Mon, 14 Apr 2008 07:56:03 +0000 (09:56 +0200)]
[NETFILTER]: Use non-deprecated __RW_LOCK_UNLOCKED macro

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: bridge netfilter: use non-deprecated __RW_LOCK_UNLOCKED macro.
Robert P. J. Day [Mon, 14 Apr 2008 07:56:03 +0000 (09:56 +0200)]
[NETFILTER]: bridge netfilter: use non-deprecated __RW_LOCK_UNLOCKED macro.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: ip_tables: per-netns FILTER/MANGLE/RAW tables for real
Alexey Dobriyan [Mon, 14 Apr 2008 07:56:02 +0000 (09:56 +0200)]
[NETFILTER]: ip_tables: per-netns FILTER/MANGLE/RAW tables for real

Commit 9335f047fe61587ec82ff12fbb1220bcfdd32006 aka
"[NETFILTER]: ip_tables: per-netns FILTER, MANGLE, RAW"
added per-netns _view_ of iptables rules. They were shown to user, but
ignored by filtering code. Now that it's possible to at least ping loopback,
per-netns tables can affect filtering decisions.

netns is taken in case of
PRE_ROUTING, LOCAL_IN -- from in device,
POST_ROUTING, LOCAL_OUT -- from out device,
FORWARD -- from in device which should be equal to out device's netns.
   This code is relatively new, so BUG_ON was plugged.

Wrappers were added to a) keep code the same from CONFIG_NET_NS=n users
(overwhelming majority), b) consolidate code in one place -- similar
changes will be done in ipv6 and arp netfilter code.

Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: {ip,ip6}t_LOG: print MARK value in log output
Patrick McHardy [Thu, 20 Mar 2008 14:15:45 +0000 (15:15 +0100)]
[NETFILTER]: {ip,ip6}t_LOG: print MARK value in log output

Dump the mark value in log messages similar to nfnetlink_log. This
is useful for debugging complex setups where marks are used for
routing or traffic classification.

Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[NETFILTER]: nf_conntrack: less hairy ifdefs around proc and sysctl
Alexey Dobriyan [Thu, 20 Mar 2008 14:15:43 +0000 (15:15 +0100)]
[NETFILTER]: nf_conntrack: less hairy ifdefs around proc and sysctl

Patch splits creation of /proc/net/nf_conntrack, /proc/net/stat/nf_conntrack
and net.netfilter hierarchy into their own functions with dummy ones
if PROC_FS or SYSCTL is not set. Also, remove dead "ret = 0" write
while I'm at it.

Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[BRIDGE]: Fix crash in __ip_route_output_key with bridge netfilter
Patrick McHardy [Mon, 14 Apr 2008 07:46:01 +0000 (00:46 -0700)]
[BRIDGE]: Fix crash in __ip_route_output_key with bridge netfilter

The bridge netfilter code attaches a fake dst_entry with a pointer to a
fake net_device structure to skbs it passes up to IPv4 netfilter. This
leads to crashes when the skb is passed to __ip_route_output_key when
dereferencing the namespace pointer.

Since bridging can currently only operate in the init_net namespace,
the easiest fix for now is to initialize the nd_net pointer of the
fake net_device struct to &init_net.

Should fix bugzilla 10323: http://bugzilla.kernel.org/show_bug.cgi?id=10323

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NETFILTER]: ipt_CLUSTERIP: fix race between clusterip_config_find_get and _entry_put
Pavel Emelyanov [Mon, 14 Apr 2008 07:44:52 +0000 (00:44 -0700)]
[NETFILTER]: ipt_CLUSTERIP: fix race between clusterip_config_find_get and _entry_put

Consider we are putting a clusterip_config entry with the "entries"
count == 1, and on the other CPU there's a clusterip_config_find_get
in progress:

CPU1: CPU2:
clusterip_config_entry_put: clusterip_config_find_get:
if (atomic_dec_and_test(&c->entries)) {
/* true */
read_lock_bh(&clusterip_lock);
c = __clusterip_config_find(clusterip);
/* found - it's still in list */
...
atomic_inc(&c->entries);
read_unlock_bh(&clusterip_lock);

write_lock_bh(&clusterip_lock);
list_del(&c->list);
write_unlock_bh(&clusterip_lock);
...
dev_put(c->dev);

Oops! We have an entry returned by the clusterip_config_find_get,
which is a) not in list b) has a stale dev pointer.

The problems will happen when the CPU2 will release the entry - it
will remove it from the list for the 2nd time, thus spoiling it, and
will put a stale dev pointer.

The fix is to make atomic_dec_and_test under the clusterip_lock.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
17 years ago[SKB]: __skb_queue_tail = __skb_insert before
Gerrit Renker [Mon, 14 Apr 2008 07:05:28 +0000 (00:05 -0700)]
[SKB]: __skb_queue_tail = __skb_insert before

This expresses __skb_queue_tail() in terms of __skb_insert(),
using __skb_insert_before() as auxiliary function.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[SKB]: __skb_append = __skb_queue_after
Gerrit Renker [Mon, 14 Apr 2008 07:05:09 +0000 (00:05 -0700)]
[SKB]: __skb_append = __skb_queue_after

This expresses __skb_append in terms of __skb_queue_after, exploiting that

  __skb_append(old, new, list) = __skb_queue_after(list, old, new).

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[SKB]: __skb_queue_after(prev) = __skb_insert(prev, prev->next)
Gerrit Renker [Mon, 14 Apr 2008 07:04:51 +0000 (00:04 -0700)]
[SKB]: __skb_queue_after(prev) = __skb_insert(prev, prev->next)

By reordering, __skb_queue_after() is expressed in terms of __skb_insert().

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[SKB]: __skb_dequeue = skb_peek + __skb_unlink
Gerrit Renker [Mon, 14 Apr 2008 07:04:12 +0000 (00:04 -0700)]
[SKB]: __skb_dequeue = skb_peek + __skb_unlink

By rearranging the order of declarations, __skb_dequeue() is expressed in terms of

 * skb_peek() and
 * __skb_unlink(),

thus in effect mirroring the analogue implementation of __skb_dequeue_tail().

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[IPV6] MROUTE: Add stats in multicast routing module method ip6_mr_forward().
Rami Rosen [Mon, 14 Apr 2008 06:59:13 +0000 (23:59 -0700)]
[IPV6] MROUTE: Add stats in multicast routing module method ip6_mr_forward().

This patches adds a call to increment IPSTATS_MIB_OUTFORWDATAGRAMS
when forwarding the packet in ip6_mr_forward() in the IPv6 multicast
routing module (net/ipv6/ip6mr.c).

Signed-off-by: Rami Rosen <ramirose@gmail.com>
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[IPV6] ADDRCONF: Don't generate temporary address for ip6-ip6 interface.
YOSHIFUJI Hideaki [Mon, 14 Apr 2008 06:47:11 +0000 (23:47 -0700)]
[IPV6] ADDRCONF: Don't generate temporary address for ip6-ip6 interface.

As far as I can remember, I was going to disable privacy extensions
on all "tunnel" interfaces.  Disable it on ip6-ip6 interface as well.

Also, just remove ifdefs for SIT for simplicity.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[IPV6] ADDRCONF: Ensure disabling multicast RS even if privacy extensions are disabled.
YOSHIFUJI Hideaki [Mon, 14 Apr 2008 06:42:18 +0000 (23:42 -0700)]
[IPV6] ADDRCONF: Ensure disabling multicast RS even if privacy extensions are disabled.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[IPV6]: Use appropriate sock tclass setting for routing lookup.
YOSHIFUJI Hideaki [Mon, 14 Apr 2008 06:40:51 +0000 (23:40 -0700)]
[IPV6]: Use appropriate sock tclass setting for routing lookup.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[IPV6]: IPv6 extension header structures need to be packed.
YOSHIFUJI Hideaki [Mon, 14 Apr 2008 06:33:52 +0000 (23:33 -0700)]
[IPV6]: IPv6 extension header structures need to be packed.

struct ipv6_opt_hdr is the common structure for IPv6 extension
headers, and it is common to increment the pointer to get
the real content.  On the other hand, since the structure
consists only of 1-byte next-header field and 1-byte length
field, size of that structure depends on architecture; 2 or 4.
Add "packed" attribute to get 2.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NET]: Sink IPv6 menuoptions into its own submenu
Jan Engelhardt [Mon, 14 Apr 2008 06:30:47 +0000 (23:30 -0700)]
[NET]: Sink IPv6 menuoptions into its own submenu

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[IPV6]: Share common code-paths for sticky socket options.
YOSHIFUJI Hideaki [Mon, 14 Apr 2008 06:21:52 +0000 (23:21 -0700)]
[IPV6]: Share common code-paths for sticky socket options.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>