Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH net-next v4 0/3] netpoll: add IPv6 support
From: Cong Wang @ 2013-01-08  3:55 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <20130107.194621.1068055780988116658.davem@davemloft.net>

On Mon, 2013-01-07 at 19:46 -0800, David Miller wrote:
> From: Cong Wang <amwang@redhat.com>
> Date: Mon,  7 Jan 2013 15:17:13 +0800
> 
> > v4: remove ndisc_parse_options(), ignore ICMP options there
> >     make udp6_csum_init() inline so that we don't rely on IPV6=y
> >     fix a conflict with Jiri's patchset
> 
> Where did I say to inline this function?
> 
> I said to put it into a seperate static library that gets
> linked into the kernel statically, regardless of whether
> IPV6 is 'm' or 'y'.
> 
> I've said this _3_ times and I'm really starting to get
> frustrated with the fact that you can't seem to read what
> I write.
> 
> What part of the "obj-y +=" rules in net/ipv6/Makefile
> are you unable to see?

I knew.

Our goal is to make it work for IPV6=m, so why inline is not a solution
while putting it into a static library is? udp6_csum_init() is not a big
function, so I see no reason why it can't be inlined.

And AFAIK, udp6_csum_init() can't fit into any of these obj-y files in
net/ipv6/.

Am I still missing anything?

Thanks.

^ permalink raw reply

* Re: [patch net-next v2] ethtool: consolidate work with ethtool_ops
From: David Miller @ 2013-01-08  3:54 UTC (permalink / raw)
  To: fbl; +Cc: jiri, netdev, bhutchings, richardcochran, greearb,
	jeffrey.t.kirsher
In-Reply-To: <20130107200656.GA2090@obelix.rh>

From: Flavio Leitner <fbl@redhat.com>
Date: Mon, 7 Jan 2013 18:06:56 -0200

> On Mon, Jan 07, 2013 at 08:02:08PM +0100, Jiri Pirko wrote:
>> No need to check if ethtool_ops == NULL since it can't be.
>> Use local variable "ops" in functions where it is present
>> instead of dev->ethtool_ops
>> Introduce local variable "ops" in functions where dev->ethtool_ops is used
>> many times.
>> 
>> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>> ---
> 
> Reviewed-by: Flavio Leitner <fbl@redhat.com>

Applied.

^ permalink raw reply

* Re: [PATCH 3.8-rc] net: mvneta: fix driver operation in SMP context
From: David Miller @ 2013-01-08  3:52 UTC (permalink / raw)
  To: jason
  Cc: thomas.petazzoni, alior, andrew, netdev, maen, gregory.clement,
	dima, linux-arm-kernel
In-Reply-To: <20130107164415.GI5075@titan.lakedaemon.net>

From: Jason Cooper <jason@lakedaemon.net>
Date: Mon, 7 Jan 2013 11:44:15 -0500

> I'll assume this is going through -net, let me know if it should be
> otherwise.

It needs to be fixed up before it can be applied anywhere, see
Ben Hutchings's feedback.

^ permalink raw reply

* Re: [PATCH V2] xen/netfront: improve truesize tracking
From: David Miller @ 2013-01-08  3:51 UTC (permalink / raw)
  To: ian.campbell; +Cc: netdev, linux, konrad.wilk, annie.li, xen-devel
In-Reply-To: <1357572726-7059-1-git-send-email-ian.campbell@citrix.com>

From: Ian Campbell <ian.campbell@citrix.com>
Date: Mon, 7 Jan 2013 15:32:06 +0000

> Using RX_COPY_THRESHOLD is incorrect if the SKB is actually smaller
> than that. We have already accounted for this in
> NETFRONT_SKB_CB(skb)->pull_to so use that instead.
> 
> Fixes WARN_ON from skb_try_coalesce.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: Sander Eikelenboom <linux@eikelenboom.it>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Cc: annie li <annie.li@oracle.com>
> Cc: xen-devel@lists.xen.org
> Cc: netdev@vger.kernel.org
> Cc: stable@kernel.org # 3.7.x only
> ---
> v2:
>  - acount frags as a full page as recommended by Eric.

Applied, thanks.

^ permalink raw reply

* Re: pull request: batman-adv 2013-01-07
From: David Miller @ 2013-01-08  3:50 UTC (permalink / raw)
  To: ordex; +Cc: netdev, b.a.t.m.a.n
In-Reply-To: <1357557088-17866-1-git-send-email-ordex@autistici.org>


Are you kidding me?

'net' is for bug fixes not futzing around with version numbers and copyright years
inc omments.

^ permalink raw reply

* Re: [PATCH v2 1/1 net-next] net: fec: report correct hardware stamping info to ethtool
From: David Miller @ 2013-01-08  3:48 UTC (permalink / raw)
  To: Frank.Li
  Cc: lznuaa, shawn.guo, richardcochran, linux-arm-kernel, netdev,
	s.hauer
In-Reply-To: <1357525507-16148-1-git-send-email-Frank.Li@freescale.com>

From: Frank Li <Frank.Li@freescale.com>
Date: Mon, 7 Jan 2013 10:25:07 +0800

> Report correct hardware stamping capability by ethtool interface.
> The v1.0 ptp4l check it.
> 
> Signed-off-by: Frank Li <Frank.Li@freescale.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next v4 0/3] netpoll: add IPv6 support
From: David Miller @ 2013-01-08  3:46 UTC (permalink / raw)
  To: amwang; +Cc: netdev
In-Reply-To: <1357543036-15492-1-git-send-email-amwang@redhat.com>

From: Cong Wang <amwang@redhat.com>
Date: Mon,  7 Jan 2013 15:17:13 +0800

> v4: remove ndisc_parse_options(), ignore ICMP options there
>     make udp6_csum_init() inline so that we don't rely on IPV6=y
>     fix a conflict with Jiri's patchset

Where did I say to inline this function?

I said to put it into a seperate static library that gets
linked into the kernel statically, regardless of whether
IPV6 is 'm' or 'y'.

I've said this _3_ times and I'm really starting to get
frustrated with the fact that you can't seem to read what
I write.

What part of the "obj-y +=" rules in net/ipv6/Makefile
are you unable to see?

^ permalink raw reply

* Re: NULL pointer dereference in veth_stats_one
From: David Miller @ 2013-01-08  3:43 UTC (permalink / raw)
  To: erdnetdev; +Cc: bhutchings, tparkin, netdev
In-Reply-To: <1357350160.1678.3303.camel@edumazet-glaptop>

From: Eric Dumazet <erdnetdev@gmail.com>
Date: Fri, 04 Jan 2013 17:42:40 -0800

> From: Eric Dumazet <edumazet@google.com>
 ...
> [PATCH v2 net-next] veth: avoid a NULL deref in veth_stats_one

Applied, thanks Eric.

^ permalink raw reply

* [PATCH v3] net: fec: Remove 'inline' declarations
From: Fabio Estevam @ 2013-01-08  3:42 UTC (permalink / raw)
  To: davem; +Cc: shawn.guo, netdev, joe, Fabio Estevam

From: Fabio Estevam <fabio.estevam@freescale.com>

Fix the following warning when building with W=1 option:

drivers/net/ethernet/freescale/fec.c:810:1: warning: '__inline__' is not at beginning of declaration [-Wold-style-declaration]

The inline declaration is pointless in this function, so just remove it.

While at it, also remove the other 'inline' declarations.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changses since v2:
- Update Subject
- Remove other inline
Changes since v1:
- Remove the 'inline'
 drivers/net/ethernet/freescale/fec.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index a379319..16a1640d 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -807,7 +807,7 @@ fec_enet_interrupt(int irq, void *dev_id)
 
 
 /* ------------------------------------------------------------------------- */
-static void __inline__ fec_get_mac(struct net_device *ndev)
+static void fec_get_mac(struct net_device *ndev)
 {
 	struct fec_enet_private *fep = netdev_priv(ndev);
 	struct fec_platform_data *pdata = fep->pdev->dev.platform_data;
@@ -1562,12 +1562,12 @@ static void fec_reset_phy(struct platform_device *pdev)
 	gpio_set_value(phy_reset, 1);
 }
 #else /* CONFIG_OF */
-static inline int fec_get_phy_mode_dt(struct platform_device *pdev)
+static int fec_get_phy_mode_dt(struct platform_device *pdev)
 {
 	return -ENODEV;
 }
 
-static inline void fec_reset_phy(struct platform_device *pdev)
+static void fec_reset_phy(struct platform_device *pdev)
 {
 	/*
 	 * In case of platform probe, the reset has been done
-- 
1.7.9.5

^ permalink raw reply related

* Re: [PATCH] chelsio: Use netdev_<level> and pr_<level>
From: David Miller @ 2013-01-08  3:41 UTC (permalink / raw)
  To: joe; +Cc: divy, dm, leedom, netdev, linux-kernel
In-Reply-To: <1357515289.4940.6.camel@joe-AO722>

From: Joe Perches <joe@perches.com>
Date: Sun, 06 Jan 2013 15:34:49 -0800

> Use more current logging styles.
> 
> Convert printks to pr_<level> and
> printks with ("%s: ...", dev->name to netdev_<level>(dev, "...
> 
> Add pr_fmt #defines where appropriate.
> Coalesce formats.
> Use pr_<level>_once where appropriate.
> 
> Signed-off-by: Joe Perches <joe@perches.com>

Applied.

^ permalink raw reply

* Re: [PATCH V4] bgmac: driver for GBit MAC core on BCMA bus
From: David Miller @ 2013-01-08  3:40 UTC (permalink / raw)
  To: zajec5; +Cc: netdev, romieu, joe
In-Reply-To: <1357431609-27981-1-git-send-email-zajec5@gmail.com>

From: Rafał Miłecki <zajec5@gmail.com>
Date: Sun,  6 Jan 2013 01:20:09 +0100

> V4: stop queue when ring is full

You're still not doing it right.

> +	if (free_slots == 1) { /* Should never happen (netif_stop_queue) */
> +		bgmac_err(bgmac, "TX after stopping queue!\n");
> +		return NETDEV_TX_BUSY;
> +	}

You need to call netif_stop_queue() in this code path too.

Look more carefully at the drivers we asked you to use as
a model, they all do this properly.

^ permalink raw reply

* Re: [PATCH v2] net: fec: Place 'inline' in the beginning of declaration
From: David Miller @ 2013-01-08  3:36 UTC (permalink / raw)
  To: festevam; +Cc: shawn.guo, netdev, fabio.estevam
In-Reply-To: <1357615751-11659-1-git-send-email-festevam@gmail.com>


Are you really too lazy to update the Subject line?

^ permalink raw reply

* Re: [PATCH v2] net: fec: Place 'inline' in the beginning of declaration
From: Joe Perches @ 2013-01-08  3:35 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: davem, shawn.guo, netdev, Fabio Estevam
In-Reply-To: <1357615751-11659-1-git-send-email-festevam@gmail.com>

On Tue, 2013-01-08 at 01:29 -0200, Fabio Estevam wrote:
> The inline declaration is pointless in this function, so just remove it.

Perhaps remove all 3 inlines from the file at the same time.

^ permalink raw reply

* [PATCH v2] net: fec: Place 'inline' in the beginning of declaration
From: Fabio Estevam @ 2013-01-08  3:29 UTC (permalink / raw)
  To: davem; +Cc: shawn.guo, netdev, Fabio Estevam

From: Fabio Estevam <fabio.estevam@freescale.com>

Fix the following warning when building with W=1 option:

drivers/net/ethernet/freescale/fec.c:810:1: warning: '__inline__' is not at beginning of declaration [-Wold-style-declaration]

The inline declaration is pointless in this function, so just remove it.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v1:
- Remove the 'inline'

 drivers/net/ethernet/freescale/fec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index a379319..69d6069 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -807,7 +807,7 @@ fec_enet_interrupt(int irq, void *dev_id)
 
 
 /* ------------------------------------------------------------------------- */
-static void __inline__ fec_get_mac(struct net_device *ndev)
+static void fec_get_mac(struct net_device *ndev)
 {
 	struct fec_enet_private *fep = netdev_priv(ndev);
 	struct fec_platform_data *pdata = fep->pdev->dev.platform_data;
-- 
1.7.9.5

^ permalink raw reply related

* Re: [PATCH 0/3] Netfilter fixes for 3.8-rc2
From: David Miller @ 2013-01-08  3:26 UTC (permalink / raw)
  To: pablo; +Cc: netfilter-devel, netdev
In-Reply-To: <1357589047-3373-1-git-send-email-pablo@netfilter.org>

From: pablo@netfilter.org
Date: Mon,  7 Jan 2013 21:04:04 +0100

> You can pull these changes from:
> 
> git://1984.lsi.us.es/nf master

Pulled, thanks Pablo.

^ permalink raw reply

* [PATCH] net: fec: Place 'inline' in the beginning of declaration
From: Fabio Estevam @ 2013-01-08  3:20 UTC (permalink / raw)
  To: davem; +Cc: shawn.guo, netdev, Fabio Estevam

From: Fabio Estevam <fabio.estevam@freescale.com>

Fix the following warning when building with W=1 option:

drivers/net/ethernet/freescale/fec.c:810:1: warning: '__inline__' is not at beginning of declaration [-Wold-style-declaration]

Putting __inline__ in the beggining then checkpath complains:

WARNING: plain inline is preferred over __inline__
#24: FILE: drivers/net/ethernet/freescale/fec.c:810:
+static __inline__ void fec_get_mac(struct net_device *ndev)

,so use 'inline' in the beginning and make gcc and checkpath happy.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/net/ethernet/freescale/fec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index a379319..4624f6b 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -807,7 +807,7 @@ fec_enet_interrupt(int irq, void *dev_id)
 
 
 /* ------------------------------------------------------------------------- */
-static void __inline__ fec_get_mac(struct net_device *ndev)
+static inline void fec_get_mac(struct net_device *ndev)
 {
 	struct fec_enet_private *fep = netdev_priv(ndev);
 	struct fec_platform_data *pdata = fep->pdev->dev.platform_data;
-- 
1.7.9.5

^ permalink raw reply related

* Re: [PATCH] net: fec: Place 'inline' in the beginning of declaration
From: David Miller @ 2013-01-08  3:23 UTC (permalink / raw)
  To: festevam; +Cc: shawn.guo, netdev, fabio.estevam
In-Reply-To: <1357615233-30241-1-git-send-email-festevam@gmail.com>

From: Fabio Estevam <festevam@gmail.com>
Date: Tue,  8 Jan 2013 01:20:33 -0200

> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> Fix the following warning when building with W=1 option:
> 
> drivers/net/ethernet/freescale/fec.c:810:1: warning: '__inline__' is not at beginning of declaration [-Wold-style-declaration]
> 
> Putting __inline__ in the beggining then checkpath complains:
> 
> WARNING: plain inline is preferred over __inline__
> #24: FILE: drivers/net/ethernet/freescale/fec.c:810:
> +static __inline__ void fec_get_mac(struct net_device *ndev)
> 
> ,so use 'inline' in the beginning and make gcc and checkpath happy.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

I would remove the inline tag altogether, it's pointless.

^ permalink raw reply

* linux-next: manual merge of the drop-experimental tree with Linus' and the net-next  trees
From: Stephen Rothwell @ 2013-01-08  3:19 UTC (permalink / raw)
  To: Kees Cook
  Cc: linux-next, linux-kernel, Ben Hutchings, Paul Gortmaker,
	David Miller, netdev

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

Hi Kees,

Today's linux-next merge of the drop-experimental tree got a conflict in
drivers/net/ethernet/intel/Kconfig between commit c56283034ce2 ("pps,
ptp: Remove dependencies on EXPERIMENTAL") from Linus' tree, commit
483f777266f5 ("drivers/net: remove orphaned references to micro channel")
from the net-next tree and commit a9270b9a8436
("drivers/net/ethernet/intel: remove depends on CONFIG_EXPERIMENTAL")
from the drop-experimental tree.

I fixed it up and can carry the fix as necessary (no action is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

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

^ permalink raw reply

* Re: [RFC PATCH] vsprintf: Add %p*D extension for 80211 SSIDs
From: Chen Gang @ 2013-01-08  3:20 UTC (permalink / raw)
  To: Joe Perches
  Cc: Johannes Berg, John W. Linville, stas.yakovlev, linux-wireless,
	netdev
In-Reply-To: <1357614687.12749.41.camel@joe-AO722>

于 2013年01月08日 11:11, Joe Perches 写道:
> On Tue, 2013-01-08 at 10:57 +0800, Chen Gang wrote:
>>   sorry, I am not quite clear about what you said.
> 
> You found some overrun errors and proposed a patch.
> Your solution could output incomplete SSIDs.
> 
> I proposed a different patch that would fully output
> any binary/non-ascii printable SSID.
> 
> I also proposed a different mechanism to avoid the
> overrun via printk and also avoid possibly excessive
> stack consumption as a means for John Linville to
> select 1 of the above options.
> 
> I don't care what is done with any of those proposed
> patches.
> 
> Clear?
> 

  ok

-- 
Chen Gang

Asianux Corporation

^ permalink raw reply

* linux-next: manual merge of the drop-experimental tree with the net-next tree
From: Stephen Rothwell @ 2013-01-08  3:15 UTC (permalink / raw)
  To: Kees Cook; +Cc: linux-next, linux-kernel, David Miller, netdev, Paul Gortmaker

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

Hi Kees,

Today's linux-next merge of the drop-experimental tree got conflicts in
drivers/net/ethernet/8390/Kconfig and drivers/net/ethernet/i825xx/Kconfig
between commits 483f777266f5 ("drivers/net: remove orphaned references to
micro channel") from the net-next tree and commits 16f5471ff2da
("drivers/net/ethernet/8390: remove depends on CONFIG_EXPERIMENTAL") and
65af6f091e6d ("drivers/net/ethernet/i825xx: remove depends on
CONFIG_EXPERIMENTAL") from the drop-experimental tree.

I fixed it up (I used the latter versions) and can carry the fix as
necessary (no action is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

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

^ permalink raw reply

* Re: [RFC PATCH] vsprintf: Add %p*D extension for 80211 SSIDs
From: Joe Perches @ 2013-01-08  3:11 UTC (permalink / raw)
  To: Chen Gang
  Cc: Johannes Berg, John W. Linville,
	stas.yakovlev-Re5JQEeQqe8AvxtiuMwx3w,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <50EB8B1A.9000404-bOixZGp5f+dBDgjK7y7TUQ@public.gmane.org>

On Tue, 2013-01-08 at 10:57 +0800, Chen Gang wrote:
> 于 2013年01月08日 01:22, Joe Perches 写道:
> > On Mon, 2013-01-07 at 08:47 +0100, Johannes Berg wrote:
> >> > print_ssid() is used in two or
> >> > three legacy drivers only, not in any modern driver, and is unlikely to
> >> > be used in the more modern drivers due to tracing etc.
> > Swell.  It was just another way to correct those overrun
> > errors Chen Gang found.
> > 
>   sorry, I am not quite clear about what you said.

You found some overrun errors and proposed a patch.
Your solution could output incomplete SSIDs.

I proposed a different patch that would fully output
any binary/non-ascii printable SSID.

I also proposed a different mechanism to avoid the
overrun via printk and also avoid possibly excessive
stack consumption as a means for John Linville to
select 1 of the above options.

I don't care what is done with any of those proposed
patches.

Clear?

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: PROBLEM: Software injected vlan tagged packets are unable to be identified using recent BPF modifications
From: Paul Pearce @ 2013-01-08  3:04 UTC (permalink / raw)
  To: tcpdump-workers
  Cc: netdev, Ani Sinha, David Miller, edumazet, jpirko,
	Francesco Ruggeri
In-Reply-To: <CAOxq_8MJZtFYHmsqQdZ+DSDuHjgkQYrHG2rPt32m6TRTV-ZS9A@mail.gmail.com>

The original message didn't make it to the tcpdump-workers list. It follows.

---------- Forwarded message ----------
From: Paul Pearce <pearce@cs.berkeley.edu>
Date: Mon, Jan 7, 2013 at 4:05 PM
Subject: PROBLEM: Software injected vlan tagged packets are unable to
be identified using recent BPF modifications
To: netdev@vger.kernel.org, tcpdump-workers@lists.tcpdump.org
Cc: davem@davemloft.net, edumazet@google.com, jpirko@redhat.com, Ani
Sinha <ani@aristanetworks.com>


Hello folks,

PROBLEM:

vlan tagged packets that are injected via software are not picked up
by filters using recent (kernel commit
f3335031b9452baebfe49b8b5e55d3fe0c4677d1)
BPF vlan modifications. I suspect this is a problem with the Linux
kernel.

linux-netdev and tcpdump-workers are both cc'd.

BACKGROUND:

Kernel commit bcc6d47903612c3861201cc3a866fb604f26b8b2 (Jiri
Pirko/David S. Miller) removed vlan headers on rx packets prior to
them reaching the packet filters. This broke BPF/libpcap's ability to
do kernel-level packet filtering based on vlan tag information (the
'vlan' keyword).

Kernel commit f3335031b9452baebfe49b8b5e55d3fe0c4677d1 (Eric
Dumazet/David S. Miller, just merged into Linus's tree
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=f3335031b9452baebfe49b8b5e55d3fe0c4677d1)
added the ability to use BPF to once again filter based on vlan
tags. Related bpf jit commit:
http://www.spinics.net/lists/netdev/msg214759.html

libpcap (Ani Sinha) recently RFC'd a patch to use Eric/David's BPF
modifications to restore vlan filtering to libpcap.
http://www.mail-archive.com/tcpdump-workers@lists.tcpdump.org/msg06810.html
I'm using this patch and it works.

DETAILS:

Under these patches vlan tagged packets received from mediam (actual
packets from the wire) can be identified based on vlan tag information
using the new BPF functionality.This is good.

However, raw vlan tagged packets that are *injected* into the
interface using libpcap's pcap_inject() (which is just a fancy wrapper
for the send() syscall) are not identified by filters using the recent
BPF modifications.

The bug manifests itself if you attempt to use the new BPF
modifications to filter vlan tagged packets on a live interface. All
packets from the medium show up, but all injected packets are dropped.

Prior to commit bcc6d47 both medium and injected packets could both be
identified using BPFs.

These injected packets can however still be identified using the
previous, now incorrect "offset into the header" technique. Given
this, I suspect what's going on is the kernel code path for these
injected packets is not setting skb->vlan_tci correctly (at all?).
Since the vlan tag is not in the skb data structure the new BPF
modifications don't identify the packets as having a vlan tag,
despite it being in the packet header.

I'm not sure exactly where the bug exists so I'm reaching out to both
netdev and tcpdump-workers. Although, as I said, I suspect this is on
the kernel side.

SOFTWARE:

kernel-3.6.11-1.fc16.x86_64, with both kernel commits
f3335031b9452baebfe49b8b5e55d3fe0c4677d1 and the related commit
http://www.spinics.net/lists/netdev/msg214759.html backported.
tcpdump version 4.4.0-PRE-GIT_2013_01_06 (commit
05bf602ef684d5b75c0ac71be04212d909c37834)
libpcap version 1.4.0-PRE-GIT_2013_01_06 (commit
713034fc4b3a2c14ae81e44dca34d998db8d0795 with patch specified above)

Thanks.

-Paul Pearce

Security Graduate Student
Computer Science
University of California, Berkeley

^ permalink raw reply

* Re: [RFC PATCH] vsprintf: Add %p*D extension for 80211 SSIDs
From: Chen Gang @ 2013-01-08  2:57 UTC (permalink / raw)
  To: Joe Perches
  Cc: Johannes Berg, John W. Linville,
	stas.yakovlev-Re5JQEeQqe8AvxtiuMwx3w,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1357579362.21481.45.camel@joe-AO722>

于 2013年01月08日 01:22, Joe Perches 写道:
> On Mon, 2013-01-07 at 08:47 +0100, Johannes Berg wrote:
>> > print_ssid() is used in two or
>> > three legacy drivers only, not in any modern driver, and is unlikely to
>> > be used in the more modern drivers due to tracing etc.
> Swell.  It was just another way to correct those overrun
> errors Chen Gang found.
> 

  sorry, I am not quite clear about what you said.


-- 
Chen Gang

Asianux Corporation
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH 2/5] GRE: Use RTNL for atomic protocol registration.
From: Pravin B Shelar @ 2013-01-08  2:31 UTC (permalink / raw)
  To: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA
  Cc: shemminger-ZtmgI6mnKB3QT0dZR+AlfA

From: Pravin Shelar <pshelar-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>

Currently gre demultiplexer uses its own spin-lock. We should
rather RTNL lock.

Suggested-by: Stephen Hemminger <shemminger-ZtmgI6mnKB3QT0dZR+AlfA@public.gmane.org>
Signed-off-by: Pravin B Shelar <pshelar-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
---
 drivers/net/ppp/pptp.c |    4 ++++
 net/ipv4/gre.c         |   18 +++++-------------
 net/ipv4/ip_gre.c      |    4 ++++
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/net/ppp/pptp.c b/drivers/net/ppp/pptp.c
index 162464f..672e7e3 100644
--- a/drivers/net/ppp/pptp.c
+++ b/drivers/net/ppp/pptp.c
@@ -673,7 +673,9 @@ static int __init pptp_init_module(void)
 	if (!callid_sock)
 		return -ENOMEM;
 
+	rtnl_lock();
 	err = gre_add_protocol(&gre_pptp_protocol, GREPROTO_PPTP);
+	rtnl_unlock();
 	if (err) {
 		pr_err("PPTP: can't add gre protocol\n");
 		goto out_mem_free;
@@ -707,7 +709,9 @@ static void __exit pptp_exit_module(void)
 {
 	unregister_pppox_proto(PX_PROTO_PPTP);
 	proto_unregister(&pptp_sk_proto);
+	rtnl_lock();
 	gre_del_protocol(&gre_pptp_protocol, GREPROTO_PPTP);
+	rtnl_unlock();
 	vfree(callid_sock);
 }
 
diff --git a/net/ipv4/gre.c b/net/ipv4/gre.c
index 0eaaf44..c0757c9 100644
--- a/net/ipv4/gre.c
+++ b/net/ipv4/gre.c
@@ -26,23 +26,19 @@
 
 
 static const struct gre_protocol __rcu *gre_proto[GREPROTO_MAX] __read_mostly;
-static DEFINE_SPINLOCK(gre_proto_lock);
 
 int gre_add_protocol(const struct gre_protocol *proto, u8 version)
 {
+	ASSERT_RTNL();
 	if (version >= GREPROTO_MAX)
 		goto err_out;
 
-	spin_lock(&gre_proto_lock);
 	if (gre_proto[version])
-		goto err_out_unlock;
+		goto err_out;
 
 	RCU_INIT_POINTER(gre_proto[version], proto);
-	spin_unlock(&gre_proto_lock);
 	return 0;
 
-err_out_unlock:
-	spin_unlock(&gre_proto_lock);
 err_out:
 	return -1;
 }
@@ -50,20 +46,16 @@ EXPORT_SYMBOL_GPL(gre_add_protocol);
 
 int gre_del_protocol(const struct gre_protocol *proto, u8 version)
 {
+	ASSERT_RTNL();
 	if (version >= GREPROTO_MAX)
 		goto err_out;
 
-	spin_lock(&gre_proto_lock);
-	if (rcu_dereference_protected(gre_proto[version],
-			lockdep_is_held(&gre_proto_lock)) != proto)
-		goto err_out_unlock;
+	if (rtnl_dereference(gre_proto[version]) != proto)
+		goto err_out;
 	RCU_INIT_POINTER(gre_proto[version], NULL);
-	spin_unlock(&gre_proto_lock);
 	synchronize_rcu();
 	return 0;
 
-err_out_unlock:
-	spin_unlock(&gre_proto_lock);
 err_out:
 	return -1;
 }
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 303012a..05f389f 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -1792,7 +1792,9 @@ static int __init ipgre_init(void)
 	if (err < 0)
 		return err;
 
+	rtnl_lock();
 	err = gre_add_protocol(&ipgre_protocol, GREPROTO_CISCO);
+	rtnl_unlock();
 	if (err < 0) {
 		pr_info("%s: can't add protocol\n", __func__);
 		goto add_proto_failed;
@@ -1822,8 +1824,10 @@ static void __exit ipgre_fini(void)
 {
 	rtnl_link_unregister(&ipgre_tap_ops);
 	rtnl_link_unregister(&ipgre_link_ops);
+	rtnl_lock();
 	if (gre_del_protocol(&ipgre_protocol, GREPROTO_CISCO) < 0)
 		pr_info("%s: can't remove protocol\n", __func__);
+	rtnl_unlock();
 	unregister_pernet_device(&ipgre_net_ops);
 }
 
-- 
1.7.1

^ permalink raw reply related

* [PATCH 1/5] GRE: Add segmentation offload for GRE TAP device.
From: Pravin B Shelar @ 2013-01-08  2:31 UTC (permalink / raw)
  To: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA

From: Pravin Shelar <pshelar-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>

Signed-off-by: Pravin B Shelar <pshelar-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
---
 include/linux/skbuff.h |   12 ++++++
 include/net/gre.h      |    6 +++
 net/ipv4/af_inet.c     |    1 +
 net/ipv4/gre.c         |  101 ++++++++++++++++++++++++++++++++++++++++++++++++
 net/ipv4/tcp.c         |    1 +
 net/ipv4/udp.c         |    3 +-
 net/ipv6/ip6_offload.c |    1 +
 net/ipv6/udp_offload.c |    3 +-
 8 files changed, 126 insertions(+), 2 deletions(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 320e976..43033f0 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -307,6 +307,8 @@ enum {
 	SKB_GSO_TCPV6 = 1 << 4,
 
 	SKB_GSO_FCOE = 1 << 5,
+
+	SKB_GSO_GRE = 1 << 6,
 };
 
 #if BITS_PER_LONG > 32
@@ -797,6 +799,16 @@ static inline int skb_cloned(const struct sk_buff *skb)
 	       (atomic_read(&skb_shinfo(skb)->dataref) & SKB_DATAREF_MASK) != 1;
 }
 
+static inline int skb_unclone(struct sk_buff *skb, gfp_t pri)
+{
+	might_sleep_if(pri & __GFP_WAIT);
+
+	if (skb_cloned(skb))
+		return pskb_expand_head(skb, 0, 0, pri);
+
+	return 0;
+}
+
 /**
  *	skb_header_cloned - is the header a clone
  *	@skb: buffer to check
diff --git a/include/net/gre.h b/include/net/gre.h
index 8266547..f7d5bfb 100644
--- a/include/net/gre.h
+++ b/include/net/gre.h
@@ -15,4 +15,10 @@ struct gre_protocol {
 int gre_add_protocol(const struct gre_protocol *proto, u8 version);
 int gre_del_protocol(const struct gre_protocol *proto, u8 version);
 
+struct gre_base_hdr {
+	__be16 flags;
+	__be16 protocol;
+};
+#define GRE_HEADER_SECTION 4
+
 #endif
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 24b384b..9a3d5d2 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1306,6 +1306,7 @@ static struct sk_buff *inet_gso_segment(struct sk_buff *skb,
 		       SKB_GSO_UDP |
 		       SKB_GSO_DODGY |
 		       SKB_GSO_TCP_ECN |
+		       SKB_GSO_GRE |
 		       0)))
 		goto out;
 
diff --git a/net/ipv4/gre.c b/net/ipv4/gre.c
index 42a4910..0eaaf44 100644
--- a/net/ipv4/gre.c
+++ b/net/ipv4/gre.c
@@ -19,6 +19,7 @@
 #include <linux/in.h>
 #include <linux/ip.h>
 #include <linux/netdevice.h>
+#include <linux/if_tunnel.h>
 #include <linux/spinlock.h>
 #include <net/protocol.h>
 #include <net/gre.h>
@@ -112,12 +113,105 @@ static void gre_err(struct sk_buff *skb, u32 info)
 	rcu_read_unlock();
 }
 
+static struct sk_buff *gre_gso_segment(struct sk_buff *skb,
+				       netdev_features_t features)
+{
+	struct sk_buff *segs = ERR_PTR(-EINVAL);
+	struct gre_base_hdr *greh;
+	unsigned char *mac = skb_mac_header(skb);
+	int net_hlen = skb_network_header_len(skb);
+	int ghl = GRE_HEADER_SECTION;
+	int mac_len;
+	int doffset;
+
+	if (unlikely(skb_shinfo(skb)->gso_type &
+				~(SKB_GSO_TCPV4 |
+					SKB_GSO_UDP |
+					SKB_GSO_DODGY |
+					SKB_GSO_TCP_ECN |
+					SKB_GSO_GRE |
+					0)))
+		goto out;
+
+	if (unlikely(!pskb_may_pull(skb, sizeof(*greh))))
+		goto out;
+
+	greh = (struct gre_base_hdr *)skb_transport_header(skb);
+
+	if (greh->flags & GRE_KEY)
+		ghl += GRE_HEADER_SECTION;
+	if (greh->flags & GRE_CSUM)
+		ghl += GRE_HEADER_SECTION;
+
+	if (unlikely(!pskb_may_pull(skb, ghl)))
+		goto out;
+
+	__skb_pull(skb, ghl);
+	skb_reset_mac_header(skb);
+	skb_set_network_header(skb, skb->mac_len);
+	doffset = skb_mac_header(skb) - mac;
+	/* segment inner packet. */
+	segs = skb_gso_segment(skb, 0);
+	if (!segs || IS_ERR(segs))
+		goto out;
+
+	mac_len = skb_inner_network_header(skb) - ((unsigned char *)greh + ghl);
+	skb = segs;
+	do {
+		unsigned char *smac;
+
+		skb_push(skb, doffset);
+
+		skb_reset_mac_header(skb);
+		skb_set_network_header(skb, mac_len);
+		skb_set_transport_header(skb,
+					 skb_network_offset(skb) + net_hlen);
+		smac = skb_mac_header(skb);
+		skb->mac_len = mac_len;
+		/* Copy entire outer header from original skb. */
+		memcpy(smac, mac, doffset);
+
+		greh = (struct gre_base_hdr *)skb_transport_header(skb);
+		if (greh->flags & GRE_CSUM) {
+			__be32 *gre_csum = (__be32 *)(greh + 1);
+			*gre_csum = 0;
+			*(__sum16 *)gre_csum = csum_fold(skb_checksum(skb,
+						skb_transport_offset(skb),
+						skb->len - skb_transport_offset(skb),
+						0));
+		}
+	} while ((skb = skb->next));
+
+out:
+	return segs;
+}
+
+static int gre_gso_send_check(struct sk_buff *skb)
+{
+	struct gre_base_hdr *greh;
+
+	if (!skb->encapsulation)
+		return -EINVAL;
+
+	greh = (struct gre_base_hdr *)skb_transport_header(skb);
+	if (greh->flags & GRE_SEQ)
+		return -EINVAL;
+	return 0;
+}
+
 static const struct net_protocol net_gre_protocol = {
 	.handler     = gre_rcv,
 	.err_handler = gre_err,
 	.netns_ok    = 1,
 };
 
+static const struct net_offload gre_offload = {
+	.callbacks = {
+		.gso_send_check =	gre_gso_send_check,
+		.gso_segment    =	gre_gso_segment,
+	},
+};
+
 static int __init gre_init(void)
 {
 	pr_info("GRE over IPv4 demultiplexor driver\n");
@@ -127,11 +221,18 @@ static int __init gre_init(void)
 		return -EAGAIN;
 	}
 
+	if (inet_add_offload(&gre_offload, IPPROTO_GRE)) {
+		pr_err("can't add protocol offload\n");
+		inet_del_protocol(&net_gre_protocol, IPPROTO_GRE);
+		return -EAGAIN;
+	}
+
 	return 0;
 }
 
 static void __exit gre_exit(void)
 {
+	inet_del_offload(&gre_offload, IPPROTO_GRE);
 	inet_del_protocol(&net_gre_protocol, IPPROTO_GRE);
 }
 
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 1ca2536..08d22e3 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -3025,6 +3025,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb,
 			       SKB_GSO_DODGY |
 			       SKB_GSO_TCP_ECN |
 			       SKB_GSO_TCPV6 |
+			       SKB_GSO_GRE |
 			       0) ||
 			     !(type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6))))
 			goto out;
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 79c8dbe..c256008 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -2279,7 +2279,8 @@ struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb,
 		/* Packet is from an untrusted source, reset gso_segs. */
 		int type = skb_shinfo(skb)->gso_type;
 
-		if (unlikely(type & ~(SKB_GSO_UDP | SKB_GSO_DODGY) ||
+		if (unlikely(type & ~(SKB_GSO_UDP | SKB_GSO_DODGY |
+				      SKB_GSO_GRE) ||
 			     !(type & (SKB_GSO_UDP))))
 			goto out;
 
diff --git a/net/ipv6/ip6_offload.c b/net/ipv6/ip6_offload.c
index f26f0da..8234c1d 100644
--- a/net/ipv6/ip6_offload.c
+++ b/net/ipv6/ip6_offload.c
@@ -99,6 +99,7 @@ static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb,
 		     ~(SKB_GSO_UDP |
 		       SKB_GSO_DODGY |
 		       SKB_GSO_TCP_ECN |
+		       SKB_GSO_GRE |
 		       SKB_GSO_TCPV6 |
 		       0)))
 		goto out;
diff --git a/net/ipv6/udp_offload.c b/net/ipv6/udp_offload.c
index 0c8934a..cf05cf0 100644
--- a/net/ipv6/udp_offload.c
+++ b/net/ipv6/udp_offload.c
@@ -56,7 +56,8 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb,
 		/* Packet is from an untrusted source, reset gso_segs. */
 		int type = skb_shinfo(skb)->gso_type;
 
-		if (unlikely(type & ~(SKB_GSO_UDP | SKB_GSO_DODGY) ||
+		if (unlikely(type & ~(SKB_GSO_UDP | SKB_GSO_DODGY |
+				      SKB_GSO_GRE) ||
 			     !(type & (SKB_GSO_UDP))))
 			goto out;
 
-- 
1.7.1

^ permalink raw reply related


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