* Re: [RFC 5/5] [powerpc] Implement a p1010rdb clock source.
From: Robin Holt @ 2011-08-08 11:31 UTC (permalink / raw)
To: Wolfgang Grandegger
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w, U Bhaskar-B22300,
Marc Kleine-Budde, netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <4E3FA066.3020301-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
On Mon, Aug 08, 2011 at 10:37:58AM +0200, Wolfgang Grandegger wrote:
> On 08/06/2011 04:34 PM, Robin Holt wrote:
> > flexcan driver needs the clk_get, clk_get_rate, etc functions
> > to work. This patch provides the minimum functionality.
>
> This needs some more general thoughts... apart from the question where
> the code should go.
>
> Like for the MSCAN on the MPC5200, the user should be *able* to select
> an appropriate clock source and divider via DTS node properties.
> Currently it seems, that the DTS properties must match some
> pre-configured values, most likely set by the boot loader. Please
> correct me if I'm wrong. For me this is generic and should go into the
> Flexcan driver. From there, a platform specific function, e.g.
> flexcan_set_clock() might be called.
OK. Dug a bit more. The p1010 built-in clocksource seems to be the
periphereal clock frequency which is system bus frequency divided
by 2. The clock source can not be changed, but the clock divider can
by freezing the interface and setting the CTRL register. This appears
to only be done by the boot loader. I do not see why we can not leave
that functionality in the boot loader and then go back to a variation
on my earlier flexcan_clk_* patch. Is that close to the direction you
think we should go or have I completely misunderstood your wishes?
Thanks,
Robin
^ permalink raw reply
* [PATCH 9/9] drivers/net/wireless/wl1251: add missing kfree
From: Julia Lawall @ 2011-08-08 11:18 UTC (permalink / raw)
To: Luciano Coelho
Cc: kernel-janitors, John W. Linville, linux-wireless, netdev,
linux-kernel
From: Julia Lawall <julia@diku.dk>
In each case, the kfree already at the end of the function is also needed
in the error case.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@exists@
local idexpression x;
statement S,S1;
expression E;
identifier fl;
expression *ptr != NULL;
@@
x = \(kmalloc\|kzalloc\|kcalloc\)(...);
...
if (x == NULL) S
<... when != x
when != if (...) { <+...kfree(x)...+> }
when any
when != true x == NULL
x->fl
...>
(
if (x == NULL) S1
|
if (...) { ... when != x
when forall
(
return \(0\|<+...x...+>\|ptr\);
|
* return ...;
)
}
)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
drivers/net/wireless/wl1251/acx.c | 6 +-----
drivers/net/wireless/wl1251/cmd.c | 2 +-
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/wl1251/acx.c b/drivers/net/wireless/wl1251/acx.c
index ef8370e..ad87a1a 100644
--- a/drivers/net/wireless/wl1251/acx.c
+++ b/drivers/net/wireless/wl1251/acx.c
@@ -140,8 +140,6 @@ int wl1251_acx_sleep_auth(struct wl1251 *wl, u8 sleep_auth)
auth->sleep_auth = sleep_auth;
ret = wl1251_cmd_configure(wl, ACX_SLEEP_AUTH, auth, sizeof(*auth));
- if (ret < 0)
- return ret;
out:
kfree(auth);
@@ -681,10 +679,8 @@ int wl1251_acx_cca_threshold(struct wl1251 *wl)
ret = wl1251_cmd_configure(wl, ACX_CCA_THRESHOLD,
detection, sizeof(*detection));
- if (ret < 0) {
+ if (ret < 0)
wl1251_warning("failed to set cca threshold: %d", ret);
- return ret;
- }
out:
kfree(detection);
diff --git a/drivers/net/wireless/wl1251/cmd.c b/drivers/net/wireless/wl1251/cmd.c
index 81f164b..d14d69d 100644
--- a/drivers/net/wireless/wl1251/cmd.c
+++ b/drivers/net/wireless/wl1251/cmd.c
@@ -241,7 +241,7 @@ int wl1251_cmd_data_path(struct wl1251 *wl, u8 channel, bool enable)
if (ret < 0) {
wl1251_error("tx %s cmd for channel %d failed",
enable ? "start" : "stop", channel);
- return ret;
+ goto out;
}
wl1251_debug(DEBUG_BOOT, "tx %s cmd channel %d",
^ permalink raw reply related
* [PATCH 2/9] drivers/net/wireless/wl12xx: add missing kfree
From: Julia Lawall @ 2011-08-08 11:17 UTC (permalink / raw)
To: Luciano Coelho
Cc: kernel-janitors, John W. Linville, linux-wireless, netdev,
linux-kernel
From: Julia Lawall <julia@diku.dk>
In each case, the freed data should be freed in the error handling code as
well.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@exists@
local idexpression x;
statement S,S1;
expression E;
identifier fl;
expression *ptr != NULL;
@@
x = \(kmalloc\|kzalloc\|kcalloc\)(...);
...
if (x == NULL) S
<... when != x
when != if (...) { <+...kfree(x)...+> }
when any
when != true x == NULL
x->fl
...>
(
if (x == NULL) S1
|
if (...) { ... when != x
when forall
(
return \(0\|<+...x...+>\|ptr\);
|
* return ...;
)
}
)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
drivers/net/wireless/wl12xx/acx.c | 6 +-----
drivers/net/wireless/wl12xx/testmode.c | 5 ++++-
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/testmode.c b/drivers/net/wireless/wl12xx/testmode.c
index 5d5e1ef..88add68 100644
--- a/drivers/net/wireless/wl12xx/testmode.c
+++ b/drivers/net/wireless/wl12xx/testmode.c
@@ -139,12 +139,15 @@ static int wl1271_tm_cmd_interrogate(struct wl1271 *wl, struct nlattr *tb[])
if (ret < 0) {
wl1271_warning("testmode cmd interrogate failed: %d", ret);
+ kfree(cmd);
return ret;
}
skb = cfg80211_testmode_alloc_reply_skb(wl->hw->wiphy, sizeof(*cmd));
- if (!skb)
+ if (!skb) {
+ kfree(cmd);
return -ENOMEM;
+ }
NLA_PUT(skb, WL1271_TM_ATTR_DATA, sizeof(*cmd), cmd);
diff --git a/drivers/net/wireless/wl12xx/acx.c b/drivers/net/wireless/wl12xx/acx.c
index 7e33f1f..34f6ab5 100644
--- a/drivers/net/wireless/wl12xx/acx.c
+++ b/drivers/net/wireless/wl12xx/acx.c
@@ -77,8 +77,6 @@ int wl1271_acx_sleep_auth(struct wl1271 *wl, u8 sleep_auth)
auth->sleep_auth = sleep_auth;
ret = wl1271_cmd_configure(wl, ACX_SLEEP_AUTH, auth, sizeof(*auth));
- if (ret < 0)
- return ret;
out:
kfree(auth);
@@ -624,10 +622,8 @@ int wl1271_acx_cca_threshold(struct wl1271 *wl)
ret = wl1271_cmd_configure(wl, ACX_CCA_THRESHOLD,
detection, sizeof(*detection));
- if (ret < 0) {
+ if (ret < 0)
wl1271_warning("failed to set cca threshold: %d", ret);
- return ret;
- }
out:
kfree(detection);
^ permalink raw reply related
* "Winner"
From: =?utf-8?q?Motorola_=C2=AE__=3Cinfo=40mail=2Ecom=3E?= @ 2011-08-09 1:56 UTC (permalink / raw)
To: Recipients
You Won £600,000.00GBP from Motorola Promotion 2011. Bee Line Courier Service UK (beeline@diploma.com)for your Check delivery with your Name,Address,Country,Phone Number
^ permalink raw reply
* Re: [EXAMPLE CODE] Parasite thread injection and TCP connection hijacking
From: Tejun Heo @ 2011-08-08 10:20 UTC (permalink / raw)
To: Andy Lutomirski
Cc: Matt Helsley, Pavel Emelyanov, Nathan Lynch, Oren Laadan,
Daniel Lezcano, James E.J. Bottomley, David S. Miller,
linux-kernel, netdev
In-Reply-To: <20110806130037.GD23937@htj.dyndns.org>
On Sat, Aug 06, 2011 at 03:00:37PM +0200, Tejun Heo wrote:
> Hello,
>
> On Sat, Aug 06, 2011 at 08:45:28AM -0400, Andy Lutomirski wrote:
> > > 2. Decide where to inject the foreign code and save the original code
> > > with PTRACE_PEEKDATA. Tracer can poke any mapped area regardless
> > > of protection flags but it can't add execution permission to the
> > > code, so it needs to choose memory area which already has X flag
> > > set. The example code uses the page the %rip is in.
> >
> > If the process is executing from the vsyscall page, then you'll
> > probably fail. (Admittedly, this is rather unlikely, given that the
> > vsyscalls are now exactly one instruction.) Presumably you also
> > fail if executing from a read-only MAP_SHARED mapping.
>
> Heh, yeah, I originally thought about scanning /proc/PID/maps to look
> for the page to use but was lazy and just used %rip. I think that
> should work. I'll note the problem in README.
Okay, updated README.
http://code.google.com/p/ptrace-parasite/source/browse/README
Thanks.
--
tejun
^ permalink raw reply
* Re: [PATCH] netfilter: avoid double free in nf_reinject
From: Jan Engelhardt @ 2011-08-08 10:13 UTC (permalink / raw)
To: David Miller; +Cc: ja, kaber, netfilter-devel, netdev, kswamy
In-Reply-To: <20110807.221158.636741102851927559.davem@davemloft.net>
On Monday 2011-08-08 07:11, David Miller wrote:
>From: Julian Anastasov <ja@ssi.bg>
>Date: Fri, 5 Aug 2011 13:36:28 +0300 (EEST)
>
>>
>> NF_STOLEN means skb was already freed
>>
>> Signed-off-by: Julian Anastasov <ja@ssi.bg>
>> ---
>>
>> May be fixes IPVS+ip_queue problem reported by Kumar Swamy:
>>
>> http://marc.info/?l=linux-virtual-server&m=131098073717449&w=2
>
>Since the netfilter maintainers are taking too damn long to integrate
>bug fixes (and this has been happening for months), I'm going to apply
>this directly.
I am offering myself as a candidate for a substitute.
^ permalink raw reply
* Nine Hundred And Fifty Thousand Pounds Has Been Given To You In The Benz Offer, Provide Your
From: jerrysmith232 @ 2011-08-08 10:08 UTC (permalink / raw)
Names
Address
Phone Number
Country
^ permalink raw reply
* Matter of interest
From: Alfred L. Leng @ 2011-08-08 9:01 UTC (permalink / raw)
To: netdev
It is understandable for you to grow apprehensive reading from me today since there was no previous communication between us. I am Alfred L. Leng (Dr.), the managing attorney of R & L Associates Malaysia. \v\vI came across your contact via scrupulous search conducted by an IT specialist whom I have employed for the purpose of same. \v\vThe present communication is prompted by a legitimate business interest I have to share and ensue with you. I have left out the detail of the business matter until I hear from you as measure of security. \v\vPlease be reminded that I would not have incurred great efforts to contact you for a matter of nonentity or to waste your time or mine. Further, be confident that the matter in question is beneficial and legit with no ramification of any sort; details of the matter I will uncover to you in my following communication. \v\vKindly, revert to me accordingly for further exhaustive dialogue. \v\vThank you for your time as I am looking forward for yours and business relation. \v\vSincerely \v\vAlfred Leng.
^ permalink raw reply
* Re: [RFC 4/4] [powerpc] Implement a p1010rdb clock source.
From: Marc Kleine-Budde @ 2011-08-08 9:32 UTC (permalink / raw)
To: Wolfgang Grandegger
Cc: Netdev, U Bhaskar-B22300, Kumar Gala,
socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Development
In-Reply-To: <4E3FA301.4050005-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 3411 bytes --]
On 08/08/2011 10:49 AM, Wolfgang Grandegger wrote:
> On 08/06/2011 10:59 PM, Kumar Gala wrote:
>>
>> On Aug 6, 2011, at 3:50 PM, Robin Holt wrote:
>>
>>> On Sat, Aug 06, 2011 at 11:52:45AM -0500, Kumar Gala wrote:
>>>>
>>>> On Aug 6, 2011, at 8:58 AM, Marc Kleine-Budde wrote:
>>>>
>>>>> On 08/06/2011 06:05 AM, Robin Holt wrote:
>>>>>> flexcan driver needs the clk_get, clk_get_rate, etc functions
>>>>>> to work. This patch provides the minimum functionality.
>>>>>
>>>>> This patch has to go via the powerpc git tree. Added
>>>>> linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org on CC.
>>>>>
>>>>>> Signed-off-by: Robin Holt <holt-sJ/iWh9BUns@public.gmane.org>
>>>>>> To: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
>>>>>> To: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
>>>>>> To: U Bhaskar-B22300 <B22300-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
>>>>>> Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
>>>>>> Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>>>>>> ---
>>>>>> arch/powerpc/platforms/85xx/p1010rdb.c | 78 ++++++++++++++++++++++++++++++++
>>>>>> 1 files changed, 78 insertions(+), 0 deletions(-)
>>>>
>>>> NAK.
>>>>
>>>> This doesn't look right at all. We should be doing something based on the device tree node that isn't board specific.
>>>>
>>>> I believe Bhaskar has a version of flexcan support that he's been working on cleanup up for upstream.
>>>
>>> That version may be similar to what is in the freescale BSP which puts
>>> the clock functions inside flexcan.c
>>>
>>> The powerpc arch already provides a means for individual boards to provide
>>> the clock functions. I am not posting this patch here for acceptance
>>> for powerpc and I am sure I will get feedback there when I post to
>>> their mailing list. I am posting it here only to show that the flexcan
>>> developers earlier assertion that this can and should be done in the arch
>>> tree is correct and will work for the p1010 assuming we can get changes
>>> into the arch/powerpc directory to implement these clk_* functions.
>>
>> My point is that I don't think they should live in the arch code. The clk_* functions you want to implement are tied more the FlexCAN IP than anything arch specific. As such I believe they should be in the driver.
>>
>> For example when FSL has a P9999 with FlexCAN on it, we should NOT have to add any arch code to support it.
>
> The Flexcan is found on ARM and now also on PowerPC SOCs. My current
> understanding is that the ability to set the clock source and divider is
> only available on PowerPC SOCs and therefore it's clearly arch specific
> and should go to arch/powerpc/sysdev/fsl_soc.c if it's common for all
> PowerPC platforms. What do you think?
There is a bit in the CAN-Controller that selects the clock (at least on
arm). The current driver just supports the bus clock. Support for the
other, the oscillator clock, has not been implemented so far.
IIRC the oscillator clock has a frequency that results in worse standard
timing than the bus clock.
cheers, Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
[-- Attachment #2: Type: text/plain, Size: 188 bytes --]
_______________________________________________
Socketcan-core mailing list
Socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
https://lists.berlios.de/mailman/listinfo/socketcan-core
^ permalink raw reply
* Re: [PATCH 1/5] Define the function to write sock's security context to seq_file.
From: Rongqing Li @ 2011-08-08 9:32 UTC (permalink / raw)
To: Stephen Smalley; +Cc: netdev, selinux, lsm
In-Reply-To: <1312552618.19283.51.camel@moss-pluto>
On 08/05/2011 09:56 PM, Stephen Smalley wrote:
> On Fri, 2011-08-05 at 16:58 +0800, rongqing.li@windriver.com wrote:
>> From: Roy.Li<rongqing.li@windriver.com>
>>
>> This function will write the sock's security context to a seq_file
>> and return the error code, and the number of characters successfully
>> written is written in int pointers parameter.
>>
>> This function will be called when export socket information to proc.
>>
>> Signed-off-by: Roy.Li<rongqing.li@windriver.com>
>> ---
>> include/net/sock.h | 1 +
>> net/core/sock.c | 26 ++++++++++++++++++++++++++
>> 2 files changed, 27 insertions(+), 0 deletions(-)
>
>> diff --git a/net/core/sock.c b/net/core/sock.c
>> index bc745d0..1126a49 100644
>> --- a/net/core/sock.c
>> +++ b/net/core/sock.c
>> @@ -2254,6 +2254,32 @@ void sk_common_release(struct sock *sk)
>> }
>> EXPORT_SYMBOL(sk_common_release);
>>
>> +int sock_write_secctx(struct sock *sk, struct seq_file *seq, int *len)
>> +{
>> + struct flowi fl;
>> + char *ctx = NULL;
>> + u32 ctxlen;
>> + int res = 0;
>> +
>> + *len = 0;
>> +
>> + if (sk == NULL)
>> + return -EINVAL;
>
> Is this ever possible?
>
Hi Stephen:
When output the tcp information to proc by tcp4_seq_show and
tcp state is TCP_SEQ_STATE_TIME_WAIT, the input argument v is
struct inet_timewait_sock, it seem we can not get the struct sock
from struct inet_timewait_sock, so I assume the sk is NULL in that
condition.
static int tcp4_seq_show(struct seq_file *seq, void *v)
{
case TCP_SEQ_STATE_TIME_WAIT:
get_timewait4_sock(v, seq, st->num, &len);
break;
}
}
>> + res = security_socket_getsockname(sk->sk_socket);
>> + if (res)
>> + return res;
>
> I'm not sure it is a good idea to output nothing if permission is denied
> to the socket, as opposed to some well-defined string indicating that
> condition. Particularly if someone later adds another field to
> the /proc files after the context; we don't want the contents of that
> field to be interpreted as the context if permission was denied.
>
From your review, I redesign the output information as below.
when disable SELinux, print "(none)" in proc
when enable SELinux, no error on getting security context, print the
real security context
when enable SELinux, there is error on getting security context, print
"??"
Do you think it is OK?
Thanks very much
-Roy
>> +
>> + security_sk_classify_flow(sk,&fl);
>> +
>> + res = security_secid_to_secctx(fl.flowi_secid,&ctx,&ctxlen);
>> + if (res)
>> + return res;
>
> Likewise, if we couldn't map the secid to a secctx for some reason, we
> likely ought to output some well-defined string indicating that
> condition.
>
>> +
>> + seq_printf(seq, " %s%n", ctx, len);
>> + security_release_secctx(ctx, ctxlen);
>> + return res;
>> +}
>> +
>> static DEFINE_RWLOCK(proto_list_lock);
>> static LIST_HEAD(proto_list);
>>
>
--
Best Reagrds,
Roy | RongQing Li
^ permalink raw reply
* [PATCH net] vmxnet3: Don't enable vlan filters in promiscuous mode.
From: Jesse Gross @ 2011-08-08 9:15 UTC (permalink / raw)
To: David Miller
Cc: netdev, Scott J. Goldman, Shreyas Bhatewara, VMware PV-Drivers
The vmxnet3 driver enables vlan filters if filtering is enabled for
any vlan. In promiscuous mode the filter table is cleared to in
order to disable filtering. However, if a vlan device is subsequently
created that vlan will be added to the filter, re-engaging it. As a
result, not only do we not see all the vlans in promiscuous mode, we
don't even see vlans for which a filter was previously created.
CC: Scott J. Goldman <scottjg@vmware.com>
CC: Shreyas Bhatewara <sbhatewara@vmware.com>
CC: VMware PV-Drivers <pv-drivers@vmware.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
---
drivers/net/vmxnet3/vmxnet3_drv.c | 34 ++++++++++++++++++++--------------
1 files changed, 20 insertions(+), 14 deletions(-)
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index 1cbacb3..0959583 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -1929,14 +1929,17 @@ static void
vmxnet3_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
{
struct vmxnet3_adapter *adapter = netdev_priv(netdev);
- u32 *vfTable = adapter->shared->devRead.rxFilterConf.vfTable;
- unsigned long flags;
- VMXNET3_SET_VFTABLE_ENTRY(vfTable, vid);
- spin_lock_irqsave(&adapter->cmd_lock, flags);
- VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
- VMXNET3_CMD_UPDATE_VLAN_FILTERS);
- spin_unlock_irqrestore(&adapter->cmd_lock, flags);
+ if (!(netdev->flags & IFF_PROMISC)) {
+ u32 *vfTable = adapter->shared->devRead.rxFilterConf.vfTable;
+ unsigned long flags;
+
+ VMXNET3_SET_VFTABLE_ENTRY(vfTable, vid);
+ spin_lock_irqsave(&adapter->cmd_lock, flags);
+ VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
+ VMXNET3_CMD_UPDATE_VLAN_FILTERS);
+ spin_unlock_irqrestore(&adapter->cmd_lock, flags);
+ }
set_bit(vid, adapter->active_vlans);
}
@@ -1946,14 +1949,17 @@ static void
vmxnet3_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
{
struct vmxnet3_adapter *adapter = netdev_priv(netdev);
- u32 *vfTable = adapter->shared->devRead.rxFilterConf.vfTable;
- unsigned long flags;
- VMXNET3_CLEAR_VFTABLE_ENTRY(vfTable, vid);
- spin_lock_irqsave(&adapter->cmd_lock, flags);
- VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
- VMXNET3_CMD_UPDATE_VLAN_FILTERS);
- spin_unlock_irqrestore(&adapter->cmd_lock, flags);
+ if (!(netdev->flags & IFF_PROMISC)) {
+ u32 *vfTable = adapter->shared->devRead.rxFilterConf.vfTable;
+ unsigned long flags;
+
+ VMXNET3_CLEAR_VFTABLE_ENTRY(vfTable, vid);
+ spin_lock_irqsave(&adapter->cmd_lock, flags);
+ VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
+ VMXNET3_CMD_UPDATE_VLAN_FILTERS);
+ spin_unlock_irqrestore(&adapter->cmd_lock, flags);
+ }
clear_bit(vid, adapter->active_vlans);
}
--
1.7.4.1
^ permalink raw reply related
* Re: [RFC 5/5] [powerpc] Implement a p1010rdb clock source.
From: Robin Holt @ 2011-08-08 9:15 UTC (permalink / raw)
To: Wolfgang Grandegger
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w, U Bhaskar-B22300,
Marc Kleine-Budde, netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <4E3FA066.3020301-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
On Mon, Aug 08, 2011 at 10:37:58AM +0200, Wolfgang Grandegger wrote:
> On 08/06/2011 04:34 PM, Robin Holt wrote:
> > flexcan driver needs the clk_get, clk_get_rate, etc functions
> > to work. This patch provides the minimum functionality.
>
> This needs some more general thoughts... apart from the question where
> the code should go.
>
> Like for the MSCAN on the MPC5200, the user should be *able* to select
> an appropriate clock source and divider via DTS node properties.
> Currently it seems, that the DTS properties must match some
> pre-configured values, most likely set by the boot loader. Please
> correct me if I'm wrong. For me this is generic and should go into the
> Flexcan driver. From there, a platform specific function, e.g.
> flexcan_set_clock() might be called.
The P1010 really only supports the system bus clock for a source. I was
wrong last week when I said it supported either. That was a confusion
I have because of a task I was assigned a couple months ago.
It can select different divider values.
Robin
>
>
> > Signed-off-by: Robin Holt <holt-sJ/iWh9BUns@public.gmane.org>
> > To: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> > To: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
> > To: U Bhaskar-B22300 <B22300-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> > Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
> > Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> > ---
> > arch/powerpc/platforms/85xx/p1010rdb.c | 78 ++++++++++++++++++++++++++++++++
> > 1 files changed, 78 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/powerpc/platforms/85xx/p1010rdb.c b/arch/powerpc/platforms/85xx/p1010rdb.c
> > index 3540a88..8f78ddd 100644
> > --- a/arch/powerpc/platforms/85xx/p1010rdb.c
> > +++ b/arch/powerpc/platforms/85xx/p1010rdb.c
> > @@ -28,6 +28,7 @@
> > #include <asm/udbg.h>
> > #include <asm/mpic.h>
> > #include <asm/swiotlb.h>
> > +#include <asm/clk_interface.h>
> >
> > #include <sysdev/fsl_soc.h>
> > #include <sysdev/fsl_pci.h>
> > @@ -164,6 +165,82 @@ static void __init p1010_rdb_setup_arch(void)
> > printk(KERN_INFO "P1010 RDB board from Freescale Semiconductor\n");
> > }
> >
> > +/*
> > + * p1010rdb needs to provide a clock source for the flexcan driver.
> > + */
> > +struct clk {
> > + unsigned long rate;
> > +} p1010rdb_system_clk;
> > +
> > +static struct clk *p1010_rdb_clk_get(struct device *dev, const char *id)
> > +{
>
> I persoanlly don't like the
>
> > + struct clk *clk;
> > + u32 *of_property;
> > + unsigned long clock_freq, clock_divider;
> > + const char *dev_init_name;
> > +
> > + if (!dev)
> > + return ERR_PTR(-ENOENT);
> > +
> > + /*
> > + * The can devices are named ffe1c000.can0 and ffe1d000.can1 on
> > + * the p1010rdb. Check for the "can" portion of that name before
> > + * returning a clock source.
> > + */
> > + dev_init_name = dev_name(dev);
> > + if (strlen(dev_init_name) != 13)
> > + return ERR_PTR(-ENOENT);
> > + dev_init_name += 9;
> > + if (strncmp(dev_init_name, "can", 3))
> > + return ERR_PTR(-ENOENT);
>
> There are dedicated functions to find the of node. But with my above
> proposal we do not need to provide p1010_rdb_clk_get().
>
> More comments on the other patches soon...
>
> Wolfgang.
^ permalink raw reply
* Re: [RFC 4/4] [powerpc] Implement a p1010rdb clock source.
From: Wolfgang Grandegger @ 2011-08-08 8:49 UTC (permalink / raw)
To: Kumar Gala
Cc: Netdev, U Bhaskar-B22300, socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
Marc Kleine-Budde,
linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Development
In-Reply-To: <3C4B6145-5C75-4A3C-B504-DA32E0D2EC8A-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
On 08/06/2011 10:59 PM, Kumar Gala wrote:
>
> On Aug 6, 2011, at 3:50 PM, Robin Holt wrote:
>
>> On Sat, Aug 06, 2011 at 11:52:45AM -0500, Kumar Gala wrote:
>>>
>>> On Aug 6, 2011, at 8:58 AM, Marc Kleine-Budde wrote:
>>>
>>>> On 08/06/2011 06:05 AM, Robin Holt wrote:
>>>>> flexcan driver needs the clk_get, clk_get_rate, etc functions
>>>>> to work. This patch provides the minimum functionality.
>>>>
>>>> This patch has to go via the powerpc git tree. Added
>>>> linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org on CC.
>>>>
>>>>> Signed-off-by: Robin Holt <holt-sJ/iWh9BUns@public.gmane.org>
>>>>> To: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
>>>>> To: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
>>>>> To: U Bhaskar-B22300 <B22300-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
>>>>> Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
>>>>> Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>>>>> ---
>>>>> arch/powerpc/platforms/85xx/p1010rdb.c | 78 ++++++++++++++++++++++++++++++++
>>>>> 1 files changed, 78 insertions(+), 0 deletions(-)
>>>
>>> NAK.
>>>
>>> This doesn't look right at all. We should be doing something based on the device tree node that isn't board specific.
>>>
>>> I believe Bhaskar has a version of flexcan support that he's been working on cleanup up for upstream.
>>
>> That version may be similar to what is in the freescale BSP which puts
>> the clock functions inside flexcan.c
>>
>> The powerpc arch already provides a means for individual boards to provide
>> the clock functions. I am not posting this patch here for acceptance
>> for powerpc and I am sure I will get feedback there when I post to
>> their mailing list. I am posting it here only to show that the flexcan
>> developers earlier assertion that this can and should be done in the arch
>> tree is correct and will work for the p1010 assuming we can get changes
>> into the arch/powerpc directory to implement these clk_* functions.
>
> My point is that I don't think they should live in the arch code. The clk_* functions you want to implement are tied more the FlexCAN IP than anything arch specific. As such I believe they should be in the driver.
>
> For example when FSL has a P9999 with FlexCAN on it, we should NOT have to add any arch code to support it.
The Flexcan is found on ARM and now also on PowerPC SOCs. My current
understanding is that the ability to set the clock source and divider is
only available on PowerPC SOCs and therefore it's clearly arch specific
and should go to arch/powerpc/sysdev/fsl_soc.c if it's common for all
PowerPC platforms. What do you think?
Wolfgang.
^ permalink raw reply
* Re: [RFC 5/5] [powerpc] Implement a p1010rdb clock source.
From: Wolfgang Grandegger @ 2011-08-08 8:37 UTC (permalink / raw)
To: Robin Holt
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w, U Bhaskar-B22300,
Marc Kleine-Budde, netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1312641270-6018-6-git-send-email-holt-sJ/iWh9BUns@public.gmane.org>
On 08/06/2011 04:34 PM, Robin Holt wrote:
> flexcan driver needs the clk_get, clk_get_rate, etc functions
> to work. This patch provides the minimum functionality.
This needs some more general thoughts... apart from the question where
the code should go.
Like for the MSCAN on the MPC5200, the user should be *able* to select
an appropriate clock source and divider via DTS node properties.
Currently it seems, that the DTS properties must match some
pre-configured values, most likely set by the boot loader. Please
correct me if I'm wrong. For me this is generic and should go into the
Flexcan driver. From there, a platform specific function, e.g.
flexcan_set_clock() might be called.
> Signed-off-by: Robin Holt <holt-sJ/iWh9BUns@public.gmane.org>
> To: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> To: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
> To: U Bhaskar-B22300 <B22300-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
> Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> ---
> arch/powerpc/platforms/85xx/p1010rdb.c | 78 ++++++++++++++++++++++++++++++++
> 1 files changed, 78 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/platforms/85xx/p1010rdb.c b/arch/powerpc/platforms/85xx/p1010rdb.c
> index 3540a88..8f78ddd 100644
> --- a/arch/powerpc/platforms/85xx/p1010rdb.c
> +++ b/arch/powerpc/platforms/85xx/p1010rdb.c
> @@ -28,6 +28,7 @@
> #include <asm/udbg.h>
> #include <asm/mpic.h>
> #include <asm/swiotlb.h>
> +#include <asm/clk_interface.h>
>
> #include <sysdev/fsl_soc.h>
> #include <sysdev/fsl_pci.h>
> @@ -164,6 +165,82 @@ static void __init p1010_rdb_setup_arch(void)
> printk(KERN_INFO "P1010 RDB board from Freescale Semiconductor\n");
> }
>
> +/*
> + * p1010rdb needs to provide a clock source for the flexcan driver.
> + */
> +struct clk {
> + unsigned long rate;
> +} p1010rdb_system_clk;
> +
> +static struct clk *p1010_rdb_clk_get(struct device *dev, const char *id)
> +{
I persoanlly don't like the
> + struct clk *clk;
> + u32 *of_property;
> + unsigned long clock_freq, clock_divider;
> + const char *dev_init_name;
> +
> + if (!dev)
> + return ERR_PTR(-ENOENT);
> +
> + /*
> + * The can devices are named ffe1c000.can0 and ffe1d000.can1 on
> + * the p1010rdb. Check for the "can" portion of that name before
> + * returning a clock source.
> + */
> + dev_init_name = dev_name(dev);
> + if (strlen(dev_init_name) != 13)
> + return ERR_PTR(-ENOENT);
> + dev_init_name += 9;
> + if (strncmp(dev_init_name, "can", 3))
> + return ERR_PTR(-ENOENT);
There are dedicated functions to find the of node. But with my above
proposal we do not need to provide p1010_rdb_clk_get().
More comments on the other patches soon...
Wolfgang.
^ permalink raw reply
* Re: 802.3ad bonding brain damaged?
From: David Lamparter @ 2011-08-08 7:57 UTC (permalink / raw)
To: Phillip Susi; +Cc: netdev
In-Reply-To: <4E3EECF6.90409@cfl.rr.com>
Am Sonntag, den 07.08.2011, 15:52 -0400 schrieb Phillip Susi:
> - From Documentation/networking/bonding.txt:
>
> Additionally, the linux bonding 802.3ad implementation
> distributes traffic by peer (using an XOR of MAC addresses),
>
> This is counter to the entire point of 802.3ad. Distributing traffic by
> hash of the destination address is poor mans load balancing for
> systems not supporting 802.3ad.
No, it isn't. 802.3ad/.1AX explicitly requires that no packet
re-ordering may ever occur, which can only be guaranteed by enqueueing
packets for one host on one TX interface. This behaviour is mandated by
802.1AX-2008 page 15 which reads:
This standard does not mandate any particular distribution
algorithm(s); however, any distribution algorithm shall ensure that,
when frames are received by a Frame Collector as specified in 5.2.3,
the algorithm shall not cause
a) Misordering of frames that are part of any given conversation, or
b) Duplication of frames.
| The above requirement to maintain frame ordering is met by ensuring
| that all frames that compose a given conversation are transmitted on a
| single link in the order that they are generated by the MAC Client;
hence, this requirement does not involve the addition (or
modification) of any information to the MAC frame, nor any buffering
or processing on the part of the corresponding Frame Collector in
order to reorder frames. This approach to the operation of the
distribution function permits a wide variety of distribution and load
balancing algorithms to be used, while also ensuring interoperability
between devices that adopt differing algorithms.
(IMHO it is 802.3ad/.1AX that is brain damaged, I would've made this a
weak requirement with an optional mode switch for networks that require
a strong one.)
It is true that it might be possible to fulfill this requirement with a
more sophisticated approach or just ignore edge cases, but in that case
you can just use a different bonding algorithm.
> When in 802.3ad mode, packets are supposed to
> be queued to whichever interface has the shortest tx length so a single
> stream to a single host can be balanced across all links instead of
> being restricted to one, while the other is idle.
Please make sure to tag your assumptions as such and don't make
assertions without reading the specification.
-David
^ permalink raw reply
* On line Bonding configuration change fails
From: Eduard Sinelnikov @ 2011-08-08 8:16 UTC (permalink / raw)
To: netdev
Hi,
My configuration is a follows:
| eth0 -------------->
Ububntu | eth1 --------------> Swith ------------> Other computer
Scenario:
• change the bond mode to active/backup
• unplug some of the cable
• plug-in the unplugged cable
• change bond mode to round robin
I can see that only one eth1 is sending data. When I unplug it the ping stops.
Is it a bug or some mis-configuration?
In the kernel ( /drivers/net/bond/bond_main.c).
In the function ‘bond_xmit_roundrobin
’
The code check if the bond is active via
‘bond_is_active_slave(slave)’ Function call.
Which actually checks if the slave is backup or active
What is the meaning of backup in round robin?
Correct me if I wrong but in round robin every slave should send a
packet, regardless of being active or backup.
Thank you,
Eduard
^ permalink raw reply
* Re: README: networking GIT trees
From: Stephen Rothwell @ 2011-08-08 7:32 UTC (permalink / raw)
To: David Miller; +Cc: netdev, jeffrey.t.kirsher
In-Reply-To: <20110807.234027.1850968504654724492.davem@davemloft.net>
[-- Attachment #1: Type: text/plain, Size: 1120 bytes --]
Hi Dave,
On Sun, 07 Aug 2011 23:40:27 -0700 (PDT) David Miller <davem@davemloft.net> wrote:
>
> net-next is now open up and all pending -next patches have been
> integrated and pushed out. Also, the plain 'net' tree has been
> pulled into it.
>
> However I am freezing driver/net in net-next so that Jeff can
> have a few days to push his drivers/net reorganization GIT tree
> to me.
>
> Once Jeff's work is merged in, I do recognize that we will have
> some merge hassles any time a net driver bug fix is merged into
> the 'net' tree. I will try to pre-emptively address this with
> quick merges into net-next when possible.
>
> This is just a heads up if one of these merge hassles propagates
> into -next for some reason, they are expected and I will clean
> them up as fast as possible.
Thanks for the heads up. If I do come across one of these, I will still
report it (just to let people know what I did) but you can ignore my
reports if you have already fixed the problem.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply
* README: networking GIT trees
From: David Miller @ 2011-08-08 6:40 UTC (permalink / raw)
To: netdev; +Cc: jeffrey.t.kirsher, sfr
net-next is now open up and all pending -next patches have been
integrated and pushed out. Also, the plain 'net' tree has been
pulled into it.
However I am freezing driver/net in net-next so that Jeff can
have a few days to push his drivers/net reorganization GIT tree
to me.
Once Jeff's work is merged in, I do recognize that we will have
some merge hassles any time a net driver bug fix is merged into
the 'net' tree. I will try to pre-emptively address this with
quick merges into net-next when possible.
This is just a heads up if one of these merge hassles propagates
into -next for some reason, they are expected and I will clean
them up as fast as possible.
^ permalink raw reply
* Re: [PATCH] ipv4: use dst with ref during bcast/mcast loopback
From: David Miller @ 2011-08-08 5:54 UTC (permalink / raw)
To: ja; +Cc: netdev
In-Reply-To: <alpine.LFD.2.00.1108072232170.13644@ja.ssi.bg>
From: Julian Anastasov <ja@ssi.bg>
Date: Sun, 7 Aug 2011 23:17:22 +0300 (EEST)
>
> Make sure skb dst has reference when moving to
> another context. Currently, I don't see protocols that can
> hit it when sending broadcasts/multicasts to loopback using
> noref dsts, so it is just a precaution.
>
> Signed-off-by: Julian Anastasov <ja@ssi.bg>
> ---
>
> Please, review and apply if needed...
Better safe than sorry, applied, thanks!
^ permalink raw reply
* Re: [PATCH] ipv4: route non-local sources for raw socket
From: David Miller @ 2011-08-08 5:53 UTC (permalink / raw)
To: ja; +Cc: netdev
In-Reply-To: <alpine.LFD.2.00.1108072212390.1423@ja.ssi.bg>
From: Julian Anastasov <ja@ssi.bg>
Date: Sun, 7 Aug 2011 22:16:09 +0300 (EEST)
>
> The raw sockets can provide source address for
> routing but their privileges are not considered. We
> can provide non-local source address, make sure the
> FLOWI_FLAG_ANYSRC flag is set if socket has privileges
> for this, i.e. based on hdrincl (IP_HDRINCL) and
> transparent flags.
>
> Signed-off-by: Julian Anastasov <ja@ssi.bg>
Applied.
^ permalink raw reply
* Re: [PATCH] netfilter: TCP and raw fix for ip_route_me_harder
From: David Miller @ 2011-08-08 5:53 UTC (permalink / raw)
To: ja; +Cc: netdev, netfilter-devel
In-Reply-To: <alpine.LFD.2.00.1108072158050.1423@ja.ssi.bg>
From: Julian Anastasov <ja@ssi.bg>
Date: Sun, 7 Aug 2011 22:11:00 +0300 (EEST)
>
> TCP in some cases uses different global (raw) socket
> to send RST and ACK. The transparent flag is not set there.
> Currently, it is a problem for rerouting after the previous
> change.
>
> Fix it by simplifying the checks in ip_route_me_harder
> and use FLOWI_FLAG_ANYSRC even for sockets. It looks safe
> because the initial routing allowed this source address to
> be used and now we just have to make sure the packet is rerouted.
>
> As a side effect this also allows rerouting for normal
> raw sockets that use spoofed source addresses which was not possible
> even before we eliminated the ip_route_input call.
>
> Signed-off-by: Julian Anastasov <ja@ssi.bg>
Applied.
^ permalink raw reply
* Re: [PATCHv3 NEXT 1/1] netxen: add vlan LRO support
From: David Miller @ 2011-08-08 5:53 UTC (permalink / raw)
To: amit.salecha; +Cc: netdev, ameen.rahman, rajesh.borundia
In-Reply-To: <1312685204-19800-1-git-send-email-amit.salecha@qlogic.com>
From: <amit.salecha@qlogic.com>
Date: Sat, 6 Aug 2011 19:46:44 -0700
> From: Rajesh Borundia <rajesh.borundia@qlogic.com>
>
> o To support vlan lro, driver need to program ip address in device.
> o Same ip addresses need to be program after fw recovery, so sotre them
> in list.
> o In case of vlan packet, include vlan header length while
> calculating ip and tcp headers.
>
> Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Applied.
^ permalink raw reply
* Re: [PATCH 2/2] dp83640: increase receive time stamp buffer size
From: David Miller @ 2011-08-08 5:53 UTC (permalink / raw)
To: richardcochran; +Cc: netdev, linux-kernel, stable
In-Reply-To: <d38d5b44e8894387852a116492cb825159b5842c.1312699694.git.richard.cochran@omicron.at>
From: Richard Cochran <richardcochran@gmail.com>
Date: Sun, 7 Aug 2011 09:03:04 +0200
> The dp83640 buffers receive time stamps from special PHY status frames,
> matching them to received PTP packets in a work queue. Because the timeout
> for orphaned time stamps is so long and the buffer is so small, the driver
> can drop time stamps under moderate PTP traffic.
>
> This commit fixes the issue by decreasing the timeout to (at least) one
> timer tick and increasing the buffer size.
>
> Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
> Cc: <stable@kernel.org>
Applied.
_______________________________________________
stable mailing list
stable@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/stable
^ permalink raw reply
* Re: [PATCH 1/2] gianfar: fix fiper alignment after resetting the time
From: David Miller @ 2011-08-08 5:53 UTC (permalink / raw)
To: richardcochran; +Cc: netdev, linux-kernel, stable
In-Reply-To: <018b1f12e792c4758d1e601742f758a09dd10d62.1312699694.git.richard.cochran@omicron.at>
From: Richard Cochran <richardcochran@gmail.com>
Date: Sun, 7 Aug 2011 09:03:03 +0200
> After resetting the time, the PPS signals on the FIPER output channels
> are incorrectly offset from the clock time, as can be readily verified
> by a looping back the FIPER to the external time stamp input.
>
> Despite its name, setting the "Fiper Realignment Disable" bit seems to
> fix the problem, at least on the P2020.
>
> Also, following the example code from the Freescale BSP, it is not really
> necessary to disable and re-enable the timer in order to reprogram the
> FIPER. (The documentation is rather unclear on this point. It seems that
> writing to the alarm register also disables the FIPER.)
>
> Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
> Cc: <stable@kernel.org>
Applied.
^ permalink raw reply
* Re: include/linux/netlink.h: problem when included by an application
From: David Miller @ 2011-08-08 5:48 UTC (permalink / raw)
To: michel; +Cc: ben, netdev
In-Reply-To: <1312755263.2908.6.camel@Thor>
From: Michel Machado <michel@digirati.com.br>
Date: Sun, 07 Aug 2011 18:14:23 -0400
>> > The simplest solution that I came up was replacing sa_family_t in
>> > include/linux/netlink.h to 'unsigned short' as header
>> > include/linux/socket.h does for struct __kernel_sockaddr_storage
>> > available to applications.
>>
>> Maybe we should do something like this in <linux/socket.h>:
>>
>> typedef unsigned short __kernel_sa_family_t;
>> #ifdef __KERNEL__
>> typedef __kernel_sa_family_t sa_family_t;
>> #endif
>>
>> and then use __kernel_sa_family_t in <linux/netlink.h>.
>>
>> Ben.
>
> I like this solution, it solves both struct __kernel_sockaddr_storage
> in include/linux/socket.h, and struct sockaddr_nl in
> include/linux/netlink.h.
Ok, I've applied the following patch:
--------------------
net: Make userland include of netlink.h more sane.
Currently userland will barf when including linux/netlink.h unless it
precisely includes sys/socket.h first. The issue is where the
definition of "sa_family_t" comes from.
We've been back and forth on how to fix this issue in the past, see:
http://thread.gmane.org/gmane.linux.debian.devel.bugs.general/622621
http://thread.gmane.org/gmane.linux.network/143380
Ben Hutchings suggested we take a hint from how we handle the
sockaddr_storage type. First we define a "__kernel_sa_family_t"
to linux/socket.h that is always defined.
Then if __KERNEL__ is defined, we also define "sa_family_t" as
equal to "__kernel_sa_family_t".
Then in places like linux/netlink.h we use __kernel_sa_family_t
in user visible datastructures.
Reported-by: Michel Machado <michel@digirati.com.br>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
include/linux/netlink.h | 2 +-
include/linux/socket.h | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 2e17c5d..180540a 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -29,7 +29,7 @@
#define MAX_LINKS 32
struct sockaddr_nl {
- sa_family_t nl_family; /* AF_NETLINK */
+ __kernel_sa_family_t nl_family; /* AF_NETLINK */
unsigned short nl_pad; /* zero */
__u32 nl_pid; /* port ID */
__u32 nl_groups; /* multicast groups mask */
diff --git a/include/linux/socket.h b/include/linux/socket.h
index e17f822..d0e77f6 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -8,8 +8,10 @@
#define _K_SS_ALIGNSIZE (__alignof__ (struct sockaddr *))
/* Implementation specific desired alignment */
+typedef unsigned short __kernel_sa_family_t;
+
struct __kernel_sockaddr_storage {
- unsigned short ss_family; /* address family */
+ __kernel_sa_family_t ss_family; /* address family */
/* Following field(s) are implementation specific */
char __data[_K_SS_MAXSIZE - sizeof(unsigned short)];
/* space to achieve desired size, */
@@ -35,7 +37,7 @@ struct seq_file;
extern void socket_seq_show(struct seq_file *seq);
#endif
-typedef unsigned short sa_family_t;
+typedef __kernel_sa_family_t sa_family_t;
/*
* 1003.1g requires sa_family_t and that sa_data is char.
--
1.7.6
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox