Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH v2] xtables: make XT_ALIGN() usable in exported headers by exporting __ALIGN_KERNEL()
From: Alexey Dobriyan @ 2010-04-13 11:50 UTC (permalink / raw)
  To: Patrick McHardy
  Cc: linux-kernel, netdev, shemminger, bhutchings, andreas, hadi,
	hideaki
In-Reply-To: <4BC450A4.1010200@trash.net>

On Tue, Apr 13, 2010 at 01:08:20PM +0200, Patrick McHardy wrote:
> Alexey Dobriyan wrote:
> > XT_ALIGN() was rewritten through ALIGN() by commit 42107f5009da223daa800d6da6904d77297ae829
> > "netfilter: xtables: symmetric COMPAT_XT_ALIGN definition".
> > ALIGN() is not exported in userspace headers, which created compile problem for tc(8)
> > and will create problem for iptables(8).
> > 
> > We can't export generic looking name ALIGN() but we can export less generic
> > __ALIGN_KERNEL() (suggested by Ben Hutchings).
> > Google knows nothing about __ALIGN_KERNEL().
> > 
> > COMPAT_XT_ALIGN() changed for symmetry.
> 
> I've already pushed your change out, could you send me an incremental
> fix please?
> 
> master.kernel.org:/pub/scm/linux/kernel/git/kaber/nf-next-2.6.git

[PATCH] Restore __ALIGN_MASK()

Fix lib/bitmap.c compile failure due to __ALIGN_KERNEL changes.

---
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -40,6 +40,7 @@ extern const char linux_proc_banner[];
 #define STACK_MAGIC	0xdeadbeef
 
 #define ALIGN(x, a)		__ALIGN_KERNEL((x), (a))
+#define __ALIGN_MASK(x, mask)	__ALIGN_KERNEL_MASK((x), (mask))
 #define PTR_ALIGN(p, a)		((typeof(p))ALIGN((unsigned long)(p), (a)))
 #define IS_ALIGNED(x, a)		(((x) & ((typeof(x))(a) - 1)) == 0)
 

^ permalink raw reply

* Re: [PATCH v2] xtables: make XT_ALIGN() usable in exported headers by exporting __ALIGN_KERNEL()
From: Alexey Dobriyan @ 2010-04-13 11:50 UTC (permalink / raw)
  To: Patrick McHardy
  Cc: linux-kernel, netdev, shemminger, bhutchings, andreas, hadi,
	hideaki
In-Reply-To: <4BC450A4.1010200@trash.net>

On Tue, Apr 13, 2010 at 01:08:20PM +0200, Patrick McHardy wrote:
> Alexey Dobriyan wrote:
> > XT_ALIGN() was rewritten through ALIGN() by commit 42107f5009da223daa800d6da6904d77297ae829
> > "netfilter: xtables: symmetric COMPAT_XT_ALIGN definition".
> > ALIGN() is not exported in userspace headers, which created compile problem for tc(8)
> > and will create problem for iptables(8).
> > 
> > We can't export generic looking name ALIGN() but we can export less generic
> > __ALIGN_KERNEL() (suggested by Ben Hutchings).
> > Google knows nothing about __ALIGN_KERNEL().
> > 
> > COMPAT_XT_ALIGN() changed for symmetry.
> 
> I've already pushed your change out, could you send me an incremental
> fix please?
> 
> master.kernel.org:/pub/scm/linux/kernel/git/kaber/nf-next-2.6.git

[PATCH] Restore __ALIGN_MASK()

Fix lib/bitmap.c compile failure due to __ALIGN_KERNEL changes.

---
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -40,6 +40,7 @@ extern const char linux_proc_banner[];
 #define STACK_MAGIC	0xdeadbeef
 
 #define ALIGN(x, a)		__ALIGN_KERNEL((x), (a))
+#define __ALIGN_MASK(x, mask)	__ALIGN_KERNEL_MASK((x), (mask))
 #define PTR_ALIGN(p, a)		((typeof(p))ALIGN((unsigned long)(p), (a)))
 #define IS_ALIGNED(x, a)		(((x) & ((typeof(x))(a) - 1)) == 0)
 

^ permalink raw reply

* [GIT] Networking
From: David Miller @ 2010-04-13 11:43 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, netdev, linux-kernel


Of note is the fix for the wireless regression reported last week, a
fix for virtio net crashes with DEBUG_SG enabled, and some minor bug
cures in other drivers.

I tried to cure a loopback TCP checksumming anomaly with dataless
packets, but couldn't get it right the first time so reverted.

It's a harmless issue (we check checksums of ACKs over loopback) and
we've had it forever, but such things should be toyed with in our
-next trees not here...

I merged in your tree to resolve some conflicts mentioned by
Stephen Rothwell.

1) Restrict WoL in igb driver to devices which can support it.
   From Stefan Assmann.

2) Add missing sg_init_table to virtio_net, from Shirley Ma.

3) e1000e can walk past the end of TX ring links when we get
   lots of interrupts, fix from Terry Loftin.

4) iwlwifi bug fixes, including the fix for the crash reported
   last week.  From Shanyu Zhao, Wey-Yi Guy, and Zhu Yi.

5) Fix RCU checking warning in mac80211, from Johannes Berg.

6) Bridging code IGMP3 report parser accesses entry pointer
   incorrectly.  Fix from Herbert Xu.

7) stmmac miscalculates resource size by hand, use resource_size()
   and get it right, from Dan Carpenter.

8) X.25 protocol can access past end of SKB, fix from John Hughes.

Please pull, thanks a lot!

The following changes since commit 0eddb519b9127c73d53db4bf3ec1d45b13f844d1:
  Linus Torvalds (1):
        Merge branch 'for-linus' of git://git.kernel.org/.../roland/infiniband

are available in the git repository at:

  master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6.git master

Amit Kumar Salecha (1):
      qlcnic: fix set mac addr

Brice Goglin (1):
      myri10ge: fix rx_pause in myri10ge_set_pauseparam

Dan Carpenter (1):
      stmmac: use resource_size()

David S. Miller (6):
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless-2.6
      Merge branch 'vhost' of git://git.kernel.org/.../mst/vhost
      tcp: Set CHECKSUM_UNNECESSARY in tcp_init_nondata_skb
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless-2.6
      Revert "tcp: Set CHECKSUM_UNNECESSARY in tcp_init_nondata_skb"
      Merge branch 'master' of /home/davem/src/GIT/linux-2.6/

Eric Dumazet (1):
      can: avoids a false warning

Felix Fietkau (1):
      ath9k: fix double calls to ath_radio_enable

Florian Fainelli (1):
      r6040: fix r6040_multicast_list

Herbert Xu (1):
      bridge: Fix IGMP3 report parsing

Javier Cardona (1):
      mac80211: Handle mesh action frames in ieee80211_rx_h_action

Jeff Dike (1):
      vhost-net: fix vq_memory_access_ok error checking

Johannes Berg (1):
      mac80211: annotate station rcu dereferences

John Hughes (2):
      x25: Patch to fix bug 15678 - x25 accesses fields beyond end of packet.
      x.25 attempts to negotiate invalid throughput

Jorge Boncompte [DTI2] (1):
      udp: fix for unicast RX path optimization

Ken Kawasaki (1):
      smc91c92_cs: define multicast_table as unsigned char

Michael Chan (1):
      cnic: Fix crash during bnx2x MTU change.

Patrick Loschmidt (1):
      net: corrected documentation for hardware time stamping

Shanyu Zhao (1):
      iwlwifi: use consistent table for tx data collect

Shirley Ma (1):
      virtio_net: missing sg_init_table

Stefan Assmann (1):
      igb: restrict WoL for 82576 ET2 Quad Port Server Adapter

Terry Loftin (1):
      e1000e: stop cleaning when we reach tx_ring->next_to_use

Wey-Yi Guy (1):
      iwlwifi: need check for valid qos packet before free

Zhu Yi (2):
      iwlwifi: fix DMA allocation warnings
      iwlwifi: avoid Tx queue memory allocation in interface down

 Documentation/networking/timestamping.txt |   76 ++++++++++++--------
 drivers/net/cnic.c                        |   10 ++--
 drivers/net/e1000e/netdev.c               |    2 +
 drivers/net/igb/igb_ethtool.c             |    1 +
 drivers/net/igb/igb_main.c                |    1 +
 drivers/net/myri10ge/myri10ge.c           |    2 +-
 drivers/net/pcmcia/smc91c92_cs.c          |   13 ++--
 drivers/net/qlcnic/qlcnic_hw.c            |    3 +
 drivers/net/r6040.c                       |   11 +--
 drivers/net/stmmac/stmmac_main.c          |   10 ++--
 drivers/net/virtio_net.c                  |    2 +
 drivers/net/wireless/ath/ath9k/main.c     |    3 +-
 drivers/net/wireless/iwlwifi/iwl-4965.c   |   13 +++-
 drivers/net/wireless/iwlwifi/iwl-agn-rs.c |   55 +++++++--------
 drivers/net/wireless/iwlwifi/iwl-core.c   |   11 ++-
 drivers/net/wireless/iwlwifi/iwl-core.h   |    5 +-
 drivers/net/wireless/iwlwifi/iwl-tx.c     |  107 +++++++++++++++++++++++++----
 drivers/vhost/vhost.c                     |    4 +
 include/net/x25.h                         |    4 +
 net/bridge/br_multicast.c                 |    2 +-
 net/can/raw.c                             |    2 +-
 net/ipv4/udp.c                            |    4 +-
 net/ipv6/udp.c                            |    4 +-
 net/mac80211/main.c                       |    4 +-
 net/mac80211/mesh.c                       |    3 -
 net/mac80211/rx.c                         |    5 ++
 net/mac80211/sta_info.c                   |   20 ++++-
 net/x25/af_x25.c                          |   67 +++++++++++++++++--
 net/x25/x25_facilities.c                  |   27 ++++++-
 net/x25/x25_in.c                          |   15 +++-
 30 files changed, 348 insertions(+), 138 deletions(-)

^ permalink raw reply

* Re: SO_REUSEADDR with UDP (again)
From: Michal Svoboda @ 2010-04-13 11:27 UTC (permalink / raw)
  To: netdev
In-Reply-To: <1271155163.16881.244.camel@edumazet-laptop>

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

Eric Dumazet wrote:
> Why do you use REUSEADDR ? This is doing what is documented.
> 
>        SO_REUSEADDR
>               Indicates that the rules used in validating addresses  supplied
>               in  a  bind(2) call should allow reuse of local addresses.  For
>               AF_INET sockets this means that a socket may bind, except  when
>               there is an active listening socket bound to the address.  When
>               the listening socket is bound to  INADDR_ANY  with  a  specific
>               port then it is not possible to bind to this port for any local
>               address.  Argument is an integer boolean flag.

I read it 10 times but it doesn't say anything about stealing frames, or
implementation-defined behavior in this case.

> An UDP application wanting a port for its exclusive use dont set
> REUSEADDR, or basically allows anybody to bind an udp socket to same
> port, and potentially steal incoming frames.

That's fair enough, I will talk to the developers of the "very buggy"
applications that use this flag and ask them to reconsider.
 
> REUSEADDR is usually used when an application has several sockets bound
> to same port, but different IP addresses (or bound to different devices)

I just tried that and you can bind to different IPs without REUSEADDR.


Michal Svoboda


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply

* Re: [RFC PATCH 9/9] net: ipmr: support multiple tables
From: Patrick McHardy @ 2010-04-13 11:18 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <20100413.041709.99820904.davem@davemloft.net>

David Miller wrote:
> From: kaber@trash.net
> Date: Sun, 11 Apr 2010 19:37:15 +0200
> 
>> This patch adds support for multiple independant multicast routing instances,
>> named "tables".
> 
> Ok, this looks fine to me too.
> 
> Let me know when you have a final version you'd like
> me to add to net-next-2.6
> 

I'll fix up the list thing and resubmit, thanks Dave.

^ permalink raw reply

* Re: [RFC PATCH 7/9] ipv4: ipmr: convert struct mfc_cache to struct list_head
From: Patrick McHardy @ 2010-04-13 11:18 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <20100413.041506.177518126.davem@davemloft.net>

David Miller wrote:
> From: kaber@trash.net
> Date: Sun, 11 Apr 2010 19:37:13 +0200
> 
>> From: Patrick McHardy <kaber@trash.net>
>>
>> Signed-off-by: Patrick McHardy <kaber@trash.net>
> 
> Great, it looks like you didn't fall into most of the
> traps that usually occur during a list_head conversion :-)
> 
> But:
> 
>> -		c->next = net->ipv4.mfc_unres_queue;
>> -		net->ipv4.mfc_unres_queue = c;
>> +		list_add_tail(&c->list, &net->ipv4.mfc_unres_queue);
>  ...
>>  	write_lock_bh(&mrt_lock);
>> -	c->next = net->ipv4.mfc_cache_array[line];
>> -	net->ipv4.mfc_cache_array[line] = c;
>> +	list_add_tail(&c->list, &net->ipv4.mfc_cache_array[line]);
>>  	write_unlock_bh(&mrt_lock);
> 
> Are you sure we mean to insert to the tail here?  It looks like a head
> insertion to me beforehand, and the fact that the previous list
> iterators start at the list head pointer seem to confirm this.

I don't think it matters since each entry only exists once and
there are no ordering requirements, but I'll change it just to
make sure.

Thanks for your review so far :)

^ permalink raw reply

* Re: [RFC PATCH 9/9] net: ipmr: support multiple tables
From: David Miller @ 2010-04-13 11:17 UTC (permalink / raw)
  To: kaber; +Cc: netdev
In-Reply-To: <1271007435-20035-10-git-send-email-kaber@trash.net>

From: kaber@trash.net
Date: Sun, 11 Apr 2010 19:37:15 +0200

> This patch adds support for multiple independant multicast routing instances,
> named "tables".

Ok, this looks fine to me too.

Let me know when you have a final version you'd like
me to add to net-next-2.6


^ permalink raw reply

* Re: [RFC PATCH 8/9] net: ipmr: move mroute data into seperate structure
From: David Miller @ 2010-04-13 11:15 UTC (permalink / raw)
  To: kaber; +Cc: netdev
In-Reply-To: <1271007435-20035-9-git-send-email-kaber@trash.net>

From: kaber@trash.net
Date: Sun, 11 Apr 2010 19:37:14 +0200

> From: Patrick McHardy <kaber@trash.net>
> 
> Signed-off-by: Patrick McHardy <kaber@trash.net>

Looks fine.

^ permalink raw reply

* Re: [RFC PATCH 7/9] ipv4: ipmr: convert struct mfc_cache to struct list_head
From: David Miller @ 2010-04-13 11:15 UTC (permalink / raw)
  To: kaber; +Cc: netdev
In-Reply-To: <1271007435-20035-8-git-send-email-kaber@trash.net>

From: kaber@trash.net
Date: Sun, 11 Apr 2010 19:37:13 +0200

> From: Patrick McHardy <kaber@trash.net>
> 
> Signed-off-by: Patrick McHardy <kaber@trash.net>

Great, it looks like you didn't fall into most of the
traps that usually occur during a list_head conversion :-)

But:

> -		c->next = net->ipv4.mfc_unres_queue;
> -		net->ipv4.mfc_unres_queue = c;
> +		list_add_tail(&c->list, &net->ipv4.mfc_unres_queue);
 ...
>  	write_lock_bh(&mrt_lock);
> -	c->next = net->ipv4.mfc_cache_array[line];
> -	net->ipv4.mfc_cache_array[line] = c;
> +	list_add_tail(&c->list, &net->ipv4.mfc_cache_array[line]);
>  	write_unlock_bh(&mrt_lock);

Are you sure we mean to insert to the tail here?  It looks like a head
insertion to me beforehand, and the fact that the previous list
iterators start at the list head pointer seem to confirm this.

^ permalink raw reply

* Re: [RFC PATCH 6/9] ipv4: ipmr: remove net pointer from struct mfc_cache
From: David Miller @ 2010-04-13 11:10 UTC (permalink / raw)
  To: kaber; +Cc: netdev
In-Reply-To: <1271007435-20035-7-git-send-email-kaber@trash.net>

From: kaber@trash.net
Date: Sun, 11 Apr 2010 19:37:12 +0200

> From: Patrick McHardy <kaber@trash.net>
> 
> Now that cache entries in unres_queue don't need to be distinguished by their
> network namespace pointer anymore, we can remove it from struct mfc_cache
> add pass the namespace as function argument to the functions that need it.
> 
> Signed-off-by: Patrick McHardy <kaber@trash.net>

This is ok.

^ permalink raw reply

* Re: [RFC PATCH 5/9] ipv4: ipmr: move unres_queue and timer to per-namespace data
From: David Miller @ 2010-04-13 11:10 UTC (permalink / raw)
  To: kaber; +Cc: netdev
In-Reply-To: <1271007435-20035-6-git-send-email-kaber@trash.net>

From: kaber@trash.net
Date: Sun, 11 Apr 2010 19:37:11 +0200

> From: Patrick McHardy <kaber@trash.net>
> 
> The unres_queue is currently shared between all namespaces. Following patches
> will additionally allow to create multiple multicast routing tables in each
> namespace. Having a single shared queue for all these users seems to excessive,
> move the queue and the cleanup timer to the per-namespace data to unshare it.
> 
> As a side-effect, this fixes a bug in the seq file iteration functions: the
> first entry returned is always from the current namespace, entries returned
> after that may belong to any namespace.
> 
> Signed-off-by: Patrick McHardy <kaber@trash.net>

This looks good.

^ permalink raw reply

* Re: [RFC PATCH 4/9] ipv4: raw: move struct raw_sock and raw_sk() to include/net/raw.h
From: David Miller @ 2010-04-13 11:09 UTC (permalink / raw)
  To: kaber; +Cc: netdev
In-Reply-To: <1271007435-20035-5-git-send-email-kaber@trash.net>

From: kaber@trash.net
Date: Sun, 11 Apr 2010 19:37:10 +0200

> From: Patrick McHardy <kaber@trash.net>
> 
> A following patch will use struct raw_sock to store state for ipmr,
> so having the definitions in icmp.h doesn't fit very well anymore.
> 
> Signed-off-by: Patrick McHardy <kaber@trash.net>

This is ok.

^ permalink raw reply

* Re: [RFC PATCH 3/9] net: fib_rules: decouple address families from real address families
From: David Miller @ 2010-04-13 11:08 UTC (permalink / raw)
  To: kaber; +Cc: netdev
In-Reply-To: <1271007435-20035-4-git-send-email-kaber@trash.net>

From: kaber@trash.net
Date: Sun, 11 Apr 2010 19:37:09 +0200

> From: Patrick McHardy <kaber@trash.net>
> 
> Decouple the address family values used for fib_rules from the real
> address families in socket.h. This allows to use fib_rules for
> code that is not a real address family without increasing AF_MAX/NPROTO.
> 
> Values up to 127 are reserved for real address families and map directly
> to the corresponding AF value, values starting from 128 are for other
> uses. rtnetlink is changed to invoke the AF_UNSPEC dumpit/doit handlers
> for these families.
> 
> Signed-off-by: Patrick McHardy <kaber@trash.net>

Ok.

^ permalink raw reply

* Re: [PATCH v2] xtables: make XT_ALIGN() usable in exported headers by exporting __ALIGN_KERNEL()
From: Patrick McHardy @ 2010-04-13 11:08 UTC (permalink / raw)
  To: Alexey Dobriyan
  Cc: linux-kernel, netdev, shemminger, bhutchings, andreas, hadi,
	hideaki
In-Reply-To: <20100414120712.GA25686@x200>

Alexey Dobriyan wrote:
> XT_ALIGN() was rewritten through ALIGN() by commit 42107f5009da223daa800d6da6904d77297ae829
> "netfilter: xtables: symmetric COMPAT_XT_ALIGN definition".
> ALIGN() is not exported in userspace headers, which created compile problem for tc(8)
> and will create problem for iptables(8).
> 
> We can't export generic looking name ALIGN() but we can export less generic
> __ALIGN_KERNEL() (suggested by Ben Hutchings).
> Google knows nothing about __ALIGN_KERNEL().
> 
> COMPAT_XT_ALIGN() changed for symmetry.

I've already pushed your change out, could you send me an incremental
fix please?

master.kernel.org:/pub/scm/linux/kernel/git/kaber/nf-next-2.6.git

^ permalink raw reply

* [PATCH v2] xtables: make XT_ALIGN() usable in exported headers by exporting __ALIGN_KERNEL()
From: Alexey Dobriyan @ 2010-04-13 11:06 UTC (permalink / raw)
  To: Patrick McHardy
  Cc: linux-kernel, netdev, shemminger, bhutchings, andreas, hadi,
	hideaki
In-Reply-To: <4BC44117.80901@trash.net>

XT_ALIGN() was rewritten through ALIGN() by commit 42107f5009da223daa800d6da6904d77297ae829
"netfilter: xtables: symmetric COMPAT_XT_ALIGN definition".
ALIGN() is not exported in userspace headers, which created compile problem for tc(8)
and will create problem for iptables(8).

We can't export generic looking name ALIGN() but we can export less generic
__ALIGN_KERNEL() (suggested by Ben Hutchings).
Google knows nothing about __ALIGN_KERNEL().

COMPAT_XT_ALIGN() changed for symmetry.

Reported-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 include/linux/kernel.h             |    6 ++++--
 include/linux/netfilter/x_tables.h |    6 +++---
 2 files changed, 7 insertions(+), 5 deletions(-)

--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -4,6 +4,8 @@
 /*
  * 'kernel.h' contains some often-used function prototypes etc
  */
+#define __ALIGN_KERNEL(x, a)		__ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1)
+#define __ALIGN_KERNEL_MASK(x, mask)	(((x) + (mask)) & ~(mask))
 
 #ifdef __KERNEL__
 
@@ -37,8 +39,8 @@ extern const char linux_proc_banner[];
 
 #define STACK_MAGIC	0xdeadbeef
 
-#define ALIGN(x,a)		__ALIGN_MASK(x,(typeof(x))(a)-1)
-#define __ALIGN_MASK(x,mask)	(((x)+(mask))&~(mask))
+#define ALIGN(x, a)		__ALIGN_KERNEL((x), (a))
+#define __ALIGN_MASK(x, mask)	__ALIGN_KERNEL_MASK((x), (mask))
 #define PTR_ALIGN(p, a)		((typeof(p))ALIGN((unsigned long)(p), (a)))
 #define IS_ALIGNED(x, a)		(((x) & ((typeof(x))(a) - 1)) == 0)
 
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 84c7c92..f01ddbe 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -1,6 +1,6 @@
 #ifndef _X_TABLES_H
 #define _X_TABLES_H
-
+#include <linux/kernel.h>
 #include <linux/types.h>
 
 #define XT_FUNCTION_MAXNAMELEN 30
@@ -93,7 +93,7 @@ struct _xt_align {
 	__u64 u64;
 };
 
-#define XT_ALIGN(s) ALIGN((s), __alignof__(struct _xt_align))
+#define XT_ALIGN(s) __ALIGN_KERNEL((s), __alignof__(struct _xt_align))
 
 /* Standard return verdict, or do jump. */
 #define XT_STANDARD_TARGET ""
@@ -598,7 +598,7 @@ struct _compat_xt_align {
 	compat_u64 u64;
 };
 
-#define COMPAT_XT_ALIGN(s) ALIGN((s), __alignof__(struct _compat_xt_align))
+#define COMPAT_XT_ALIGN(s) __ALIGN_KERNEL((s), __alignof__(struct _compat_xt_align))
 
 extern void xt_compat_lock(u_int8_t af);
 extern void xt_compat_unlock(u_int8_t af);

^ permalink raw reply related

* Re: [RFC PATCH 2/9] net: fib_rules: set family in fib_rule_hdr centrally
From: David Miller @ 2010-04-13 11:06 UTC (permalink / raw)
  To: kaber; +Cc: netdev
In-Reply-To: <1271007435-20035-3-git-send-email-kaber@trash.net>

From: kaber@trash.net
Date: Sun, 11 Apr 2010 19:37:08 +0200

> From: Patrick McHardy <kaber@trash.net>
> 
> All fib_rules implementations need to set the family in their ->fill()
> functions. Since the value is available to the generic fib_nl_fill_rule()
> function, set it there.
> 
> Signed-off-by: Patrick McHardy <kaber@trash.net>

Looks good.

^ permalink raw reply

* [PATCH v2] xtables: make XT_ALIGN() usable in exported headers by exporting __ALIGN_KERNEL()
From: Alexey Dobriyan @ 2010-04-13 11:06 UTC (permalink / raw)
  To: Patrick McHardy
  Cc: linux-kernel, netdev, shemminger, bhutchings, andreas, hadi,
	hideaki
In-Reply-To: <4BC44117.80901@trash.net>

XT_ALIGN() was rewritten through ALIGN() by commit 42107f5009da223daa800d6da6904d77297ae829
"netfilter: xtables: symmetric COMPAT_XT_ALIGN definition".
ALIGN() is not exported in userspace headers, which created compile problem for tc(8)
and will create problem for iptables(8).

We can't export generic looking name ALIGN() but we can export less generic
__ALIGN_KERNEL() (suggested by Ben Hutchings).
Google knows nothing about __ALIGN_KERNEL().

COMPAT_XT_ALIGN() changed for symmetry.

Reported-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 include/linux/kernel.h             |    6 ++++--
 include/linux/netfilter/x_tables.h |    6 +++---
 2 files changed, 7 insertions(+), 5 deletions(-)

--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -4,6 +4,8 @@
 /*
  * 'kernel.h' contains some often-used function prototypes etc
  */
+#define __ALIGN_KERNEL(x, a)		__ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1)
+#define __ALIGN_KERNEL_MASK(x, mask)	(((x) + (mask)) & ~(mask))
 
 #ifdef __KERNEL__
 
@@ -37,8 +39,8 @@ extern const char linux_proc_banner[];
 
 #define STACK_MAGIC	0xdeadbeef
 
-#define ALIGN(x,a)		__ALIGN_MASK(x,(typeof(x))(a)-1)
-#define __ALIGN_MASK(x,mask)	(((x)+(mask))&~(mask))
+#define ALIGN(x, a)		__ALIGN_KERNEL((x), (a))
+#define __ALIGN_MASK(x, mask)	__ALIGN_KERNEL_MASK((x), (mask))
 #define PTR_ALIGN(p, a)		((typeof(p))ALIGN((unsigned long)(p), (a)))
 #define IS_ALIGNED(x, a)		(((x) & ((typeof(x))(a) - 1)) == 0)
 
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 84c7c92..f01ddbe 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -1,6 +1,6 @@
 #ifndef _X_TABLES_H
 #define _X_TABLES_H
-
+#include <linux/kernel.h>
 #include <linux/types.h>
 
 #define XT_FUNCTION_MAXNAMELEN 30
@@ -93,7 +93,7 @@ struct _xt_align {
 	__u64 u64;
 };
 
-#define XT_ALIGN(s) ALIGN((s), __alignof__(struct _xt_align))
+#define XT_ALIGN(s) __ALIGN_KERNEL((s), __alignof__(struct _xt_align))
 
 /* Standard return verdict, or do jump. */
 #define XT_STANDARD_TARGET ""
@@ -598,7 +598,7 @@ struct _compat_xt_align {
 	compat_u64 u64;
 };
 
-#define COMPAT_XT_ALIGN(s) ALIGN((s), __alignof__(struct _compat_xt_align))
+#define COMPAT_XT_ALIGN(s) __ALIGN_KERNEL((s), __alignof__(struct _compat_xt_align))
 
 extern void xt_compat_lock(u_int8_t af);
 extern void xt_compat_unlock(u_int8_t af);

^ permalink raw reply related

* Re: [RFC PATCH 1/9] net: fib_rules: consolidate IPv4 and DECnet ->default_pref() functions.
From: David Miller @ 2010-04-13 11:06 UTC (permalink / raw)
  To: kaber; +Cc: netdev
In-Reply-To: <1271007435-20035-2-git-send-email-kaber@trash.net>

From: kaber@trash.net
Date: Sun, 11 Apr 2010 19:37:07 +0200

> From: Patrick McHardy <kaber@trash.net>
> 
> Both functions are equivalent, consolidate them since a following patch
> needs a third implementation for multicast routing.
> 
> Signed-off-by: Patrick McHardy <kaber@trash.net>

This patch is fine.


^ permalink raw reply

* Re: forcedeth driver hangs under heavy load
From: stephen mulcahy @ 2010-04-13 11:00 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev, Ben Hutchings, Ayaz Abdulla, 572201
In-Reply-To: <1271155766.16881.245.camel@edumazet-laptop>

Eric Dumazet wrote:
> Le mardi 13 avril 2010 à 11:03 +0100, stephen mulcahy a écrit :
>> Eric Dumazet wrote:
>>> OK it seems forcedeth has problem with checksums ?
>>>
>>> Try to change "ethtool -k eth0" settings ?
>>>
>>> ethtool -K eth0 tso off tx off
>> Yes, that makes an unresponsive system responsive again immediately, nice!
>>
>> Should the driver default to disabling this until we problem is corrected?
>>
>> -stephen
> 
> Both flags need to be disabled, or only one is OK ?

ethtool -K eth0 tx off

fixes the problem (without tso)

but running

ethtool -k eth0
Offload parameters for eth0:
rx-checksumming: on
tx-checksumming: off
scatter-gather: off
tcp-segmentation-offload: off
udp-fragmentation-offload: off
generic-segmentation-offload: on
generic-receive-offload: off
large-receive-offload: off

seems to indicate that tso is also disabled by this - does that sound 
correct?

-stephen

^ permalink raw reply

* Re: forcedeth driver hangs under heavy load
From: Eric Dumazet @ 2010-04-13 10:49 UTC (permalink / raw)
  To: stephen mulcahy; +Cc: netdev, Ben Hutchings, Ayaz Abdulla, 572201
In-Reply-To: <4BC44167.4080807@gmail.com>

Le mardi 13 avril 2010 à 11:03 +0100, stephen mulcahy a écrit :
> Eric Dumazet wrote:
> > OK it seems forcedeth has problem with checksums ?
> > 
> > Try to change "ethtool -k eth0" settings ?
> > 
> > ethtool -K eth0 tso off tx off
> 
> Yes, that makes an unresponsive system responsive again immediately, nice!
> 
> Should the driver default to disabling this until we problem is corrected?
> 
> -stephen

Both flags need to be disabled, or only one is OK ?




^ permalink raw reply

* Re: SO_REUSEADDR with UDP (again)
From: Eric Dumazet @ 2010-04-13 10:39 UTC (permalink / raw)
  To: Michal Svoboda; +Cc: netdev
In-Reply-To: <20100413093408.GA16595@myhost.felk.cvut.cz>

Le mardi 13 avril 2010 à 11:34 +0200, Michal Svoboda a écrit :
> Hello,
> 
> (redirected here from LKML)
> 
> I found SO_REUSEADDR on UDP sockets to behave somewhat nasty. If you
> create a UDP socket with that flag and bind it to a port, then anyone
> doing the same later will "steal" your packets, ie.
> 
> 1. process A binds to port 12345 with SO_REUSEADDR, packets to that port
>    go to process A

why process A sets SO_REUSEADDR ?

> 2. process B binds to port 12345 with SO_REUSEADDR, packets to that port
>    now go to process B

	Or not... this is implementation (un)defined.

> 3. A dies, fires up again, packets go back to A
        Or not. Not documented.
> 4. A dies, does not fire up, packets go to B, as if they were stacked
> 
> And this works even if A and B are owned by different users, thus anyone
> can "steal" packets from anyone as long as they use SO_REUSEADDR.
> However, in most programs that's the default.

Really ? They are very buggy then.

> 
> Furthermore, one can lock-out a particular source from being "stolen" by
> using connect() to that source, ie.
> 
> 1. process A binds to port 12345 with SO_REUSEADDR, gets the packets
> 2. B does the same, gets the packets, but also connect()s to the source
>    of the packets
> 3. A can now restart or try to bind again, but does not get the packets
>    (from that source)
> 
> (I haven't tested the case if A also issues a connect() even if it does
> not receive packets.)
> 
> All of this seems confusing to me, and the fact that users can steal
> packets from each other seems like a mild security risk. I've found some
> discussions about this from circa 2002, but the above cases were not
> mentioned. So - a problem or not?
> 
> 

Why do you use REUSEADDR ? This is doing what is documented.

       SO_REUSEADDR
              Indicates that the rules used in validating addresses  supplied
              in  a  bind(2) call should allow reuse of local addresses.  For
              AF_INET sockets this means that a socket may bind, except  when
              there is an active listening socket bound to the address.  When
              the listening socket is bound to  INADDR_ANY  with  a  specific
              port then it is not possible to bind to this port for any local
              address.  Argument is an integer boolean flag.


An UDP application wanting a port for its exclusive use dont set
REUSEADDR, or basically allows anybody to bind an udp socket to same
port, and potentially steal incoming frames.

REUSEADDR is usually used when an application has several sockets bound
to same port, but different IP addresses (or bound to different devices)




^ permalink raw reply

* Re: [PATCH] dst: don't inline dst_ifdown
From: David Miller @ 2010-04-13 10:34 UTC (permalink / raw)
  To: shemminger; +Cc: netdev
In-Reply-To: <20100412103805.13ac6339@nehalam>

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 12 Apr 2010 10:38:05 -0700

> The function dst_ifdown is called only two places but in a non-
> performance critical code path, there is no reason to inline it.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next-2.6] be2net: clarify promiscuous cmd with a comment
From: David Miller @ 2010-04-13 10:34 UTC (permalink / raw)
  To: sathyap; +Cc: netdev, pugs
In-Reply-To: <20100412083527.GA27023@serverengines.com>

From: Sathya Perla <sathyap@serverengines.com>
Date: Mon, 12 Apr 2010 14:05:27 +0530

> The promiscous cmd config code gives an impression that
> setting a port to promisc mode will unset the other port.
> This is not the case and is clarified with a comment.
> 
> Signed-off-by: Sathya Perla <sathyap@serverengines.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next-2.6] net: uninline skb_bond_should_drop()
From: David Miller @ 2010-04-13 10:33 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev
In-Reply-To: <1271004971.2078.96.camel@edumazet-laptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sun, 11 Apr 2010 18:56:11 +0200

> skb_bond_should_drop() is too big to be inlined.
> 
> This patch reduces kernel text size, and its compilation time as well
> (shrinking include/linux/netdevice.h)
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next-2.6] drivers: net: last_rx elimination
From: David Miller @ 2010-04-13 10:33 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev
In-Reply-To: <1270975694.2078.2.camel@edumazet-laptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sun, 11 Apr 2010 10:48:14 +0200

> Network drivers do not have to update last_rx, unless they need it for
> their private use.
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied, thanks for taking care of this Eric.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox