* Re: [PATCH 00/05] ipv6: RFC4214 Support
From: David Miller @ 2007-11-07 5:37 UTC (permalink / raw)
To: dlstevens; +Cc: Fred.L.Templin, netdev, netdev-owner
In-Reply-To: <OF2BBF1458.DA94A99E-ON8825738C.001CC740-8825738C.001DC134@us.ibm.com>
From: David Stevens <dlstevens@us.ibm.com>
Date: Tue, 6 Nov 2007 21:26:15 -0800
> Last I heard, there are Intellectual Property claims with ISATAP,
> which is why the RFC is not standards track and which makes it
> effectively a proprietary protocol.
>
> Unless that's been resolved, I think the claim by the IP owner is
> that it can't be distributed without a license from them. So, maybe
> not worth the effort for an experimental RFC.
If this is the case, I agree, we cannot include ISATAP
support in the kernel.
^ permalink raw reply
* Re: [PATCH 00/05] ipv6: RFC4214 Support
From: David Stevens @ 2007-11-07 5:26 UTC (permalink / raw)
To: David Miller; +Cc: Fred.L.Templin, netdev, netdev-owner
In-Reply-To: <20071106.203845.10865897.davem@davemloft.net>
Last I heard, there are Intellectual Property claims with ISATAP,
which is why the RFC is not standards track and which makes it
effectively a proprietary protocol.
Unless that's been resolved, I think the claim by the IP owner is
that it can't be distributed without a license from them. So, maybe
not worth the effort for an experimental RFC.
+-DLS
^ permalink raw reply
* Re: [PATCH 00/05] ipv6: RFC4214 Support
From: David Miller @ 2007-11-07 4:38 UTC (permalink / raw)
To: Fred.L.Templin; +Cc: netdev
In-Reply-To: <39C363776A4E8C4A94691D2BD9D1C9A1029EDBE1@XCH-NW-7V2.nw.nos.boeing.com>
From: "Templin, Fred L" <Fred.L.Templin@boeing.com>
Date: Tue, 6 Nov 2007 17:15:54 -0800
> Please advise as to next steps.
Your email client has mangles the patches, adding line breaks. This
makes the patches not apply at all.
Please correct this and resubmit, thank you.
^ permalink raw reply
* Re: [PATCH] Rename "virtual ethernet device" to "virtual ethernet pair device".
From: David Miller @ 2007-11-07 4:36 UTC (permalink / raw)
To: rusty; +Cc: netdev, xemul, ebiederm
In-Reply-To: <200711071504.49112.rusty@rustcorp.com.au>
From: Rusty Russell <rusty@rustcorp.com.au>
Date: Wed, 7 Nov 2007 15:04:48 +1100
> OK, about the help text. IMHO noone should be using "virtual
> ethernet" unqualified, since there are multiple things that now refers to.
>
> Here's a respin with just the help text changes:
Fair enough, applied.
^ permalink raw reply
* [PATCH 2/2] pasemi_mac: Fix CRC checks
From: Olof Johansson @ 2007-11-07 4:21 UTC (permalink / raw)
To: jgarzik; +Cc: netdev, linuxppc-dev
In-Reply-To: <20071107042001.GC22637@lixom.net>
Make sure we don't feed packets with bad CRC up the network stack,
and discount the packet length as reported from the MAC for the CRC
field.
Signed-off-by: Olof Johansson <olof@lixom.net>
Index: k.org/drivers/net/pasemi_mac.c
===================================================================
--- k.org.orig/drivers/net/pasemi_mac.c
+++ k.org/drivers/net/pasemi_mac.c
@@ -580,6 +580,16 @@ static int pasemi_mac_clean_rx(struct pa
len = (macrx & XCT_MACRX_LLEN_M) >> XCT_MACRX_LLEN_S;
+ pci_unmap_single(mac->dma_pdev, dma, len, PCI_DMA_FROMDEVICE);
+
+ if (macrx & XCT_MACRX_CRC) {
+ /* CRC error flagged */
+ mac->netdev->stats.rx_errors++;
+ mac->netdev->stats.rx_crc_errors++;
+ dev_kfree_skb_irq(skb);
+ goto next;
+ }
+
if (len < 256) {
struct sk_buff *new_skb;
@@ -595,11 +605,10 @@ static int pasemi_mac_clean_rx(struct pa
} else
info->skb = NULL;
- pci_unmap_single(mac->dma_pdev, dma, len, PCI_DMA_FROMDEVICE);
-
info->dma = 0;
- skb_put(skb, len);
+ /* Don't include CRC */
+ skb_put(skb, len-4);
if (likely((macrx & XCT_MACRX_HTY_M) == XCT_MACRX_HTY_IPV4_OK)) {
skb->ip_summed = CHECKSUM_UNNECESSARY;
@@ -614,6 +623,7 @@ static int pasemi_mac_clean_rx(struct pa
skb->protocol = eth_type_trans(skb, mac->netdev);
netif_receive_skb(skb);
+next:
RX_RING(mac, n) = 0;
RX_RING(mac, n+1) = 0;
^ permalink raw reply
* [PATCH 1/2] pasemi_mac: Don't set replace-source-address descriptor bits
From: Olof Johansson @ 2007-11-07 4:20 UTC (permalink / raw)
To: jgarzik; +Cc: netdev, linuxppc-dev
In-Reply-To: <20071107042001.GC22637@lixom.net>
Don't use the "replace source address with local MAC address" bits, since
it causes problems on some variations of the hardware due to an erratum.
Signed-off-by: Olof Johansson <olof@lixom.net>
Index: k.org/drivers/net/pasemi_mac.c
===================================================================
--- k.org.orig/drivers/net/pasemi_mac.c
+++ k.org/drivers/net/pasemi_mac.c
@@ -1126,7 +1126,7 @@ static int pasemi_mac_start_tx(struct sk
unsigned long flags;
int i, nfrags;
- dflags = XCT_MACTX_O | XCT_MACTX_ST | XCT_MACTX_SS | XCT_MACTX_CRC_PAD;
+ dflags = XCT_MACTX_O | XCT_MACTX_ST | XCT_MACTX_CRC_PAD;
if (skb->ip_summed == CHECKSUM_PARTIAL) {
const unsigned char *nh = skb_network_header(skb);
^ permalink raw reply
* [PATCH 0/2] pasemi_mac: two bugfixes for 2.6.24
From: Olof Johansson @ 2007-11-07 4:20 UTC (permalink / raw)
To: jgarzik; +Cc: netdev, linuxppc-dev
Hi Jeff,
Two bugfixes for pasemi_mac for 2.6.24:
[PATCH 1/2] pasemi_mac: Don't set replace-source-address descriptor bits
[PATCH 2/2] pasemi_mac: Fix CRC checks
Thanks,
-Olof
^ permalink raw reply
* Re: [PATCH] Rename "virtual ethernet device" to "virtual ethernet pair device".
From: Rusty Russell @ 2007-11-07 4:04 UTC (permalink / raw)
To: David Miller; +Cc: netdev, xemul, ebiederm
In-Reply-To: <20071106.191906.127144742.davem@davemloft.net>
On Wednesday 07 November 2007 14:19:06 David Miller wrote:
> If anything, the veth naming makes more sense than the IBM device
> cases.
>
> And that's why I decreed that last time this came up that the naming
> for veth was just fine.
OK, about the help text. IMHO noone should be using "virtual
ethernet" unqualified, since there are multiple things that now refers to.
Here's a respin with just the help text changes:
==
Clarify "virtual ethernet device" to "virtual ethernet pair device".
It'd also be nice to mention "containers" somewhere in the help text
(I'm assuming that's what it's for?).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 5f800a6..cb581eb 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -136,10 +136,11 @@ config TUN
If you don't know what to use this for, you don't need it.
config VETH
- tristate "Virtual ethernet device"
+ tristate "Virtual ethernet pair device"
---help---
- The device is an ethernet tunnel. Devices are created in pairs. When
- one end receives the packet it appears on its pair and vice versa.
+ This device is a local ethernet tunnel. Devices are created in pairs.
+ When one end receives the packet it appears on its pair and vice
+ versa.
config NET_SB1000
tristate "General Instruments Surfboard 1000"
^ permalink raw reply related
* Re: [PATCH] Rename "virtual ethernet device" to "virtual ethernet pair device".
From: David Miller @ 2007-11-07 3:19 UTC (permalink / raw)
To: rusty; +Cc: netdev, xemul, ebiederm
In-Reply-To: <200711071409.01000.rusty@rustcorp.com.au>
From: Rusty Russell <rusty@rustcorp.com.au>
Date: Wed, 7 Nov 2007 14:09:00 +1100
> There are already iSeries and pSeries virtual ethernet drivers called
> veth; calling a local tunnel device "veth" is confusing.
>
> I didn't rename the module nor the header, to avoid breaking
> documentation and userspace programs respectively. But I'd really
> like to. It'd also be nice to mention "containers" somewhere in the
> help text (I'm assuming that's what it's for?).
>
> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
We had a lengthy discussion about the name on netdev. I'm sorry that
you missed it, and are bringing this back up again so that we have to
discuss it once more.
If anything, the veth naming makes more sense than the IBM device
cases.
And that's why I decreed that last time this came up that the naming
for veth was just fine.
^ permalink raw reply
* Re: [PATCH 2.6.24-rc2] net: net_free implicit declaration
From: David Miller @ 2007-11-07 3:17 UTC (permalink / raw)
To: randy.dunlap; +Cc: netdev, akpm, torvalds
In-Reply-To: <20071106190629.f77560fb.randy.dunlap@oracle.com>
From: Randy Dunlap <randy.dunlap@oracle.com>
Date: Tue, 6 Nov 2007 19:06:29 -0800
> From: Randy Dunlap <randy.dunlap@oracle.com>
>
> Just move the function so that is it known before it is used.
>
> net/core/net_namespace.c: In function 'copy_net_ns':
> net/core/net_namespace.c:97: error: implicit declaration of function 'net_free'
> net/core/net_namespace.c: At top level:
> net/core/net_namespace.c:104: warning: conflicting types for 'net_free'
> net/core/net_namespace.c:104: error: static declaration of 'net_free' follows non-static declaration
> net/core/net_namespace.c:97: error: previous implicit declaration of 'net_free' was here
> make[2]: *** [net/core/net_namespace.o] Error 1
>
> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
This is already fixed in the net-2.6 tree.
I'll push it to Linus after I'm done sorting another bug.
^ permalink raw reply
* [PATCH] [IPv4] printk() includes KERN_* constant in net/ipv4/
From: FNST-Wang Chen @ 2007-11-07 3:10 UTC (permalink / raw)
To: trivial, netdev
Fix the printk() without KERN_* constant in net/ipv4.
Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
---
af_inet.c | 4 ++--
devinet.c | 2 +-
fib_hash.c | 2 +-
fib_semantics.c | 2 +-
ipconfig.c | 18 +++++++++---------
netfilter/arp_tables.c | 6 +++---
netfilter/ip_tables.c | 8 ++++----
netfilter/ipt_CLUSTERIP.c | 4 ++--
netfilter/ipt_MASQUERADE.c | 2 +-
netfilter/ipt_REJECT.c | 4 ++--
netfilter/ipt_owner.c | 2 +-
netfilter/iptable_filter.c | 4 ++--
netfilter/iptable_mangle.c | 2 +-
netfilter/iptable_raw.c | 2 +-
netfilter/nf_conntrack_l3proto_ipv4.c | 12 ++++++------
netfilter/nf_nat_h323.c | 16 ++++++++--------
netfilter/nf_nat_rule.c | 8 ++++----
netfilter/nf_nat_snmp_basic.c | 16 ++++++++--------
18 files changed, 57 insertions(+), 57 deletions(-)
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index d2f22e7..dd73e78 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -136,12 +136,12 @@ void inet_sock_destruct(struct sock *sk)
__skb_queue_purge(&sk->sk_error_queue);
if (sk->sk_type == SOCK_STREAM && sk->sk_state != TCP_CLOSE) {
- printk("Attempt to release TCP socket in state %d %p\n",
+ printk(KERN_ERR "Attempt to release TCP socket in state %d %p\n",
sk->sk_state, sk);
return;
}
if (!sock_flag(sk, SOCK_DEAD)) {
- printk("Attempt to release alive inet socket %p\n", sk);
+ printk(KERN_ERR "Attempt to release alive inet socket %p\n", sk);
return;
}
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 55d199e..350bf14 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -141,7 +141,7 @@ void in_dev_finish_destroy(struct in_device *idev)
#endif
dev_put(dev);
if (!idev->dead)
- printk("Freeing alive in_device %p\n", idev);
+ printk(KERN_ERR "Freeing alive in_device %p\n", idev);
else {
kfree(idev);
}
diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c
index 527a6e0..aef7830 100644
--- a/net/ipv4/fib_hash.c
+++ b/net/ipv4/fib_hash.c
@@ -168,7 +168,7 @@ static void fn_rehash_zone(struct fn_zone *fz)
new_hashmask = (new_divisor - 1);
#if RT_CACHE_DEBUG >= 2
- printk("fn_rehash_zone: hash for zone %d grows from %d\n", fz->fz_order, old_divisor);
+ printk(KERN_DEBUG "fn_rehash_zone: hash for zone %d grows from %d\n", fz->fz_order, old_divisor);
#endif
ht = fz_hash_alloc(new_divisor);
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 1351a26..e350b00 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -145,7 +145,7 @@ static const struct
void free_fib_info(struct fib_info *fi)
{
if (fi->fib_dead == 0) {
- printk("Freeing alive fib_info %p\n", fi);
+ printk(KERN_ERR "Freeing alive fib_info %p\n", fi);
return;
}
change_nexthops(fi) {
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index c5c107a..c0bc86c 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -208,7 +208,7 @@ static int __init ic_open_devs(void)
if (dev->mtu >= 364)
able |= IC_BOOTP;
else
- printk(KERN_WARNING "DHCP/BOOTP: Ignoring device %s, MTU %d too small", dev->name, dev->mtu);
+ printk(KERN_WARNING "DHCP/BOOTP: Ignoring device %s, MTU %d too small\n", dev->name, dev->mtu);
if (!(dev->flags & IFF_NOARP))
able |= IC_RARP;
able &= ic_proto_enabled;
@@ -389,7 +389,7 @@ static int __init ic_defaults(void)
NIPQUAD(ic_myaddr));
return -1;
}
- printk("IP-Config: Guessing netmask %u.%u.%u.%u\n", NIPQUAD(ic_netmask));
+ printk(KERN_INFO "IP-Config: Guessing netmask %u.%u.%u.%u\n", NIPQUAD(ic_netmask));
}
return 0;
@@ -590,7 +590,7 @@ ic_dhcp_init_options(u8 *options)
u8 *e = options;
#ifdef IPCONFIG_DEBUG
- printk("DHCP: Sending message type %d\n", mt);
+ printk(KERN_DEBUG "DHCP: Sending message type %d\n", mt);
#endif
memcpy(e, ic_bootp_cookie, 4); /* RFC1048 Magic Cookie */
@@ -736,7 +736,7 @@ static void __init ic_bootp_send_if(struct ic_device *d, unsigned long jiffies_d
else if (dev->type == ARPHRD_FDDI)
b->htype = ARPHRD_ETHER;
else {
- printk("Unknown ARP type 0x%04x for device %s\n", dev->type, dev->name);
+ printk(KERN_WARNING "Unknown ARP type 0x%04x for device %s\n", dev->type, dev->name);
b->htype = dev->type; /* can cause undefined behavior */
}
b->hlen = dev->addr_len;
@@ -790,7 +790,7 @@ static void __init ic_do_bootp_ext(u8 *ext)
#ifdef IPCONFIG_DEBUG
u8 *c;
- printk("DHCP/BOOTP: Got extension %d:",*ext);
+ printk(KERN_DEBUG "DHCP/BOOTP: Got extension %d:",*ext);
for (c=ext+2; c<ext+2+ext[1]; c++)
printk(" %02x", *c);
printk("\n");
@@ -954,7 +954,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str
}
#ifdef IPCONFIG_DEBUG
- printk("DHCP: Got message type %d\n", mt);
+ printk(KERN_DEBUG "DHCP: Got message type %d\n", mt);
#endif
switch (mt) {
@@ -969,7 +969,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str
ic_myaddr = b->your_ip;
ic_servaddr = server_id;
#ifdef IPCONFIG_DEBUG
- printk("DHCP: Offered address %u.%u.%u.%u",
+ printk(KERN_DEBUG "DHCP: Offered address %u.%u.%u.%u",
NIPQUAD(ic_myaddr));
printk(" by server %u.%u.%u.%u\n",
NIPQUAD(ic_servaddr));
@@ -1167,7 +1167,7 @@ static int __init ic_dynamic(void)
return -1;
}
- printk("IP-Config: Got %s answer from %u.%u.%u.%u, ",
+ printk(KERN_INFO "IP-Config: Got %s answer from %u.%u.%u.%u, ",
((ic_got_reply & IC_RARP) ? "RARP"
: (ic_proto_enabled & IC_USE_DHCP) ? "DHCP" : "BOOTP"),
NIPQUAD(ic_servaddr));
@@ -1375,7 +1375,7 @@ static int __init ip_auto_config(void)
/*
* Clue in the operator.
*/
- printk("IP-Config: Complete:");
+ printk(KERN_INFO "IP-Config: Complete:");
printk("\n device=%s", ic_dev->name);
printk(", addr=%u.%u.%u.%u", NIPQUAD(ic_myaddr));
printk(", mask=%u.%u.%u.%u", NIPQUAD(ic_netmask));
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
index 2909c92..1e60653 100644
--- a/net/ipv4/netfilter/arp_tables.c
+++ b/net/ipv4/netfilter/arp_tables.c
@@ -49,7 +49,7 @@ MODULE_DESCRIPTION("arptables core");
#define ARP_NF_ASSERT(x) \
do { \
if (!(x)) \
- printk("ARP_NF_ASSERT: %s:%s:%u\n", \
+ printk(KERN_DEBUG "ARP_NF_ASSERT: %s:%s:%u\n", \
__FUNCTION__, __FILE__, __LINE__); \
} while(0)
#else
@@ -205,7 +205,7 @@ static unsigned int arpt_error(struct sk_buff *skb,
const void *targinfo)
{
if (net_ratelimit())
- printk("arp_tables: error: '%s'\n", (char *)targinfo);
+ printk(KERN_ERR "arp_tables: '%s'\n", (char *)targinfo);
return NF_DROP;
}
@@ -357,7 +357,7 @@ static int mark_source_chains(struct xt_table_info *newinfo,
int visited = e->comefrom & (1 << hook);
if (e->comefrom & (1 << NF_ARP_NUMHOOKS)) {
- printk("arptables: loop hook %u pos %u %08X.\n",
+ printk(KERN_INFO "arptables: loop hook %u pos %u %08X.\n",
hook, pos, e->comefrom);
return 0;
}
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
index 4b10b98..59b41c1 100644
--- a/net/ipv4/netfilter/ip_tables.c
+++ b/net/ipv4/netfilter/ip_tables.c
@@ -51,7 +51,7 @@ MODULE_DESCRIPTION("IPv4 packet filter");
#define IP_NF_ASSERT(x) \
do { \
if (!(x)) \
- printk("IP_NF_ASSERT: %s:%s:%u\n", \
+ printk(KERN_DEBUG "IP_NF_ASSERT: %s:%s:%u\n", \
__FUNCTION__, __FILE__, __LINE__); \
} while(0)
#else
@@ -177,7 +177,7 @@ ipt_error(struct sk_buff *skb,
const void *targinfo)
{
if (net_ratelimit())
- printk("ip_tables: error: `%s'\n", (char *)targinfo);
+ printk(KERN_ERR "ip_tables: `%s'\n", (char *)targinfo);
return NF_DROP;
}
@@ -420,7 +420,7 @@ ipt_do_table(struct sk_buff *skb,
if (((struct ipt_entry *)table_base)->comefrom
!= 0xeeeeeeec
&& verdict == IPT_CONTINUE) {
- printk("Target %s reentered!\n",
+ printk(KERN_DEBUG "Target %s reentered!\n",
t->u.kernel.target->name);
verdict = NF_DROP;
}
@@ -482,7 +482,7 @@ mark_source_chains(struct xt_table_info *newinfo,
int visited = e->comefrom & (1 << hook);
if (e->comefrom & (1 << NF_IP_NUMHOOKS)) {
- printk("iptables: loop hook %u pos %u %08X.\n",
+ printk(KERN_INFO "iptables: loop hook %u pos %u %08X.\n",
hook, pos, e->comefrom);
return 0;
}
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
index 2f544da..ac2bde8 100644
--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
+++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -269,7 +269,7 @@ clusterip_hashfn(const struct sk_buff *skb,
hashval = 0;
/* This cannot happen, unless the check function wasn't called
* at rule load time */
- printk("CLUSTERIP: unknown mode `%u'\n", config->hash_mode);
+ printk(KERN_NOTICE "CLUSTERIP: unknown mode `%u'\n", config->hash_mode);
BUG();
break;
}
@@ -497,7 +497,7 @@ static void arp_print(struct arp_payload *payload)
}
hbuffer[--k]='\0';
- printk("src %u.%u.%u.%u@%s, dst %u.%u.%u.%u\n",
+ printk(KERN_DEBUG "src %u.%u.%u.%u@%s, dst %u.%u.%u.%u\n",
NIPQUAD(payload->src_ip), hbuffer,
NIPQUAD(payload->dst_ip));
}
diff --git a/net/ipv4/netfilter/ipt_MASQUERADE.c b/net/ipv4/netfilter/ipt_MASQUERADE.c
index 44b516e..156b843 100644
--- a/net/ipv4/netfilter/ipt_MASQUERADE.c
+++ b/net/ipv4/netfilter/ipt_MASQUERADE.c
@@ -85,7 +85,7 @@ masquerade_target(struct sk_buff *skb,
rt = (struct rtable *)skb->dst;
newsrc = inet_select_addr(out, rt->rt_gateway, RT_SCOPE_UNIVERSE);
if (!newsrc) {
- printk("MASQUERADE: %s ate my IP address\n", out->name);
+ printk(KERN_WARNING "MASQUERADE: %s ate my IP address\n", out->name);
return NF_DROP;
}
diff --git a/net/ipv4/netfilter/ipt_REJECT.c b/net/ipv4/netfilter/ipt_REJECT.c
index dcf4d21..16de76a 100644
--- a/net/ipv4/netfilter/ipt_REJECT.c
+++ b/net/ipv4/netfilter/ipt_REJECT.c
@@ -221,13 +221,13 @@ static bool check(const char *tablename,
const struct ipt_entry *e = e_void;
if (rejinfo->with == IPT_ICMP_ECHOREPLY) {
- printk("ipt_REJECT: ECHOREPLY no longer supported.\n");
+ printk(KERN_WARNING "ipt_REJECT: ECHOREPLY no longer supported.\n");
return false;
} else if (rejinfo->with == IPT_TCP_RESET) {
/* Must specify that it's a TCP packet */
if (e->ip.proto != IPPROTO_TCP
|| (e->ip.invflags & XT_INV_PROTO)) {
- printk("ipt_REJECT: TCP_RESET invalid for non-tcp\n");
+ printk(KERN_WARNING "ipt_REJECT: TCP_RESET invalid for non-tcp\n");
return false;
}
}
diff --git a/net/ipv4/netfilter/ipt_owner.c b/net/ipv4/netfilter/ipt_owner.c
index b14e77d..13cfc7f 100644
--- a/net/ipv4/netfilter/ipt_owner.c
+++ b/net/ipv4/netfilter/ipt_owner.c
@@ -61,7 +61,7 @@ checkentry(const char *tablename,
const struct ipt_owner_info *info = matchinfo;
if (info->match & (IPT_OWNER_PID|IPT_OWNER_SID|IPT_OWNER_COMM)) {
- printk("ipt_owner: pid, sid and command matching "
+ printk(KERN_WARNING "ipt_owner: pid, sid and command matching "
"not supported anymore\n");
return false;
}
diff --git a/net/ipv4/netfilter/iptable_filter.c b/net/ipv4/netfilter/iptable_filter.c
index ba3262c..6a0b7cf 100644
--- a/net/ipv4/netfilter/iptable_filter.c
+++ b/net/ipv4/netfilter/iptable_filter.c
@@ -81,7 +81,7 @@ ipt_local_out_hook(unsigned int hook,
if (skb->len < sizeof(struct iphdr) ||
ip_hdrlen(skb) < sizeof(struct iphdr)) {
if (net_ratelimit())
- printk("iptable_filter: ignoring short SOCK_RAW "
+ printk(KERN_WARNING "iptable_filter: ignoring short SOCK_RAW "
"packet.\n");
return NF_ACCEPT;
}
@@ -122,7 +122,7 @@ static int __init iptable_filter_init(void)
int ret;
if (forward < 0 || forward > NF_MAX_VERDICT) {
- printk("iptables forward must be 0 or 1\n");
+ printk(KERN_ERR "iptables forward must be 0 or 1\n");
return -EINVAL;
}
diff --git a/net/ipv4/netfilter/iptable_mangle.c b/net/ipv4/netfilter/iptable_mangle.c
index b4360a6..9bab631 100644
--- a/net/ipv4/netfilter/iptable_mangle.c
+++ b/net/ipv4/netfilter/iptable_mangle.c
@@ -100,7 +100,7 @@ ipt_local_hook(unsigned int hook,
if (skb->len < sizeof(struct iphdr)
|| ip_hdrlen(skb) < sizeof(struct iphdr)) {
if (net_ratelimit())
- printk("iptable_mangle: ignoring short SOCK_RAW "
+ printk(KERN_WARNING "iptable_mangle: ignoring short SOCK_RAW "
"packet.\n");
return NF_ACCEPT;
}
diff --git a/net/ipv4/netfilter/iptable_raw.c b/net/ipv4/netfilter/iptable_raw.c
index 5de6e57..a8ce34f 100644
--- a/net/ipv4/netfilter/iptable_raw.c
+++ b/net/ipv4/netfilter/iptable_raw.c
@@ -66,7 +66,7 @@ ipt_local_hook(unsigned int hook,
if (skb->len < sizeof(struct iphdr) ||
ip_hdrlen(skb) < sizeof(struct iphdr)) {
if (net_ratelimit())
- printk("iptable_raw: ignoring short SOCK_RAW"
+ printk(KERN_WARNING "iptable_raw: ignoring short SOCK_RAW"
"packet.\n");
return NF_ACCEPT;
}
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
index 831e9b2..531c2fa 100644
--- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
+++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
@@ -177,7 +177,7 @@ static unsigned int ipv4_conntrack_local(unsigned int hooknum,
if (skb->len < sizeof(struct iphdr) ||
ip_hdrlen(skb) < sizeof(struct iphdr)) {
if (net_ratelimit())
- printk("ipt_hook: happy cracking.\n");
+ printk(KERN_DEBUG "ipt_hook: happy cracking.\n");
return NF_ACCEPT;
}
return nf_conntrack_in(PF_INET, hooknum, skb);
@@ -437,32 +437,32 @@ static int __init nf_conntrack_l3proto_ipv4_init(void)
ret = nf_conntrack_l4proto_register(&nf_conntrack_l4proto_tcp4);
if (ret < 0) {
- printk("nf_conntrack_ipv4: can't register tcp.\n");
+ printk(KERN_ERR "nf_conntrack_ipv4: can't register tcp.\n");
goto cleanup_sockopt;
}
ret = nf_conntrack_l4proto_register(&nf_conntrack_l4proto_udp4);
if (ret < 0) {
- printk("nf_conntrack_ipv4: can't register udp.\n");
+ printk(KERN_ERR "nf_conntrack_ipv4: can't register udp.\n");
goto cleanup_tcp;
}
ret = nf_conntrack_l4proto_register(&nf_conntrack_l4proto_icmp);
if (ret < 0) {
- printk("nf_conntrack_ipv4: can't register icmp.\n");
+ printk(KERN_ERR "nf_conntrack_ipv4: can't register icmp.\n");
goto cleanup_udp;
}
ret = nf_conntrack_l3proto_register(&nf_conntrack_l3proto_ipv4);
if (ret < 0) {
- printk("nf_conntrack_ipv4: can't register ipv4\n");
+ printk(KERN_ERR "nf_conntrack_ipv4: can't register ipv4\n");
goto cleanup_icmp;
}
ret = nf_register_hooks(ipv4_conntrack_ops,
ARRAY_SIZE(ipv4_conntrack_ops));
if (ret < 0) {
- printk("nf_conntrack_ipv4: can't register hooks.\n");
+ printk(KERN_ERR "nf_conntrack_ipv4: can't register hooks.\n");
goto cleanup_ipv4;
}
#if defined(CONFIG_PROC_FS) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT)
diff --git a/net/ipv4/netfilter/nf_nat_h323.c b/net/ipv4/netfilter/nf_nat_h323.c
index a868c8c..4446369 100644
--- a/net/ipv4/netfilter/nf_nat_h323.c
+++ b/net/ipv4/netfilter/nf_nat_h323.c
@@ -43,7 +43,7 @@ static int set_addr(struct sk_buff *skb,
addroff, sizeof(buf),
(char *) &buf, sizeof(buf))) {
if (net_ratelimit())
- printk("nf_nat_h323: nf_nat_mangle_tcp_packet"
+ printk(KERN_ERR "nf_nat_h323: nf_nat_mangle_tcp_packet"
" error\n");
return -1;
}
@@ -59,7 +59,7 @@ static int set_addr(struct sk_buff *skb,
addroff, sizeof(buf),
(char *) &buf, sizeof(buf))) {
if (net_ratelimit())
- printk("nf_nat_h323: nf_nat_mangle_udp_packet"
+ printk(KERN_ERR "nf_nat_h323: nf_nat_mangle_udp_packet"
" error\n");
return -1;
}
@@ -218,7 +218,7 @@ static int nat_rtp_rtcp(struct sk_buff *skb, struct nf_conn *ct,
/* Run out of expectations */
if (i >= H323_RTP_CHANNEL_MAX) {
if (net_ratelimit())
- printk("nf_nat_h323: out of expectations\n");
+ printk(KERN_WARNING "nf_nat_h323: out of expectations\n");
return 0;
}
@@ -237,7 +237,7 @@ static int nat_rtp_rtcp(struct sk_buff *skb, struct nf_conn *ct,
if (nated_port == 0) { /* No port available */
if (net_ratelimit())
- printk("nf_nat_h323: out of RTP ports\n");
+ printk(KERN_WARNING "nf_nat_h323: out of RTP ports\n");
return 0;
}
@@ -294,7 +294,7 @@ static int nat_t120(struct sk_buff *skb, struct nf_conn *ct,
if (nated_port == 0) { /* No port available */
if (net_ratelimit())
- printk("nf_nat_h323: out of TCP ports\n");
+ printk(KERN_WARNING "nf_nat_h323: out of TCP ports\n");
return 0;
}
@@ -344,7 +344,7 @@ static int nat_h245(struct sk_buff *skb, struct nf_conn *ct,
if (nated_port == 0) { /* No port available */
if (net_ratelimit())
- printk("nf_nat_q931: out of TCP ports\n");
+ printk(KERN_WARNING "nf_nat_q931: out of TCP ports\n");
return 0;
}
@@ -432,7 +432,7 @@ static int nat_q931(struct sk_buff *skb, struct nf_conn *ct,
if (nated_port == 0) { /* No port available */
if (net_ratelimit())
- printk("nf_nat_ras: out of TCP ports\n");
+ printk(KERN_WARNING "nf_nat_ras: out of TCP ports\n");
return 0;
}
@@ -518,7 +518,7 @@ static int nat_callforwarding(struct sk_buff *skb, struct nf_conn *ct,
if (nated_port == 0) { /* No port available */
if (net_ratelimit())
- printk("nf_nat_q931: out of TCP ports\n");
+ printk(KERN_WARNING "nf_nat_q931: out of TCP ports\n");
return 0;
}
diff --git a/net/ipv4/netfilter/nf_nat_rule.c b/net/ipv4/netfilter/nf_nat_rule.c
index 46b25ab..7fa78c8 100644
--- a/net/ipv4/netfilter/nf_nat_rule.c
+++ b/net/ipv4/netfilter/nf_nat_rule.c
@@ -99,8 +99,8 @@ static void warn_if_extra_mangle(__be32 dstip, __be32 srcip)
return;
if (rt->rt_src != srcip && !warned) {
- printk("NAT: no longer support implicit source local NAT\n");
- printk("NAT: packet src %u.%u.%u.%u -> dst %u.%u.%u.%u\n",
+ printk(KERN_WARNING "NAT: no longer support implicit source local NAT\n");
+ printk(KERN_WARNING "NAT: packet src %u.%u.%u.%u -> dst %u.%u.%u.%u\n",
NIPQUAD(srcip), NIPQUAD(dstip));
warned = 1;
}
@@ -144,7 +144,7 @@ static bool ipt_snat_checkentry(const char *tablename,
/* Must be a valid range */
if (mr->rangesize != 1) {
- printk("SNAT: multiple ranges no longer supported\n");
+ printk(KERN_ERR "SNAT: multiple ranges no longer supported\n");
return false;
}
return true;
@@ -160,7 +160,7 @@ static bool ipt_dnat_checkentry(const char *tablename,
/* Must be a valid range */
if (mr->rangesize != 1) {
- printk("DNAT: multiple ranges no longer supported\n");
+ printk(KERN_ERR "DNAT: multiple ranges no longer supported\n");
return false;
}
return true;
diff --git a/net/ipv4/netfilter/nf_nat_snmp_basic.c b/net/ipv4/netfilter/nf_nat_snmp_basic.c
index 03709d6..1be8350 100644
--- a/net/ipv4/netfilter/nf_nat_snmp_basic.c
+++ b/net/ipv4/netfilter/nf_nat_snmp_basic.c
@@ -390,7 +390,7 @@ static unsigned char asn1_octets_decode(struct asn1_ctx *ctx,
*octets = kmalloc(eoc - ctx->pointer, GFP_ATOMIC);
if (*octets == NULL) {
if (net_ratelimit())
- printk("OOM in bsalg (%d)\n", __LINE__);
+ printk(KERN_WARNING "OOM in bsalg (%d)\n", __LINE__);
return 0;
}
@@ -436,7 +436,7 @@ static unsigned char asn1_oid_decode(struct asn1_ctx *ctx,
*oid = kmalloc(size * sizeof(unsigned long), GFP_ATOMIC);
if (*oid == NULL) {
if (net_ratelimit())
- printk("OOM in bsalg (%d)\n", __LINE__);
+ printk(KERN_WARNING "OOM in bsalg (%d)\n", __LINE__);
return 0;
}
@@ -714,7 +714,7 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
if (*obj == NULL) {
kfree(id);
if (net_ratelimit())
- printk("OOM in bsalg (%d)\n", __LINE__);
+ printk(KERN_WARNING "OOM in bsalg (%d)\n", __LINE__);
return 0;
}
(*obj)->syntax.l[0] = l;
@@ -730,7 +730,7 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
if (*obj == NULL) {
kfree(id);
if (net_ratelimit())
- printk("OOM in bsalg (%d)\n", __LINE__);
+ printk(KERN_WARNING "OOM in bsalg (%d)\n", __LINE__);
return 0;
}
memcpy((*obj)->syntax.c, p, len);
@@ -745,7 +745,7 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
if (*obj == NULL) {
kfree(id);
if (net_ratelimit())
- printk("OOM in bsalg (%d)\n", __LINE__);
+ printk(KERN_WARNING "OOM in bsalg (%d)\n", __LINE__);
return 0;
}
if (!asn1_null_decode(ctx, end)) {
@@ -766,7 +766,7 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
kfree(lp);
kfree(id);
if (net_ratelimit())
- printk("OOM in bsalg (%d)\n", __LINE__);
+ printk(KERN_WARNING "OOM in bsalg (%d)\n", __LINE__);
return 0;
}
memcpy((*obj)->syntax.ul, lp, len);
@@ -787,7 +787,7 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
kfree(p);
kfree(id);
if (net_ratelimit())
- printk("OOM in bsalg (%d)\n", __LINE__);
+ printk(KERN_WARNING "OOM in bsalg (%d)\n", __LINE__);
return 0;
}
memcpy((*obj)->syntax.uc, p, len);
@@ -805,7 +805,7 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
if (*obj == NULL) {
kfree(id);
if (net_ratelimit())
- printk("OOM in bsalg (%d)\n", __LINE__);
+ printk(KERN_WARNING "OOM in bsalg (%d)\n", __LINE__);
return 0;
}
(*obj)->syntax.ul[0] = ul;
^ permalink raw reply related
* Please pull 'upstream-davem' branch of wireless-2.6
From: John W. Linville @ 2007-11-07 3:08 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-wireless
Dave,
Here are a few for when you decide to open net-2.6.25... :-)
Thanks,
John
---
Individual patches are available here:
http://www.kernel.org/pub/linux/kernel/people/linville/wireless-2.6/upstream-davem
---
The following changes since commit 2655e2cee2d77459fcb7e10228259e4ee0328697:
Alan Cox (1):
ata_piix: Add additional PCI identifier for 40 wire short cable
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git upstream-davem
Mattias Nissler (1):
mac80211: Accept auto txpower setting
Michael Wu (1):
ieee80211: Add IEEE80211_MAX_FRAME_LEN to linux/ieee80211.h
include/linux/ieee80211.h | 14 +++++++-------
net/mac80211/ieee80211_ioctl.c | 21 +++++++++++++++++----
2 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 30621c2..214821a 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -81,18 +81,18 @@
/* miscellaneous IEEE 802.11 constants */
-#define IEEE80211_MAX_FRAG_THRESHOLD 2346
-#define IEEE80211_MAX_RTS_THRESHOLD 2347
+#define IEEE80211_MAX_FRAG_THRESHOLD 2352
+#define IEEE80211_MAX_RTS_THRESHOLD 2353
#define IEEE80211_MAX_AID 2007
#define IEEE80211_MAX_TIM_LEN 251
-#define IEEE80211_MAX_DATA_LEN 2304
/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
6.2.1.1.2.
- The figure in section 7.1.2 suggests a body size of up to 2312
- bytes is allowed, which is a bit confusing, I suspect this
- represents the 2304 bytes of real data, plus a possible 8 bytes of
- WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */
+ 802.11e clarifies the figure in section 7.1.2. The frame body is
+ up to 2304 octets long (maximum MSDU size) plus any crypt overhead. */
+#define IEEE80211_MAX_DATA_LEN 2304
+/* 30 byte 4 addr hdr, 2 byte QoS, 2304 byte MSDU, 12 byte crypt, 4 byte FCS */
+#define IEEE80211_MAX_FRAME_LEN 2352
#define IEEE80211_MAX_SSID_LEN 32
diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c
index 6caa3ec..6d67217 100644
--- a/net/mac80211/ieee80211_ioctl.c
+++ b/net/mac80211/ieee80211_ioctl.c
@@ -634,22 +634,35 @@ static int ieee80211_ioctl_siwtxpower(struct net_device *dev,
{
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
bool need_reconfig = 0;
+ u8 new_power_level;
if ((data->txpower.flags & IW_TXPOW_TYPE) != IW_TXPOW_DBM)
return -EINVAL;
if (data->txpower.flags & IW_TXPOW_RANGE)
return -EINVAL;
- if (!data->txpower.fixed)
- return -EINVAL;
- if (local->hw.conf.power_level != data->txpower.value) {
- local->hw.conf.power_level = data->txpower.value;
+ if (data->txpower.fixed) {
+ new_power_level = data->txpower.value;
+ } else {
+ /* Automatic power level. Get the px power from the current
+ * channel. */
+ struct ieee80211_channel* chan = local->oper_channel;
+ if (!chan)
+ return -EINVAL;
+
+ new_power_level = chan->power_level;
+ }
+
+ if (local->hw.conf.power_level != new_power_level) {
+ local->hw.conf.power_level = new_power_level;
need_reconfig = 1;
}
+
if (local->hw.conf.radio_enabled != !(data->txpower.disabled)) {
local->hw.conf.radio_enabled = !(data->txpower.disabled);
need_reconfig = 1;
}
+
if (need_reconfig) {
ieee80211_hw_config(local);
/* The return value of hw_config is not of big interest here,
--
John W. Linville
linville@tuxdriver.com
^ permalink raw reply related
* [PATCH] Rename "virtual ethernet device" to "virtual ethernet pair device".
From: Rusty Russell @ 2007-11-07 3:09 UTC (permalink / raw)
To: netdev; +Cc: Pavel Emelianov, Eric W. Biederman
There are already iSeries and pSeries virtual ethernet drivers called
veth; calling a local tunnel device "veth" is confusing.
I didn't rename the module nor the header, to avoid breaking
documentation and userspace programs respectively. But I'd really
like to. It'd also be nice to mention "containers" somewhere in the
help text (I'm assuming that's what it's for?).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 5f800a6..033a847 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -135,11 +135,12 @@ config TUN
If you don't know what to use this for, you don't need it.
-config VETH
- tristate "Virtual ethernet device"
+config VETH_PAIR
+ tristate "Virtual ethernet pair device"
---help---
- The device is an ethernet tunnel. Devices are created in pairs. When
- one end receives the packet it appears on its pair and vice versa.
+ This device is a local ethernet tunnel. Devices are created in pairs.
+ When one end receives the packet it appears on its pair and vice
+ versa.
config NET_SB1000
tristate "General Instruments Surfboard 1000"
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 0e5fde4..20491b0 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -201,7 +201,7 @@ obj-$(CONFIG_MACSONIC) += macsonic.o
obj-$(CONFIG_MACMACE) += macmace.o
obj-$(CONFIG_MAC89x0) += mac89x0.o
obj-$(CONFIG_TUN) += tun.o
-obj-$(CONFIG_VETH) += veth.o
+obj-$(CONFIG_VETH_PAIR) += veth.o
obj-$(CONFIG_NET_NETX) += netx-eth.o
obj-$(CONFIG_DL2K) += dl2k.o
obj-$(CONFIG_R8169) += r8169.o
^ permalink raw reply related
* [PATCH 2.6.24-rc2] net: net_free implicit declaration
From: Randy Dunlap @ 2007-11-07 3:06 UTC (permalink / raw)
To: netdev; +Cc: davem, akpm, torvalds
From: Randy Dunlap <randy.dunlap@oracle.com>
Just move the function so that is it known before it is used.
net/core/net_namespace.c: In function 'copy_net_ns':
net/core/net_namespace.c:97: error: implicit declaration of function 'net_free'
net/core/net_namespace.c: At top level:
net/core/net_namespace.c:104: warning: conflicting types for 'net_free'
net/core/net_namespace.c:104: error: static declaration of 'net_free' follows non-static declaration
net/core/net_namespace.c:97: error: previous implicit declaration of 'net_free' was here
make[2]: *** [net/core/net_namespace.o] Error 1
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
net/core/net_namespace.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
--- linux-2.6.24-rc2.orig/net/core/net_namespace.c
+++ linux-2.6.24-rc2/net/core/net_namespace.c
@@ -64,6 +64,20 @@ static struct net *net_alloc(void)
return kmem_cache_zalloc(net_cachep, GFP_KERNEL);
}
+static void net_free(struct net *net)
+{
+ if (!net)
+ return;
+
+ if (unlikely(atomic_read(&net->use_count) != 0)) {
+ printk(KERN_EMERG "network namespace not free! Usage: %d\n",
+ atomic_read(&net->use_count));
+ return;
+ }
+
+ kmem_cache_free(net_cachep, net);
+}
+
struct net *copy_net_ns(unsigned long flags, struct net *old_net)
{
struct net *new_net = NULL;
@@ -100,20 +114,6 @@ out:
return new_net;
}
-static void net_free(struct net *net)
-{
- if (!net)
- return;
-
- if (unlikely(atomic_read(&net->use_count) != 0)) {
- printk(KERN_EMERG "network namespace not free! Usage: %d\n",
- atomic_read(&net->use_count));
- return;
- }
-
- kmem_cache_free(net_cachep, net);
-}
-
static void cleanup_net(struct work_struct *work)
{
struct pernet_operations *ops;
^ permalink raw reply
* [PATCH 03/05] ipv6: RFC4214 Support
From: Templin, Fred L @ 2007-11-07 1:16 UTC (permalink / raw)
To: netdev
From: Fred L. Templin <fred.l.templin@boeing.com>
This is experimental support for the Intra-Site Automatic
Tunnel Addressing Protocol (ISATAP) per RFC4214. It uses
the SIT module, and is configured using the unmodified
"ip" utility with device names beginning with: "isatap".
The following diffs are specific to the Linux 2.6.23
kernel distribution.
Signed-off-by: Fred L. Templin <fred.l.templin@boeing.com>
---
--- linux-2.6.23/net/ipv6/addrconf.c.orig 2007-10-09
13:31:38.000000000 -0700
+++ linux-2.6.23/net/ipv6/addrconf.c 2007-10-31 13:08:45.000000000
-0700
@@ -73,7 +73,11 @@
#include <net/tcp.h>
#include <net/ip.h>
#include <net/netlink.h>
+#if defined(CONFIG_IPV6_ISATAP)
+#include <net/ipip.h>
+#else
#include <linux/if_tunnel.h>
+#endif
#include <linux/rtnetlink.h>
#ifdef CONFIG_IPV6_PRIVACY
@@ -1426,6 +1430,11 @@ static int ipv6_generate_eui64(u8 *eui,
return addrconf_ifid_arcnet(eui, dev);
case ARPHRD_INFINIBAND:
return addrconf_ifid_infiniband(eui, dev);
+#if defined(CONFIG_IPV6_ISATAP)
+ case ARPHRD_SIT:
+ if (dev->priv_flags&IFF_ISATAP)
+ return ipv6_isatap_eui64(eui, (__be32 *)dev->dev_addr);
+#endif
}
return -1;
}
@@ -2138,7 +2147,6 @@ static void addrconf_add_linklocal(struc
addr_flags |= IFA_F_OPTIMISTIC;
#endif
-
ifp = ipv6_add_addr(idev, addr, 64, IFA_LINK, addr_flags);
if (!IS_ERR(ifp)) {
addrconf_prefix_route(&ifp->addr, ifp->prefix_len,
idev->dev, 0, 0);
@@ -2192,6 +2200,32 @@ static void addrconf_sit_config(struct n
return;
}
+#if defined(CONFIG_IPV6_ISATAP)
+ /* ISATAP (RFC4214) - configure as NBMA link */
+ if (dev->priv_flags&IFF_ISATAP) {
+ struct in6_addr addr;
+
+ addrconf_add_lroute(dev);
+
+ addr.s6_addr32[0] = htonl(0xFE800000);
+ addr.s6_addr32[1] = 0;
+
+ if (ipv6_generate_eui64(addr.s6_addr + 8, dev) == 0) {
+ struct inet6_ifaddr *ifp;
+
+ if (!IS_ERR(ifp = ipv6_add_addr(idev, &addr, 64,
+ IFA_LINK, IFA_F_PERMANENT))) {
+ addrconf_prefix_route(&ifp->addr,
ifp->prefix_len,
+ idev->dev, 0, 0);
+ addrconf_dad_start(ifp, 0);
+ in6_ifa_put(ifp);
+ }
+ }
+
+ return;
+ }
+#endif
+
sit_add_v4_addrs(idev);
if (dev->flags&IFF_POINTOPOINT) {
@@ -2521,6 +2555,16 @@ static void addrconf_rs_timer(unsigned l
* Announcement received after solicitation
* was sent
*/
+#if defined(CONFIG_IPV6_ISATAP)
+ /* ISATAP (RFC4214) - Re-DAD to trigger new RS/RA */
+ if (ifp->idev->dev->priv_flags & IFF_ISATAP) {
+ spin_lock(&ifp->lock);
+ ifp->probes = 0;
+ ifp->idev->if_flags &= ~(IF_RS_SENT|IF_RA_RCVD);
+ addrconf_mod_timer(ifp, AC_DAD, HZ*120);
+ spin_unlock(&ifp->lock);
+ }
+#endif
goto out;
}
@@ -2535,10 +2579,32 @@ static void addrconf_rs_timer(unsigned l
ifp->idev->cnf.rtr_solicit_interval);
spin_unlock(&ifp->lock);
+#if defined(CONFIG_IPV6_ISATAP)
+ /* ISATAP (RFC4214) - unicast RS */
+ if (ifp->idev->dev->priv_flags & IFF_ISATAP) {
+ struct ip_tunnel *t = netdev_priv(ifp->idev->dev);
+ __be32 rtr = t->parms.i_key;
+
+ if (!rtr) goto out;
+
+ all_routers.s6_addr32[0] = htonl(0xFE800000);
+ all_routers.s6_addr32[1] = 0;
+ ipv6_isatap_eui64(all_routers.s6_addr + 8, &rtr);
+
+ } else
+#endif
ipv6_addr_all_routers(&all_routers);
ndisc_send_rs(ifp->idev->dev, &ifp->addr, &all_routers);
} else {
+#if defined(CONFIG_IPV6_ISATAP)
+ /* ISATAP (RFC4214) - Re-DAD to trigger new RS/RA */
+ if (ifp->idev->dev->priv_flags & IFF_ISATAP) {
+ ifp->probes = 0;
+ ifp->idev->if_flags &= ~(IF_RS_SENT|IF_RA_RCVD);
+ addrconf_mod_timer(ifp, AC_DAD, HZ*120);
+ }
+#endif
spin_unlock(&ifp->lock);
/*
* Note: we do not support deprecated "all on-link"
@@ -2584,6 +2650,9 @@ static void addrconf_dad_start(struct in
spin_lock_bh(&ifp->lock);
if (dev->flags&(IFF_NOARP|IFF_LOOPBACK) ||
+#if defined(CONFIG_IPV6_ISATAP)
+ dev->priv_flags&IFF_ISATAP ||
+#endif
!(ifp->flags&IFA_F_TENTATIVE) ||
ifp->flags & IFA_F_NODAD) {
ifp->flags &= ~(IFA_F_TENTATIVE|IFA_F_OPTIMISTIC);
@@ -2680,6 +2749,20 @@ static void addrconf_dad_completed(struc
(ipv6_addr_type(&ifp->addr) & IPV6_ADDR_LINKLOCAL)) {
struct in6_addr all_routers;
+#if defined(CONFIG_IPV6_ISATAP)
+ /* ISATAP (RFC4214) - unicast RS */
+ if (ifp->idev->dev->priv_flags & IFF_ISATAP) {
+ struct ip_tunnel *t = netdev_priv(ifp->idev->dev);
+ __be32 rtr = t->parms.i_key;
+
+ if (!rtr) return;
+
+ all_routers.s6_addr32[0] = htonl(0xFE800000);
+ all_routers.s6_addr32[1] = 0;
+ ipv6_isatap_eui64(all_routers.s6_addr + 8, &rtr);
+
+ } else
+#endif
ipv6_addr_all_routers(&all_routers);
/*
^ permalink raw reply
* [PATCH 02/05] ipv6: RFC4214 Support
From: Templin, Fred L @ 2007-11-07 1:16 UTC (permalink / raw)
To: netdev
From: Fred L. Templin <fred.l.templin@boeing.com>
This is experimental support for the Intra-Site Automatic
Tunnel Addressing Protocol (ISATAP) per RFC4214. It uses
the SIT module, and is configured using the unmodified
"ip" utility with device names beginning with: "isatap".
The following diffs are specific to the Linux 2.6.23
kernel distribution.
Signed-off-by: Fred L. Templin <fred.l.templin@boeing.com>
---
--- linux-2.6.23/include/net/addrconf.h.orig 2007-10-09
13:31:38.000000000 -0700
+++ linux-2.6.23/include/net/addrconf.h 2007-10-26 10:49:40.000000000
-0700
@@ -241,6 +241,34 @@ static inline int ipv6_addr_is_ll_all_ro
addr->s6_addr32[3] == htonl(0x00000002));
}
+#if defined(CONFIG_IPV6_ISATAP)
+static inline int ipv6_isatap_eui64(u8 *eui, __be32 *addr)
+{
+ __be32 ipv4 = ntohl(*addr);
+
+ eui[0] = 0;
+
+ /* Check for RFC3330 global address ranges */
+ if (((ipv4 >= 0x01000000) && (ipv4 < 0x0a000000)) ||
+ ((ipv4 >= 0x0b000000) && (ipv4 < 0x7f000000)) ||
+ ((ipv4 >= 0x80000000) && (ipv4 < 0xa9fe0000)) ||
+ ((ipv4 >= 0xa9ff0000) && (ipv4 < 0xac100000)) ||
+ ((ipv4 >= 0xac200000) && (ipv4 < 0xc0a80000)) ||
+ ((ipv4 >= 0xc0a90000) && (ipv4 < 0xc6120000)) ||
+ ((ipv4 >= 0xc6140000) && (ipv4 < 0xe0000000))) eui[0] |=
0x2;
+
+ eui[1] = 0; eui[2] = 0x5E; eui[3] = 0xFE;
+ memcpy (eui+4, addr, 4);
+ return (0);
+}
+
+static inline int ipv6_addr_is_isatap(const struct in6_addr *addr)
+{
+ return (addr->s6_addr32[2] == __constant_htonl(0x02005EFE) ||
+ addr->s6_addr32[2] == __constant_htonl(0x00005EFE));
+}
+#endif
+
#ifdef CONFIG_PROC_FS
extern int if6_proc_init(void);
extern void if6_proc_exit(void);
^ permalink raw reply
* [PATCH 00/05] ipv6: RFC4214 Support
From: Templin, Fred L @ 2007-11-07 1:15 UTC (permalink / raw)
To: netdev
In-Reply-To: <20071106222213.GA22170@electric-eye.fr.zoreil.com>
From: Fred L. Templin <fred.l.templin@boeing.com>
The following diffs are specific to the Linux 2.6.23
kernel distribution and implement RFC4214 (Intra-Site
Automatic Tunnel Addressing Protocol - ISATAP). The
affected modules are:
linux2.6.23/include/linux/if.h
linux2.6.23/include/net/addrconf.h
linux2.6.23/net/ipv6/addrconf.c
linux2.6.23/net/ipv6/sit.c
linux2.6.23/net/ipv6/Kconfig
and the diffs for each file are included in the following
messages as [PATCH 01/05] through [PATCH 05/05].
The code has been tested under Fedora Core 6 running the
modified 2.6.23 and has been verified in both ISATAP
client and ISATAP router configurations. (The ISATAP
router configuration uses the 'radvd' package.)
Interoperability testing with Windows Vista has also
been performed.
Please advise as to next steps.
Signed-off-by: Fred L. Templin <fred.l.templin@boeing.com>
^ permalink raw reply
* [PATCH 05/05] ipv6: RFC4214 Support
From: Templin, Fred L @ 2007-11-07 1:16 UTC (permalink / raw)
To: netdev
From: Fred L. Templin <fred.l.templin@boeing.com>
This is experimental support for the Intra-Site Automatic
Tunnel Addressing Protocol (ISATAP) per RFC4214. It uses
the SIT module, and is configured using the unmodified
"ip" utility with device names beginning with: "isatap".
The following diffs are specific to the Linux 2.6.23
kernel distribution.
Signed-off-by: Fred L. Templin <fred.l.templin@boeing.com>
---
--- linux-2.6.23/net/ipv6/Kconfig.orig 2007-10-31 11:15:13.000000000
-0700
+++ linux-2.6.23/net/ipv6/Kconfig 2007-10-31 11:18:32.000000000
-0700
@@ -57,6 +57,17 @@ config IPV6_ROUTE_INFO
If unsure, say N.
+config IPV6_ISATAP
+ bool "IPv6: ISATAP (RFC 4214) support (EXPERIMENTAL)"
+ depends on IPV6 && EXPERIMENTAL
+ ---help---
+ This is experimental support for the Intra-Site Automatic
+ Tunnel Addressing Protocol (ISATAP) per RFC4214. It uses
+ the SIT module, and is configured using the "ip" utility
+ with device names beginning with: "isatap".
+
+ If unsure, say N.
+
config IPV6_OPTIMISTIC_DAD
bool "IPv6: Enable RFC 4429 Optimistic DAD (EXPERIMENTAL)"
depends on IPV6 && EXPERIMENTAL
^ permalink raw reply
* [PATCH 01/05] ipv6: RFC4214 Support
From: Templin, Fred L @ 2007-11-07 1:16 UTC (permalink / raw)
To: netdev
From: Fred L. Templin <fred.l.templin@boeing.com>
This is experimental support for the Intra-Site Automatic
Tunnel Addressing Protocol (ISATAP) per RFC4214. It uses
the SIT module, and is configured using the unmodified
"ip" utility with device names beginning with: "isatap".
The following diffs are specific to the Linux 2.6.23
kernel distribution.
Signed-off-by: Fred L. Templin <fred.l.templin@boeing.com>
---
--- linux-2.6.23/include/linux/if.h.orig 2007-10-29
09:22:26.000000000 -0700
+++ linux-2.6.23/include/linux/if.h 2007-10-26 11:00:06.000000000
-0700
@@ -61,6 +61,9 @@
#define IFF_MASTER_ALB 0x10 /* bonding master, balance-alb.
*/
#define IFF_BONDING 0x20 /* bonding master or slave
*/
#define IFF_SLAVE_NEEDARP 0x40 /* need ARPs for validation
*/
+#if defined(CONFIG_IPV6_ISATAP)
+#define IFF_ISATAP 0x80 /* ISATAP interface (RFC4214)
*/
+#endif
#define IF_GET_IFACE 0x0001 /* for querying only */
#define IF_GET_PROTO 0x0002
^ permalink raw reply
* [PATCH 04/05] ipv6: RFC4214 Support
From: Templin, Fred L @ 2007-11-07 1:16 UTC (permalink / raw)
To: netdev
From: Fred L. Templin <fred.l.templin@boeing.com>
This is experimental support for the Intra-Site Automatic
Tunnel Addressing Protocol (ISATAP) per RFC4214. It uses
the SIT module, and is configured using the unmodified
"ip" utility with device names beginning with: "isatap".
The following diffs are specific to the Linux 2.6.23
kernel distribution.
Signed-off-by: Fred L. Templin <fred.l.templin@boeing.com>
---
--- linux-2.6.23/net/ipv6/sit.c.orig 2007-10-09 13:31:38.000000000
-0700
+++ linux-2.6.23/net/ipv6/sit.c 2007-11-06 15:32:27.000000000 -0800
@@ -16,6 +16,7 @@
* Changes:
* Roger Venning <r.venning@telstra.com>: 6to4 support
* Nate Thompson <nate@thebog.net>: 6to4 support
+ * Fred L. Templin <fltemplin@acm.org>: isatap support
*/
#include <linux/module.h>
@@ -154,6 +155,14 @@ static struct ip_tunnel * ipip6_tunnel_l
struct net_device *dev;
char name[IFNAMSIZ];
+#if defined(CONFIG_IPV6_ISATAP)
+ /* ISATAP (RFC4214) - router address in daddr */
+ if (!strncmp(parms->name, "isatap", 6)) {
+ parms->i_key = parms->iph.daddr;
+ parms->iph.daddr = remote = 0;
+ }
+#endif
+
for (tp = __ipip6_bucket(parms); (t = *tp) != NULL; tp =
&t->next) {
if (local == t->parms.iph.saddr && remote ==
t->parms.iph.daddr)
return t;
@@ -182,6 +191,11 @@ static struct ip_tunnel * ipip6_tunnel_l
dev->init = ipip6_tunnel_init;
nt->parms = *parms;
+#if defined(CONFIG_IPV6_ISATAP)
+ if (!strncmp(dev->name, "isatap", 6))
+ dev->priv_flags |= IFF_ISATAP;
+#endif
+
if (register_netdevice(dev) < 0) {
free_netdev(dev);
goto failed;
@@ -382,6 +396,48 @@ static int ipip6_rcv(struct sk_buff *skb
IPCB(skb)->flags = 0;
skb->protocol = htons(ETH_P_IPV6);
skb->pkt_type = PACKET_HOST;
+#if defined(CONFIG_IPV6_ISATAP)
+ /* ISATAP (RFC4214) - check source address */
+ if (tunnel->dev->priv_flags & IFF_ISATAP) {
+ struct neighbour *neigh;
+ struct dst_entry *dst;
+ struct flowi fl;
+ struct in6_addr *addr6;
+ struct ipv6hdr *iph6;
+
+ /* from ISATAP router */
+ if (iph->saddr == tunnel->parms.i_key) goto accept;
+
+ iph6 = ipv6_hdr(skb);
+ addr6 = &iph6->saddr;
+
+ /* from legitimate previous hop */
+ memset(&fl, 0, sizeof(fl));
+ fl.proto = iph6->nexthdr;
+ ipv6_addr_copy(&fl.fl6_dst, addr6);
+ fl.oif = tunnel->dev->ifindex;
+ security_skb_classify_flow(skb, &fl);
+
+ if (!(dst = ip6_route_output(NULL, &fl)) ||
+ (dst->dev != tunnel->dev) ||
+ ((neigh = dst->neighbour) == NULL))
+ goto drop;
+
+ addr6 = (struct in6_addr*)&neigh->primary_key;
+
+ if (!(ipv6_addr_is_isatap(addr6)) ||
+ (addr6->s6_addr32[3] != iph->saddr)) {
+drop:
+ tunnel->stat.rx_errors++;
+ dst_release(dst);
+ kfree_skb(skb);
+ read_unlock(&ipip6_lock);
+ return 0;
+ }
+ dst_release(dst);
+ }
+accept:
+#endif
tunnel->stat.rx_packets++;
tunnel->stat.rx_bytes += skb->len;
skb->dev = tunnel->dev;
@@ -395,8 +451,6 @@ static int ipip6_rcv(struct sk_buff *skb
}
icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0);
- kfree_skb(skb);
- read_unlock(&ipip6_lock);
out:
return 0;
}
@@ -444,6 +498,31 @@ static int ipip6_tunnel_xmit(struct sk_b
if (skb->protocol != htons(ETH_P_IPV6))
goto tx_error;
+#if defined(CONFIG_IPV6_ISATAP)
+ /* ISATAP (RFC4214) - must come before 6to4 */
+ if (dev->priv_flags & IFF_ISATAP) {
+ struct neighbour *neigh = NULL;
+
+ if (skb->dst)
+ neigh = skb->dst->neighbour;
+
+ if (neigh == NULL) {
+ if (net_ratelimit())
+ printk(KERN_DEBUG "sit: nexthop ==
NULL\n");
+ goto tx_error;
+ }
+
+ addr6 = (struct in6_addr*)&neigh->primary_key;
+ addr_type = ipv6_addr_type(addr6);
+
+ if ((addr_type & IPV6_ADDR_UNICAST) &&
+ ipv6_addr_is_isatap(addr6))
+ dst = addr6->s6_addr32[3];
+ else
+ goto tx_error;
+ }
+#endif /* CONFIG_IPV6_ISATAP */
+
if (!dst)
dst = try_6to4(&iph6->daddr);
^ permalink raw reply
* Re: Possible BUG on net/ipv4/ipcomp.c, line 358 (fwd)
From: Herbert Xu @ 2007-11-07 1:11 UTC (permalink / raw)
To: James Morris; +Cc: David S. Miller, netdev
In-Reply-To: <Xine.LNX.4.64.0711070751530.27327@us.intercode.com.au>
On Wed, Nov 07, 2007 at 07:51:57AM +1100, James Morris wrote:
>
> ---------- Forwarded message ----------
> Date: Tue, 06 Nov 2007 14:53:30 +0100
> From: Vicenç <vbeltran@ac.upc.edu>
> To: jmorris@intercode.com.au
> Subject: Possible BUG on net/ipv4/ipcomp.c, line 358
>
> Hi James,
>
> I think there is a bug on net/ipv4/ipcomp.c line 358. The trivial patch that
> should fix it is:
Thanks for the report! The same bug exists in IPv6 too and
this patch should fix both.
[IPSEC]: Fix crypto_alloc_comp error checking
The function crypto_alloc_comp returns an errno instead of NULL
to indicate error. So it needs to be tested with IS_ERR.
This is based on a patch by Vicenç Beltran Querol.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c
index ca1b5fd..2c44a94 100644
--- a/net/ipv4/ipcomp.c
+++ b/net/ipv4/ipcomp.c
@@ -16,6 +16,7 @@
#include <linux/module.h>
#include <asm/semaphore.h>
#include <linux/crypto.h>
+#include <linux/err.h>
#include <linux/pfkeyv2.h>
#include <linux/percpu.h>
#include <linux/smp.h>
@@ -344,7 +345,7 @@ static struct crypto_comp **ipcomp_alloc_tfms(const char *alg_name)
for_each_possible_cpu(cpu) {
struct crypto_comp *tfm = crypto_alloc_comp(alg_name, 0,
CRYPTO_ALG_ASYNC);
- if (!tfm)
+ if (IS_ERR(tfm))
goto error;
*per_cpu_ptr(tfms, cpu) = tfm;
}
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c
index 85eb479..0cd4056 100644
--- a/net/ipv6/ipcomp6.c
+++ b/net/ipv6/ipcomp6.c
@@ -36,6 +36,7 @@
#include <net/ipcomp.h>
#include <asm/semaphore.h>
#include <linux/crypto.h>
+#include <linux/err.h>
#include <linux/pfkeyv2.h>
#include <linux/random.h>
#include <linux/percpu.h>
@@ -358,7 +359,7 @@ static struct crypto_comp **ipcomp6_alloc_tfms(const char *alg_name)
for_each_possible_cpu(cpu) {
struct crypto_comp *tfm = crypto_alloc_comp(alg_name, 0,
CRYPTO_ALG_ASYNC);
- if (!tfm)
+ if (IS_ERR(tfm))
goto error;
*per_cpu_ptr(tfms, cpu) = tfm;
}
^ permalink raw reply related
* Please pull 'fixes-davem' branch of wireless-2.6
From: John W. Linville @ 2007-11-07 0:13 UTC (permalink / raw)
To: davem; +Cc: jeff, netdev, linux-wireless
Dave,
Here are some fixes for 2.6.24...
The iwlwifi patch is needed because the iwlwifi drivers routinely end-up
associated with the "simple" rate control algorithm, yet those drivers
really only work with their own custom algorithms. The other rate
control patches are there to satisfy dependencies for this patch.
"mac80211: remove ieee80211_common.h" cleans-up an unused file left
hanging-around after an earlier patch already in 2.6.24.
"mac80211: remove unused driver ops" is really a clean-up, but
"mac80211: use IW_AUTH_PRIVACY_INVOKED rather than IW_AUTH_KEY_MGMT"
depends on it.
"ssb: Fix initcall ordering" changes a subsys_initcall to an
fs_initcall. This seems like a bit of a hack, but it fixes a real
problem and I'm not sure what cleaner solution is either reasonable
or available. The comment in the patch explains the reasoning for this
somewhat unique situation.
I think the other patches are plain enough to not require further
comment. Let me know if there are any problems!
Thanks,
John
---
Individual patches are available here:
http://www.kernel.org/pub/linux/kernel/people/linville/wireless-2.6/fixes-davem/
---
The following changes since commit 2655e2cee2d77459fcb7e10228259e4ee0328697:
Alan Cox (1):
ata_piix: Add additional PCI identifier for 40 wire short cable
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git fixes-davem
Johannes Berg (9):
softmac: fix wext MLME request reason code endianness
mac80211: make simple rate control algorithm built-in
mac80211: don't allow registering the same rate control twice
mac80211: allow driver to ask for a rate control algorithm
iwlwifi: select proper rate control algorithm
softmac: MAINTAINERS update
mac80211: remove ieee80211_common.h
mac80211: remove unused driver ops
mac80211: use IW_AUTH_PRIVACY_INVOKED rather than IW_AUTH_KEY_MGMT
John W. Linville (1):
mac80211: make "decrypt failed" messages conditional upon MAC80211_DEBUG
Michael Buesch (5):
ssb: Fix initcall ordering
rfkill: Register LED triggers before registering switch
rfkill: Use subsys_initcall
rfkill: Use mutex_lock() at register and add sanity check
rfkill: Fix sparse warning
MAINTAINERS | 7 +--
drivers/net/wireless/iwlwifi/iwl3945-base.c | 2 +
drivers/net/wireless/iwlwifi/iwl4965-base.c | 2 +
drivers/ssb/main.c | 5 +-
include/net/mac80211.h | 26 ++------
net/ieee80211/softmac/ieee80211softmac_wx.c | 2 +-
net/mac80211/Kconfig | 12 ++++
net/mac80211/Makefile | 3 +-
net/mac80211/ieee80211.c | 16 +++++-
net/mac80211/ieee80211_common.h | 91 ---------------------------
net/mac80211/ieee80211_i.h | 2 +-
net/mac80211/ieee80211_ioctl.c | 21 +++----
net/mac80211/ieee80211_rate.c | 24 ++++++-
net/mac80211/ieee80211_rate.h | 3 +
net/mac80211/ieee80211_sta.c | 18 +++--
net/mac80211/rc80211_simple.c | 25 +-------
net/mac80211/rx.c | 2 +
net/mac80211/wep.c | 2 +
net/mac80211/wpa.c | 18 ++++--
net/rfkill/rfkill.c | 37 ++++++-----
20 files changed, 126 insertions(+), 192 deletions(-)
delete mode 100644 net/mac80211/ieee80211_common.h
diff --git a/MAINTAINERS b/MAINTAINERS
index 1c7c229..095522f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3452,15 +3452,10 @@ L: lm-sensors@lm-sensors.org
S: Maintained
SOFTMAC LAYER (IEEE 802.11)
-P: Johannes Berg
-M: johannes@sipsolutions.net
-P: Joe Jezak
-M: josejx@gentoo.org
P: Daniel Drake
M: dsd@gentoo.org
-W: http://softmac.sipsolutions.net/
L: linux-wireless@vger.kernel.org
-S: Maintained
+S: Obsolete
SOFTWARE RAID (Multiple Disks) SUPPORT
P: Ingo Molnar
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 4f22a71..be7c9f4 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -8354,6 +8354,8 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
}
SET_IEEE80211_DEV(hw, &pdev->dev);
+ hw->rate_control_algorithm = "iwl-3945-rs";
+
IWL_DEBUG_INFO("*** LOAD DRIVER ***\n");
priv = hw->priv;
priv->hw = hw;
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index d60adcb..6757c6c 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -8955,6 +8955,8 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
}
SET_IEEE80211_DEV(hw, &pdev->dev);
+ hw->rate_control_algorithm = "iwl-4965-rs";
+
IWL_DEBUG_INFO("*** LOAD DRIVER ***\n");
priv = hw->priv;
priv->hw = hw;
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
index c12a741..fc1d589 100644
--- a/drivers/ssb/main.c
+++ b/drivers/ssb/main.c
@@ -1147,7 +1147,10 @@ static int __init ssb_modinit(void)
return err;
}
-subsys_initcall(ssb_modinit);
+/* ssb must be initialized after PCI but before the ssb drivers.
+ * That means we must use some initcall between subsys_initcall
+ * and device_initcall. */
+fs_initcall(ssb_modinit);
static void __exit ssb_modexit(void)
{
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 5fcc4c1..17b6039 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -706,11 +706,16 @@ enum ieee80211_hw_flags {
*
* @queues: number of available hardware transmit queues for
* data packets. WMM/QoS requires at least four.
+ *
+ * @rate_control_algorithm: rate control algorithm for this hardware.
+ * If unset (NULL), the default algorithm will be used. Must be
+ * set before calling ieee80211_register_hw().
*/
struct ieee80211_hw {
struct ieee80211_conf conf;
struct wiphy *wiphy;
struct workqueue_struct *workqueue;
+ const char *rate_control_algorithm;
void *priv;
u32 flags;
unsigned int extra_tx_headroom;
@@ -936,27 +941,11 @@ enum ieee80211_erp_change_flags {
* and remove_interface calls, i.e. while the interface with the
* given local_address is enabled.
*
- * @set_ieee8021x: Enable/disable IEEE 802.1X. This item requests wlan card
- * to pass unencrypted EAPOL-Key frames even when encryption is
- * configured. If the wlan card does not require such a configuration,
- * this function pointer can be set to NULL.
- *
- * @set_port_auth: Set port authorization state (IEEE 802.1X PAE) to be
- * authorized (@authorized=1) or unauthorized (=0). This function can be
- * used if the wlan hardware or low-level driver implements PAE.
- * mac80211 will filter frames based on authorization state in any case,
- * so this function pointer can be NULL if low-level driver does not
- * require event notification about port state changes.
- *
* @hw_scan: Ask the hardware to service the scan request, no need to start
* the scan state machine in stack.
*
* @get_stats: return low-level statistics
*
- * @set_privacy_invoked: For devices that generate their own beacons and probe
- * response or association responses this updates the state of privacy_invoked
- * returns 0 for success or an error number.
- *
* @get_sequence_counter: For devices that have internal sequence counters this
* callback allows mac80211 to access the current value of a counter.
* This callback seems not well-defined, tell us if you need it.
@@ -1029,14 +1018,9 @@ struct ieee80211_ops {
int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd,
const u8 *local_address, const u8 *address,
struct ieee80211_key_conf *key);
- int (*set_ieee8021x)(struct ieee80211_hw *hw, int use_ieee8021x);
- int (*set_port_auth)(struct ieee80211_hw *hw, u8 *addr,
- int authorized);
int (*hw_scan)(struct ieee80211_hw *hw, u8 *ssid, size_t len);
int (*get_stats)(struct ieee80211_hw *hw,
struct ieee80211_low_level_stats *stats);
- int (*set_privacy_invoked)(struct ieee80211_hw *hw,
- int privacy_invoked);
int (*get_sequence_counter)(struct ieee80211_hw *hw,
u8* addr, u8 keyidx, u8 txrx,
u32* iv32, u16* iv16);
diff --git a/net/ieee80211/softmac/ieee80211softmac_wx.c b/net/ieee80211/softmac/ieee80211softmac_wx.c
index ac36767..e01b59a 100644
--- a/net/ieee80211/softmac/ieee80211softmac_wx.c
+++ b/net/ieee80211/softmac/ieee80211softmac_wx.c
@@ -470,7 +470,7 @@ ieee80211softmac_wx_set_mlme(struct net_device *dev,
{
struct ieee80211softmac_device *mac = ieee80211_priv(dev);
struct iw_mlme *mlme = (struct iw_mlme *)extra;
- u16 reason = cpu_to_le16(mlme->reason_code);
+ u16 reason = mlme->reason_code;
struct ieee80211softmac_network *net;
int err = -EINVAL;
diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig
index 6fffb38..32c8c08 100644
--- a/net/mac80211/Kconfig
+++ b/net/mac80211/Kconfig
@@ -13,6 +13,18 @@ config MAC80211
This option enables the hardware independent IEEE 802.11
networking stack.
+config MAC80211_RCSIMPLE
+ bool "'simple' rate control algorithm"
+ default y
+ depends on MAC80211 && EMBEDDED
+ help
+ This option allows you to turn off the 'simple' rate
+ control algorithm in mac80211. If you do turn it off,
+ you absolutely need another rate control algorithm.
+
+ Say Y unless you know you will have another algorithm
+ available.
+
config MAC80211_LEDS
bool "Enable LED triggers"
depends on MAC80211 && LEDS_TRIGGERS
diff --git a/net/mac80211/Makefile b/net/mac80211/Makefile
index 219cd9f..1e6237b 100644
--- a/net/mac80211/Makefile
+++ b/net/mac80211/Makefile
@@ -1,8 +1,9 @@
-obj-$(CONFIG_MAC80211) += mac80211.o rc80211_simple.o
+obj-$(CONFIG_MAC80211) += mac80211.o
mac80211-objs-$(CONFIG_MAC80211_LEDS) += ieee80211_led.o
mac80211-objs-$(CONFIG_MAC80211_DEBUGFS) += debugfs.o debugfs_sta.o debugfs_netdev.o debugfs_key.o
mac80211-objs-$(CONFIG_NET_SCHED) += wme.o
+mac80211-objs-$(CONFIG_MAC80211_RCSIMPLE) += rc80211_simple.o
mac80211-objs := \
ieee80211.o \
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
index f484ca7..e0ee65a 100644
--- a/net/mac80211/ieee80211.c
+++ b/net/mac80211/ieee80211.c
@@ -1072,7 +1072,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
ieee80211_debugfs_add_netdev(IEEE80211_DEV_TO_SUB_IF(local->mdev));
ieee80211_if_set_type(local->mdev, IEEE80211_IF_TYPE_AP);
- result = ieee80211_init_rate_ctrl_alg(local, NULL);
+ result = ieee80211_init_rate_ctrl_alg(local,
+ hw->rate_control_algorithm);
if (result < 0) {
printk(KERN_DEBUG "%s: Failed to initialize rate control "
"algorithm\n", wiphy_name(local->hw.wiphy));
@@ -1233,8 +1234,17 @@ static int __init ieee80211_init(void)
BUILD_BUG_ON(sizeof(struct ieee80211_tx_packet_data) > sizeof(skb->cb));
+#ifdef CONFIG_MAC80211_RCSIMPLE
+ ret = ieee80211_rate_control_register(&mac80211_rcsimple);
+ if (ret)
+ return ret;
+#endif
+
ret = ieee80211_wme_register();
if (ret) {
+#ifdef CONFIG_MAC80211_RCSIMPLE
+ ieee80211_rate_control_unregister(&mac80211_rcsimple);
+#endif
printk(KERN_DEBUG "ieee80211_init: failed to "
"initialize WME (err=%d)\n", ret);
return ret;
@@ -1248,6 +1258,10 @@ static int __init ieee80211_init(void)
static void __exit ieee80211_exit(void)
{
+#ifdef CONFIG_MAC80211_RCSIMPLE
+ ieee80211_rate_control_unregister(&mac80211_rcsimple);
+#endif
+
ieee80211_wme_unregister();
ieee80211_debugfs_netdev_exit();
}
diff --git a/net/mac80211/ieee80211_common.h b/net/mac80211/ieee80211_common.h
deleted file mode 100644
index c15295d..0000000
--- a/net/mac80211/ieee80211_common.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * IEEE 802.11 driver (80211.o) -- hostapd interface
- * Copyright 2002-2004, Instant802 Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef IEEE80211_COMMON_H
-#define IEEE80211_COMMON_H
-
-#include <linux/types.h>
-
-/*
- * This is common header information with user space. It is used on all
- * frames sent to wlan#ap interface.
- */
-
-#define IEEE80211_FI_VERSION 0x80211001
-
-struct ieee80211_frame_info {
- __be32 version;
- __be32 length;
- __be64 mactime;
- __be64 hosttime;
- __be32 phytype;
- __be32 channel;
- __be32 datarate;
- __be32 antenna;
- __be32 priority;
- __be32 ssi_type;
- __be32 ssi_signal;
- __be32 ssi_noise;
- __be32 preamble;
- __be32 encoding;
-
- /* Note: this structure is otherwise identical to capture format used
- * in linux-wlan-ng, but this additional field is used to provide meta
- * data about the frame to hostapd. This was the easiest method for
- * providing this information, but this might change in the future. */
- __be32 msg_type;
-} __attribute__ ((packed));
-
-
-enum ieee80211_msg_type {
- ieee80211_msg_normal = 0,
- ieee80211_msg_tx_callback_ack = 1,
- ieee80211_msg_tx_callback_fail = 2,
- /* hole at 3, was ieee80211_msg_passive_scan but unused */
- /* hole at 4, was ieee80211_msg_wep_frame_unknown_key but now unused */
- ieee80211_msg_michael_mic_failure = 5,
- /* hole at 6, was monitor but never sent to userspace */
- ieee80211_msg_sta_not_assoc = 7,
- /* 8 was ieee80211_msg_set_aid_for_sta */
- /* 9 was ieee80211_msg_key_threshold_notification */
- /* 11 was ieee80211_msg_radar */
-};
-
-struct ieee80211_msg_key_notification {
- int tx_rx_count;
- char ifname[IFNAMSIZ];
- u8 addr[ETH_ALEN]; /* ff:ff:ff:ff:ff:ff for broadcast keys */
-};
-
-
-enum ieee80211_phytype {
- ieee80211_phytype_fhss_dot11_97 = 1,
- ieee80211_phytype_dsss_dot11_97 = 2,
- ieee80211_phytype_irbaseband = 3,
- ieee80211_phytype_dsss_dot11_b = 4,
- ieee80211_phytype_pbcc_dot11_b = 5,
- ieee80211_phytype_ofdm_dot11_g = 6,
- ieee80211_phytype_pbcc_dot11_g = 7,
- ieee80211_phytype_ofdm_dot11_a = 8,
-};
-
-enum ieee80211_ssi_type {
- ieee80211_ssi_none = 0,
- ieee80211_ssi_norm = 1, /* normalized, 0-1000 */
- ieee80211_ssi_dbm = 2,
- ieee80211_ssi_raw = 3, /* raw SSI */
-};
-
-struct ieee80211_radar_info {
- int channel;
- int radar;
- int radar_type;
-};
-
-#endif /* IEEE80211_COMMON_H */
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 4b4ed2a..b4e32ab 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -230,6 +230,7 @@ struct ieee80211_if_vlan {
#define IEEE80211_STA_AUTO_SSID_SEL BIT(10)
#define IEEE80211_STA_AUTO_BSSID_SEL BIT(11)
#define IEEE80211_STA_AUTO_CHANNEL_SEL BIT(12)
+#define IEEE80211_STA_PRIVACY_INVOKED BIT(13)
struct ieee80211_if_sta {
enum {
IEEE80211_DISABLED, IEEE80211_AUTHENTICATE,
@@ -259,7 +260,6 @@ struct ieee80211_if_sta {
unsigned long request;
struct sk_buff_head skb_queue;
- int key_management_enabled;
unsigned long last_probe;
#define IEEE80211_AUTH_ALG_OPEN BIT(0)
diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c
index 6caa3ec..7027eed 100644
--- a/net/mac80211/ieee80211_ioctl.c
+++ b/net/mac80211/ieee80211_ioctl.c
@@ -917,7 +917,6 @@ static int ieee80211_ioctl_siwauth(struct net_device *dev,
struct iw_request_info *info,
struct iw_param *data, char *extra)
{
- struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
int ret = 0;
@@ -927,18 +926,21 @@ static int ieee80211_ioctl_siwauth(struct net_device *dev,
case IW_AUTH_CIPHER_GROUP:
case IW_AUTH_WPA_ENABLED:
case IW_AUTH_RX_UNENCRYPTED_EAPOL:
- break;
case IW_AUTH_KEY_MGMT:
+ break;
+ case IW_AUTH_PRIVACY_INVOKED:
if (sdata->type != IEEE80211_IF_TYPE_STA)
ret = -EINVAL;
else {
+ sdata->u.sta.flags &= ~IEEE80211_STA_PRIVACY_INVOKED;
/*
- * Key management was set by wpa_supplicant,
- * we only need this to associate to a network
- * that has privacy enabled regardless of not
- * having a key.
+ * Privacy invoked by wpa_supplicant, store the
+ * value and allow associating to a protected
+ * network without having a key up front.
*/
- sdata->u.sta.key_management_enabled = !!data->value;
+ if (data->value)
+ sdata->u.sta.flags |=
+ IEEE80211_STA_PRIVACY_INVOKED;
}
break;
case IW_AUTH_80211_AUTH_ALG:
@@ -948,11 +950,6 @@ static int ieee80211_ioctl_siwauth(struct net_device *dev,
else
ret = -EOPNOTSUPP;
break;
- case IW_AUTH_PRIVACY_INVOKED:
- if (local->ops->set_privacy_invoked)
- ret = local->ops->set_privacy_invoked(
- local_to_hw(local), data->value);
- break;
default:
ret = -EOPNOTSUPP;
break;
diff --git a/net/mac80211/ieee80211_rate.c b/net/mac80211/ieee80211_rate.c
index 93abb8f..7254bd6 100644
--- a/net/mac80211/ieee80211_rate.c
+++ b/net/mac80211/ieee80211_rate.c
@@ -25,13 +25,25 @@ int ieee80211_rate_control_register(struct rate_control_ops *ops)
{
struct rate_control_alg *alg;
+ if (!ops->name)
+ return -EINVAL;
+
+ mutex_lock(&rate_ctrl_mutex);
+ list_for_each_entry(alg, &rate_ctrl_algs, list) {
+ if (!strcmp(alg->ops->name, ops->name)) {
+ /* don't register an algorithm twice */
+ WARN_ON(1);
+ return -EALREADY;
+ }
+ }
+
alg = kzalloc(sizeof(*alg), GFP_KERNEL);
if (alg == NULL) {
+ mutex_unlock(&rate_ctrl_mutex);
return -ENOMEM;
}
alg->ops = ops;
- mutex_lock(&rate_ctrl_mutex);
list_add_tail(&alg->list, &rate_ctrl_algs);
mutex_unlock(&rate_ctrl_mutex);
@@ -61,9 +73,12 @@ ieee80211_try_rate_control_ops_get(const char *name)
struct rate_control_alg *alg;
struct rate_control_ops *ops = NULL;
+ if (!name)
+ return NULL;
+
mutex_lock(&rate_ctrl_mutex);
list_for_each_entry(alg, &rate_ctrl_algs, list) {
- if (!name || !strcmp(alg->ops->name, name))
+ if (!strcmp(alg->ops->name, name))
if (try_module_get(alg->ops->module)) {
ops = alg->ops;
break;
@@ -80,9 +95,12 @@ ieee80211_rate_control_ops_get(const char *name)
{
struct rate_control_ops *ops;
+ if (!name)
+ name = "simple";
+
ops = ieee80211_try_rate_control_ops_get(name);
if (!ops) {
- request_module("rc80211_%s", name ? name : "default");
+ request_module("rc80211_%s", name);
ops = ieee80211_try_rate_control_ops_get(name);
}
return ops;
diff --git a/net/mac80211/ieee80211_rate.h b/net/mac80211/ieee80211_rate.h
index 7cd1eba..2368813 100644
--- a/net/mac80211/ieee80211_rate.h
+++ b/net/mac80211/ieee80211_rate.h
@@ -65,6 +65,9 @@ struct rate_control_ref {
struct kref kref;
};
+/* default 'simple' algorithm */
+extern struct rate_control_ops mac80211_rcsimple;
+
int ieee80211_rate_control_register(struct rate_control_ops *ops);
void ieee80211_rate_control_unregister(struct rate_control_ops *ops);
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index fda0e06..2079e98 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -704,10 +704,11 @@ static int ieee80211_privacy_mismatch(struct net_device *dev,
{
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
struct ieee80211_sta_bss *bss;
- int res = 0;
+ int bss_privacy;
+ int wep_privacy;
+ int privacy_invoked;
- if (!ifsta || (ifsta->flags & IEEE80211_STA_MIXED_CELL) ||
- ifsta->key_management_enabled)
+ if (!ifsta || (ifsta->flags & IEEE80211_STA_MIXED_CELL))
return 0;
bss = ieee80211_rx_bss_get(dev, ifsta->bssid, local->hw.conf.channel,
@@ -715,13 +716,16 @@ static int ieee80211_privacy_mismatch(struct net_device *dev,
if (!bss)
return 0;
- if (ieee80211_sta_wep_configured(dev) !=
- !!(bss->capability & WLAN_CAPABILITY_PRIVACY))
- res = 1;
+ bss_privacy = !!(bss->capability & WLAN_CAPABILITY_PRIVACY);
+ wep_privacy = !!ieee80211_sta_wep_configured(dev);
+ privacy_invoked = !!(ifsta->flags & IEEE80211_STA_PRIVACY_INVOKED);
ieee80211_rx_bss_put(dev, bss);
- return res;
+ if ((bss_privacy == wep_privacy) || (bss_privacy == privacy_invoked))
+ return 0;
+
+ return 1;
}
diff --git a/net/mac80211/rc80211_simple.c b/net/mac80211/rc80211_simple.c
index 314b8de..da72737 100644
--- a/net/mac80211/rc80211_simple.c
+++ b/net/mac80211/rc80211_simple.c
@@ -7,7 +7,6 @@
* published by the Free Software Foundation.
*/
-#include <linux/module.h>
#include <linux/init.h>
#include <linux/netdevice.h>
#include <linux/types.h>
@@ -29,8 +28,6 @@
#define RATE_CONTROL_INTERVAL (HZ / 20)
#define RATE_CONTROL_MIN_TX 10
-MODULE_ALIAS("rc80211_default");
-
static void rate_control_rate_inc(struct ieee80211_local *local,
struct sta_info *sta)
{
@@ -394,8 +391,7 @@ static void rate_control_simple_remove_sta_debugfs(void *priv, void *priv_sta)
}
#endif
-static struct rate_control_ops rate_control_simple = {
- .module = THIS_MODULE,
+struct rate_control_ops mac80211_rcsimple = {
.name = "simple",
.tx_status = rate_control_simple_tx_status,
.get_rate = rate_control_simple_get_rate,
@@ -410,22 +406,3 @@ static struct rate_control_ops rate_control_simple = {
.remove_sta_debugfs = rate_control_simple_remove_sta_debugfs,
#endif
};
-
-
-static int __init rate_control_simple_init(void)
-{
- return ieee80211_rate_control_register(&rate_control_simple);
-}
-
-
-static void __exit rate_control_simple_exit(void)
-{
- ieee80211_rate_control_unregister(&rate_control_simple);
-}
-
-
-subsys_initcall(rate_control_simple_init);
-module_exit(rate_control_simple_exit);
-
-MODULE_DESCRIPTION("Simple rate control algorithm for ieee80211");
-MODULE_LICENSE("GPL");
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index ece7776..428a9fc 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -509,9 +509,11 @@ ieee80211_rx_h_decrypt(struct ieee80211_txrx_data *rx)
rx->key->tx_rx_count++;
/* TODO: add threshold stuff again */
} else {
+#ifdef CONFIG_MAC80211_DEBUG
if (net_ratelimit())
printk(KERN_DEBUG "%s: RX protected frame,"
" but have no key\n", rx->dev->name);
+#endif /* CONFIG_MAC80211_DEBUG */
return TXRX_DROP;
}
diff --git a/net/mac80211/wep.c b/net/mac80211/wep.c
index a84a233..9bf0e1c 100644
--- a/net/mac80211/wep.c
+++ b/net/mac80211/wep.c
@@ -314,9 +314,11 @@ ieee80211_crypto_wep_decrypt(struct ieee80211_txrx_data *rx)
if (!(rx->u.rx.status->flag & RX_FLAG_DECRYPTED)) {
if (ieee80211_wep_decrypt(rx->local, rx->skb, rx->key)) {
+#ifdef CONFIG_MAC80211_DEBUG
if (net_ratelimit())
printk(KERN_DEBUG "%s: RX WEP frame, decrypt "
"failed\n", rx->dev->name);
+#endif /* CONFIG_MAC80211_DEBUG */
return TXRX_DROP;
}
} else if (!(rx->u.rx.status->flag & RX_FLAG_IV_STRIPPED)) {
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c
index 6695efb..20cec1c 100644
--- a/net/mac80211/wpa.c
+++ b/net/mac80211/wpa.c
@@ -323,9 +323,12 @@ ieee80211_crypto_tkip_decrypt(struct ieee80211_txrx_data *rx)
&rx->u.rx.tkip_iv32,
&rx->u.rx.tkip_iv16);
if (res != TKIP_DECRYPT_OK || wpa_test) {
- printk(KERN_DEBUG "%s: TKIP decrypt failed for RX frame from "
- "%s (res=%d)\n",
- rx->dev->name, print_mac(mac, rx->sta->addr), res);
+#ifdef CONFIG_MAC80211_DEBUG
+ if (net_ratelimit())
+ printk(KERN_DEBUG "%s: TKIP decrypt failed for RX "
+ "frame from %s (res=%d)\n", rx->dev->name,
+ print_mac(mac, rx->sta->addr), res);
+#endif /* CONFIG_MAC80211_DEBUG */
return TXRX_DROP;
}
@@ -594,9 +597,12 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_txrx_data *rx)
skb->data + hdrlen + CCMP_HDR_LEN, data_len,
skb->data + skb->len - CCMP_MIC_LEN,
skb->data + hdrlen + CCMP_HDR_LEN)) {
- printk(KERN_DEBUG "%s: CCMP decrypt failed for RX "
- "frame from %s\n", rx->dev->name,
- print_mac(mac, rx->sta->addr));
+#ifdef CONFIG_MAC80211_DEBUG
+ if (net_ratelimit())
+ printk(KERN_DEBUG "%s: CCMP decrypt failed "
+ "for RX frame from %s\n", rx->dev->name,
+ print_mac(mac, rx->sta->addr));
+#endif /* CONFIG_MAC80211_DEBUG */
return TXRX_DROP;
}
}
diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c
index 51d151c..73d60a3 100644
--- a/net/rfkill/rfkill.c
+++ b/net/rfkill/rfkill.c
@@ -27,6 +27,10 @@
#include <linux/mutex.h>
#include <linux/rfkill.h>
+/* Get declaration of rfkill_switch_all() to shut up sparse. */
+#include "rfkill-input.h"
+
+
MODULE_AUTHOR("Ivo van Doorn <IvDoorn@gmail.com>");
MODULE_VERSION("1.0");
MODULE_DESCRIPTION("RF switch support");
@@ -276,21 +280,17 @@ static struct class rfkill_class = {
static int rfkill_add_switch(struct rfkill *rfkill)
{
- int retval;
-
- retval = mutex_lock_interruptible(&rfkill_mutex);
- if (retval)
- return retval;
+ int error;
- retval = rfkill_toggle_radio(rfkill, rfkill_states[rfkill->type]);
- if (retval)
- goto out;
+ mutex_lock(&rfkill_mutex);
- list_add_tail(&rfkill->node, &rfkill_list);
+ error = rfkill_toggle_radio(rfkill, rfkill_states[rfkill->type]);
+ if (!error)
+ list_add_tail(&rfkill->node, &rfkill_list);
- out:
mutex_unlock(&rfkill_mutex);
- return retval;
+
+ return error;
}
static void rfkill_remove_switch(struct rfkill *rfkill)
@@ -387,20 +387,23 @@ int rfkill_register(struct rfkill *rfkill)
if (!rfkill->toggle_radio)
return -EINVAL;
+ if (rfkill->type >= RFKILL_TYPE_MAX)
+ return -EINVAL;
+
+ snprintf(dev->bus_id, sizeof(dev->bus_id),
+ "rfkill%ld", (long)atomic_inc_return(&rfkill_no) - 1);
+
+ rfkill_led_trigger_register(rfkill);
error = rfkill_add_switch(rfkill);
if (error)
return error;
- snprintf(dev->bus_id, sizeof(dev->bus_id),
- "rfkill%ld", (long)atomic_inc_return(&rfkill_no) - 1);
-
error = device_add(dev);
if (error) {
rfkill_remove_switch(rfkill);
return error;
}
- rfkill_led_trigger_register(rfkill);
return 0;
}
@@ -416,9 +419,9 @@ EXPORT_SYMBOL(rfkill_register);
*/
void rfkill_unregister(struct rfkill *rfkill)
{
- rfkill_led_trigger_unregister(rfkill);
device_del(&rfkill->dev);
rfkill_remove_switch(rfkill);
+ rfkill_led_trigger_unregister(rfkill);
put_device(&rfkill->dev);
}
EXPORT_SYMBOL(rfkill_unregister);
@@ -448,5 +451,5 @@ static void __exit rfkill_exit(void)
class_unregister(&rfkill_class);
}
-module_init(rfkill_init);
+subsys_initcall(rfkill_init);
module_exit(rfkill_exit);
--
John W. Linville
linville@tuxdriver.com
^ permalink raw reply related
* Re: [PATCH 1/2] NET: Re-add VLAN tag for devices incapable of keeping it
From: Patrick McHardy @ 2007-11-06 23:55 UTC (permalink / raw)
To: Krzysztof Halasa
Cc: David Miller, djohnson+linux-kernel, jes, mchan, ram.vepa,
linux-kernel, netdev, bguo
In-Reply-To: <m3y7db45ga.fsf@maximus.localdomain>
Krzysztof Halasa wrote:
> Patrick McHardy <kaber@trash.net> writes:
>
>> I think there is one more case that matters, which is briding
>> from a device with VLAN stripping for a VLAN not configured
>> locally. The tag will be stripped and will be lost for forwarded
>> packets.
>
> I think we should drop such packets on RX. Anyway we shouldn't
> forward them.
I believe you misunderstand the configuration I was thinking about:
eth0.1000 br0
| |
eth0 with VLAN stripping
Its slightly different that I thought though, __vlan_hwaccel_rx
drops packets for unknown vids, so as soon as you configure a VLAN
locally on the same device that is used for a bridge, no VLAN
packets will be forwarded at all.
Slightly inconsistent with how other layered devices work, but
can be avoided by adding the VLAN to br0.
^ permalink raw reply
* Re: netfilter: nf_conntrack_ipv4 does not show nf_nat as a user
From: Patrick McHardy @ 2007-11-06 23:51 UTC (permalink / raw)
To: Chuck Ebbert; +Cc: Netdev
In-Reply-To: <4730C094.4070406@redhat.com>
Chuck Ebbert wrote:
> On 11/05/2007 07:12 PM, Patrick McHardy wrote:
>> Chuck Ebbert wrote:
>>> https://bugzilla.redhat.com/show_bug.cgi?id=333481#c3
>>>
>>> This is netfilter kernel problem. There is a usage count for the
>>> conntrack_ipv4
>>> module from the nf_nat module, which is not reported by lsmod.
>>>
>> This is "fixed" in the current kernel.
>
> By this hack?
>
> [NETFILTER]: Fix/improve deadlock condition on module removal netfilter
Thats not really a hack, the patch is fully correct, the bug was in
modutils.
The patch I'm talking about is 591e6206:
[NETFILTER]: nf_nat: add symbolic dependency on IPv4 conntrack
^ permalink raw reply
* Re: [PATCH 01/02] r8169: add PCI ID for the 8168 in the Abit Fatal1ty F-190HD motherboard
From: Stephen Hemminger @ 2007-11-06 23:20 UTC (permalink / raw)
To: Francois Romieu
Cc: jgarzik, netdev, Andrew Morton, Edward Hsu, Ciaran McCreesh
In-Reply-To: <20071106231908.GB18076@electric-eye.fr.zoreil.com>
On Wed, 7 Nov 2007 00:19:08 +0100
Francois Romieu <romieu@fr.zoreil.com> wrote:
> Stephen Hemminger <shemminger@linux-foundation.org> :
> [...]
> > Really, vendor_id is 1 ?
>
> Yes, the bug seems to be commonly set in hardware.
>
> > How about a comment about which board this is.
>
> B3w4r3 0f Th3 3v1l Fatal1ty M0b0 ?
>
> Imho 'git log/blame' will provide enough information for this hack.
>
0k F1ne
--
Stephen Hemminger <shemminger@linux-foundation.org>
^ permalink raw reply
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