* Re: [PATCH net-next] drivers/scsi: Remove warnings after vsprintf %pV introduction
From: David Miller @ 2010-07-11 6:10 UTC (permalink / raw)
To: joe
Cc: sfr, netdev, linux-next, linux-kernel, gregkh, James.Bottomley,
matthew, linux-scsi
In-Reply-To: <1278824921.1501.37.camel@Joe-Laptop.home>
From: Joe Perches <joe@perches.com>
Date: Sat, 10 Jul 2010 22:08:41 -0700
> On Sat, 2010-07-10 at 19:52 -0700, David Miller wrote:
>> Could you take a stab at this and the other scsi bits that
>> trigger this warning?
>
> Remove warnings introduced by conversions of dev_<level>
> macros to functions.
>
> Compile tested only.
>
> Signed-off-by: Joe Perches <joe@perches.com>
SCSI folks, the background is that we have moved the dev_*() printk
macros to external functions, so that the prefixing printf strings
don't get emitting at every call site.
As a consequence, dev_*() calls that try to use an empty string as the
printf format emit a warning from gcc since an empty constant string
is not a valid printf format.
That's what this change is all about.
Anyways:
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply
* Re: [PATCH] inet, inet6: make tcp_sendmsg() and tcp_sendpage() through inet_sendmsg() and inet_sendpage()
From: David Miller @ 2010-07-11 6:07 UTC (permalink / raw)
To: dm; +Cc: xiaosuo, kuznet, pekkas, jmorris, yoshfuji, kaber, therbert,
netdev
In-Reply-To: <4C394C5E.2000805@chelsio.com>
From: Dimitris Michailidis <dm@chelsio.com>
Date: Sat, 10 Jul 2010 21:45:18 -0700
> Changli Gao wrote:
>
>> diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
>> index 3ceb025..1e5bad1 100644
>> --- a/net/ipv4/af_inet.c
>> +++ b/net/ipv4/af_inet.c
>> @@ -727,28 +727,31 @@ int inet_sendmsg(struct kiocb *iocb, struct
>> socket *sock, struct msghdr *msg,
>> sock_rps_record_flow(sk);
>> /* We may need to bind the socket. */
>> - if (!inet_sk(sk)->inet_num && inet_autobind(sk))
>> + if (!sk->sk_prot->no_autobind &&
>> + !inet_sk(sk)->inet_num && inet_autobind(sk))
>> return -EAGAIN;
>
> I think it's better to test inet_num first since usually it's not 0.
> With the above ordering protocols with no_autobind==false end up
> making two comparisons.
Agreed, Changli please make this change.
Thanky ou.
^ permalink raw reply
* Re: [PATCH] tproxy: nf_tproxy_assign_sock() can handle tw sockets
From: Avi Kivity @ 2010-07-11 5:19 UTC (permalink / raw)
To: Eric Dumazet
Cc: Felipe W Damasio, David Miller, Patrick McHardy, linux-kernel,
netdev
In-Reply-To: <1278742649.2538.17.camel@edumazet-laptop>
On 07/10/2010 09:17 AM, Eric Dumazet wrote:
>
> Strange thing with your crash report is CR2 value, with unexpected value
> of 000000000b388000 while RAX value is dce8dce85d415d41
>
> Faulting instruction is :
>
> 48 83 b8 b0 00 00 00 00 cmpq $0x0,0xb0(%rax)
>
> So I would have expected CR2 being RAX+0xb0, but its not.
>
Nothing strange about it. You only get page faults and valid cr2 for
canonical addresses (17 high order bits all equal). In this case
rax+0xb0 is not a canonical address, so you got a general protection
fault instead, with cr2 unchanged.
--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
^ permalink raw reply
* [PATCH net-next] drivers/scsi: Remove warnings after vsprintf %pV introduction
From: Joe Perches @ 2010-07-11 5:08 UTC (permalink / raw)
To: David Miller
Cc: sfr, netdev, linux-next, linux-kernel, gregkh,
James E.J. Bottomley, Matthew Wilcox, linux-scsi
In-Reply-To: <20100710.195210.200371025.davem@davemloft.net>
On Sat, 2010-07-10 at 19:52 -0700, David Miller wrote:
> Could you take a stab at this and the other scsi bits that
> trigger this warning?
Remove warnings introduced by conversions of dev_<level>
macros to functions.
Compile tested only.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/scsi/constants.c | 63 ++++++++++++++++++++---------------
drivers/scsi/sd.c | 6 ++--
drivers/scsi/sym53c8xx_2/sym_hipd.c | 10 ++---
3 files changed, 43 insertions(+), 36 deletions(-)
diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c
index cd05e04..f95de51 100644
--- a/drivers/scsi/constants.c
+++ b/drivers/scsi/constants.c
@@ -1226,29 +1226,38 @@ scsi_extd_sense_format(unsigned char asc, unsigned char ascq) {
}
EXPORT_SYMBOL(scsi_extd_sense_format);
+static void scsi_show_extd_sense_args(const char *fmt, ...)
+{
+ va_list args;
+ struct va_format vaf;
+
+ va_start(args, fmt);
+
+ vaf.fmt = fmt;
+ vaf.va = &args;
+
+ printk(KERN_CONT "Add. Sense: %pV\n", &vaf);
+
+ va_end(args);
+}
+
void
scsi_show_extd_sense(unsigned char asc, unsigned char ascq)
{
const char *extd_sense_fmt = scsi_extd_sense_format(asc, ascq);
if (extd_sense_fmt) {
- if (strstr(extd_sense_fmt, "%x")) {
- printk("Add. Sense: ");
- printk(extd_sense_fmt, ascq);
- } else
- printk("Add. Sense: %s", extd_sense_fmt);
+ scsi_show_extd_sense_args(extd_sense_fmt, ascq);
} else {
if (asc >= 0x80)
- printk("<<vendor>> ASC=0x%x ASCQ=0x%x", asc,
- ascq);
+ printk(KERN_CONT "<<vendor>> ASC=0x%x ASCQ=0x%x",
+ asc, ascq);
if (ascq >= 0x80)
- printk("ASC=0x%x <<vendor>> ASCQ=0x%x", asc,
- ascq);
+ printk(KERN_CONT "ASC=0x%x <<vendor>> ASCQ=0x%x\n",
+ asc, ascq);
else
- printk("ASC=0x%x ASCQ=0x%x", asc, ascq);
+ printk(KERN_CONT "ASC=0x%x ASCQ=0x%x\n", asc, ascq);
}
-
- printk("\n");
}
EXPORT_SYMBOL(scsi_show_extd_sense);
@@ -1310,15 +1319,15 @@ scsi_decode_sense_buffer(const unsigned char *sense_buffer, int sense_len,
if (0 == res) {
/* this may be SCSI-1 sense data */
num = (sense_len < 32) ? sense_len : 32;
- printk("Unrecognized sense data (in hex):");
+ printk(KERN_CONT "Unrecognized sense data (in hex):");
for (k = 0; k < num; ++k) {
if (0 == (k % 16)) {
- printk("\n");
- printk(KERN_INFO " ");
+ printk(KERN_CONT "\n");
+ printk(KERN_INFO " ");
}
- printk("%02x ", sense_buffer[k]);
+ printk(KERN_CONT " %02x", sense_buffer[k]);
}
- printk("\n");
+ printk(KERN_CONT "\n");
return;
}
}
@@ -1364,22 +1373,22 @@ scsi_decode_sense_extras(const unsigned char *sense_buffer, int sense_len,
res += snprintf(buff + res, blen - res, "ILI");
}
if (res > 0)
- printk("%s\n", buff);
+ printk(KERN_CONT "%s\n", buff);
} else if (sshdr->additional_length > 0) {
/* descriptor format with sense descriptors */
num = 8 + sshdr->additional_length;
num = (sense_len < num) ? sense_len : num;
- printk("Descriptor sense data with sense descriptors "
+ printk(KERN_CONT "Descriptor sense data with sense descriptors "
"(in hex):");
for (k = 0; k < num; ++k) {
if (0 == (k % 16)) {
- printk("\n");
- printk(KERN_INFO " ");
+ printk(KERN_CONT "\n");
+ printk(KERN_INFO " ");
}
- printk("%02x ", sense_buffer[k]);
+ printk(KERN_CONT " %02x", sense_buffer[k]);
}
- printk("\n");
+ printk(KERN_CONT "\n");
}
}
@@ -1404,13 +1413,13 @@ void scsi_print_sense(char *name, struct scsi_cmnd *cmd)
{
struct scsi_sense_hdr sshdr;
- scmd_printk(KERN_INFO, cmd, "");
+ scmd_printk(KERN_INFO, cmd, " ");
scsi_decode_sense_buffer(cmd->sense_buffer, SCSI_SENSE_BUFFERSIZE,
&sshdr);
scsi_show_sense_hdr(&sshdr);
scsi_decode_sense_extras(cmd->sense_buffer, SCSI_SENSE_BUFFERSIZE,
&sshdr);
- scmd_printk(KERN_INFO, cmd, "");
+ scmd_printk(KERN_INFO, cmd, " ");
scsi_show_extd_sense(sshdr.asc, sshdr.ascq);
}
EXPORT_SYMBOL(scsi_print_sense);
@@ -1443,7 +1452,7 @@ void scsi_show_result(int result)
void scsi_show_result(int result)
{
- printk("Result: hostbyte=0x%02x driverbyte=0x%02x\n",
+ printk(KERN_CONT "Result: hostbyte=0x%02x driverbyte=0x%02x\n",
host_byte(result), driver_byte(result));
}
@@ -1453,7 +1462,7 @@ EXPORT_SYMBOL(scsi_show_result);
void scsi_print_result(struct scsi_cmnd *cmd)
{
- scmd_printk(KERN_INFO, cmd, "");
+ scmd_printk(KERN_INFO, cmd, " ");
scsi_show_result(cmd->result);
}
EXPORT_SYMBOL(scsi_print_result);
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 829cc37..2fddadd 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2550,15 +2550,15 @@ module_exit(exit_sd);
static void sd_print_sense_hdr(struct scsi_disk *sdkp,
struct scsi_sense_hdr *sshdr)
{
- sd_printk(KERN_INFO, sdkp, "");
+ sd_printk(KERN_INFO, sdkp, " ");
scsi_show_sense_hdr(sshdr);
- sd_printk(KERN_INFO, sdkp, "");
+ sd_printk(KERN_INFO, sdkp, " ");
scsi_show_extd_sense(sshdr->asc, sshdr->ascq);
}
static void sd_print_result(struct scsi_disk *sdkp, int result)
{
- sd_printk(KERN_INFO, sdkp, "");
+ sd_printk(KERN_INFO, sdkp, " ");
scsi_show_result(result);
}
diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.c b/drivers/scsi/sym53c8xx_2/sym_hipd.c
index a7bc8b7..d740a5b 100644
--- a/drivers/scsi/sym53c8xx_2/sym_hipd.c
+++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c
@@ -72,10 +72,7 @@ static void sym_printl_hex(u_char *p, int n)
static void sym_print_msg(struct sym_ccb *cp, char *label, u_char *msg)
{
- if (label)
- sym_print_addr(cp->cmd, "%s: ", label);
- else
- sym_print_addr(cp->cmd, "");
+ sym_print_addr(cp->cmd, "%s: ", label);
spi_print_msg(msg);
printf("\n");
@@ -4558,7 +4555,8 @@ static void sym_int_sir(struct sym_hcb *np)
switch (np->msgin [2]) {
case M_X_MODIFY_DP:
if (DEBUG_FLAGS & DEBUG_POINTER)
- sym_print_msg(cp, NULL, np->msgin);
+ sym_print_msg(cp, "extended msg ",
+ np->msgin);
tmp = (np->msgin[3]<<24) + (np->msgin[4]<<16) +
(np->msgin[5]<<8) + (np->msgin[6]);
sym_modify_dp(np, tp, cp, tmp);
@@ -4585,7 +4583,7 @@ static void sym_int_sir(struct sym_hcb *np)
*/
case M_IGN_RESIDUE:
if (DEBUG_FLAGS & DEBUG_POINTER)
- sym_print_msg(cp, NULL, np->msgin);
+ sym_print_msg(cp, "half byte ", np->msgin);
if (cp->host_flags & HF_SENSE)
OUTL_DSP(np, SCRIPTA_BA(np, clrack));
else
^ permalink raw reply related
* Re: [PATCH] inet, inet6: make tcp_sendmsg() and tcp_sendpage() through inet_sendmsg() and inet_sendpage()
From: Dimitris Michailidis @ 2010-07-11 4:45 UTC (permalink / raw)
To: Changli Gao
Cc: David S. Miller, Alexey Kuznetsov, Pekka Savola (ipv6),
James Morris, Hideaki YOSHIFUJI, Patrick McHardy, Tom Herbert,
netdev
In-Reply-To: <1278819894-2861-1-git-send-email-xiaosuo@gmail.com>
Changli Gao wrote:
> diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
> index 3ceb025..1e5bad1 100644
> --- a/net/ipv4/af_inet.c
> +++ b/net/ipv4/af_inet.c
> @@ -727,28 +727,31 @@ int inet_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
> sock_rps_record_flow(sk);
>
> /* We may need to bind the socket. */
> - if (!inet_sk(sk)->inet_num && inet_autobind(sk))
> + if (!sk->sk_prot->no_autobind &&
> + !inet_sk(sk)->inet_num && inet_autobind(sk))
> return -EAGAIN;
I think it's better to test inet_num first since usually it's not 0. With
the above ordering protocols with no_autobind==false end up making two
comparisons.
^ permalink raw reply
* [PATCH] inet, inet6: make tcp_sendmsg() and tcp_sendpage() through inet_sendmsg() and inet_sendpage()
From: Changli Gao @ 2010-07-11 3:44 UTC (permalink / raw)
To: David S. Miller
Cc: Alexey Kuznetsov, Pekka Savola (ipv6), James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, Tom Herbert, netdev,
Changli Gao
inet, inet6: make tcp_sendmsg() and tcp_sendpage() through inet_sendmsg() and
inet_sendpage()
a new boolean flag no_autobind is added to structure proto to avoid the autobind
calls when the protocol is TCP. Then sock_rps_record_flow() is called int the
TCP's sendmsg() and sendpage() pathes.
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
----
include/net/inet_common.h | 53 +++++++++++++++++++---------------------------
include/net/sock.h | 1
include/net/tcp.h | 47 ++++++++++++++++++----------------------
net/ipv4/af_inet.c | 15 +++++++------
net/ipv4/tcp.c | 9 +++----
net/ipv4/tcp_ipv4.c | 3 ++
net/ipv6/af_inet6.c | 8 +++---
net/ipv6/tcp_ipv6.c | 3 ++
8 files changed, 67 insertions(+), 72 deletions(-)
diff --git a/include/net/inet_common.h b/include/net/inet_common.h
index 18c7732..519790e 100644
--- a/include/net/inet_common.h
+++ b/include/net/inet_common.h
@@ -13,37 +13,28 @@ struct sock;
struct sockaddr;
struct socket;
-extern int inet_release(struct socket *sock);
-extern int inet_stream_connect(struct socket *sock,
- struct sockaddr * uaddr,
- int addr_len, int flags);
-extern int inet_dgram_connect(struct socket *sock,
- struct sockaddr * uaddr,
- int addr_len, int flags);
-extern int inet_accept(struct socket *sock,
- struct socket *newsock, int flags);
-extern int inet_sendmsg(struct kiocb *iocb,
- struct socket *sock,
- struct msghdr *msg,
- size_t size);
-extern int inet_shutdown(struct socket *sock, int how);
-extern int inet_listen(struct socket *sock, int backlog);
-
-extern void inet_sock_destruct(struct sock *sk);
-
-extern int inet_bind(struct socket *sock,
- struct sockaddr *uaddr, int addr_len);
-extern int inet_getname(struct socket *sock,
- struct sockaddr *uaddr,
- int *uaddr_len, int peer);
-extern int inet_ioctl(struct socket *sock,
- unsigned int cmd, unsigned long arg);
-
-extern int inet_ctl_sock_create(struct sock **sk,
- unsigned short family,
- unsigned short type,
- unsigned char protocol,
- struct net *net);
+extern int inet_release(struct socket *sock);
+extern int inet_stream_connect(struct socket *sock, struct sockaddr * uaddr,
+ int addr_len, int flags);
+extern int inet_dgram_connect(struct socket *sock, struct sockaddr * uaddr,
+ int addr_len, int flags);
+extern int inet_accept(struct socket *sock, struct socket *newsock, int flags);
+extern int inet_sendmsg(struct kiocb *iocb, struct socket *sock,
+ struct msghdr *msg, size_t size);
+extern int inet_recvmsg(struct kiocb *iocb, struct socket *sock,
+ struct msghdr *msg, size_t size, int flags);
+extern ssize_t inet_sendpage(struct socket *sock, struct page *page, int offset,
+ size_t size, int flags);
+extern int inet_shutdown(struct socket *sock, int how);
+extern int inet_listen(struct socket *sock, int backlog);
+extern void inet_sock_destruct(struct sock *sk);
+extern int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len);
+extern int inet_getname(struct socket *sock, struct sockaddr *uaddr,
+ int *uaddr_len, int peer);
+extern int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
+extern int inet_ctl_sock_create(struct sock **sk, unsigned short family,
+ unsigned short type, unsigned char protocol,
+ struct net *net);
static inline void inet_ctl_sock_destroy(struct sock *sk)
{
diff --git a/include/net/sock.h b/include/net/sock.h
index 4f26f2f..3100e71 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -772,6 +772,7 @@ struct proto {
int *sysctl_wmem;
int *sysctl_rmem;
int max_header;
+ bool no_autobind;
struct kmem_cache *slab;
unsigned int obj_size;
diff --git a/include/net/tcp.h b/include/net/tcp.h
index c2f96c2..dd72895 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -296,45 +296,40 @@ extern struct proto tcp_prot;
#define TCP_ADD_STATS_USER(net, field, val) SNMP_ADD_STATS_USER((net)->mib.tcp_statistics, field, val)
#define TCP_ADD_STATS(net, field, val) SNMP_ADD_STATS((net)->mib.tcp_statistics, field, val)
-extern void tcp_v4_err(struct sk_buff *skb, u32);
+extern void tcp_v4_err(struct sk_buff *skb, u32);
-extern void tcp_shutdown (struct sock *sk, int how);
+extern void tcp_shutdown (struct sock *sk, int how);
-extern int tcp_v4_rcv(struct sk_buff *skb);
+extern int tcp_v4_rcv(struct sk_buff *skb);
-extern int tcp_v4_remember_stamp(struct sock *sk);
+extern int tcp_v4_remember_stamp(struct sock *sk);
-extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw);
+extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw);
-extern int tcp_sendmsg(struct kiocb *iocb, struct socket *sock,
- struct msghdr *msg, size_t size);
-extern ssize_t tcp_sendpage(struct socket *sock, struct page *page, int offset, size_t size, int flags);
+extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
+ size_t size);
+extern int tcp_sendpage(struct sock *sk, struct page *page, int offset,
+ size_t size, int flags);
-extern int tcp_ioctl(struct sock *sk,
- int cmd,
- unsigned long arg);
+extern int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg);
-extern int tcp_rcv_state_process(struct sock *sk,
- struct sk_buff *skb,
- struct tcphdr *th,
- unsigned len);
+extern int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
+ struct tcphdr *th, unsigned len);
-extern int tcp_rcv_established(struct sock *sk,
- struct sk_buff *skb,
- struct tcphdr *th,
- unsigned len);
+extern int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
+ struct tcphdr *th, unsigned len);
-extern void tcp_rcv_space_adjust(struct sock *sk);
+extern void tcp_rcv_space_adjust(struct sock *sk);
-extern void tcp_cleanup_rbuf(struct sock *sk, int copied);
+extern void tcp_cleanup_rbuf(struct sock *sk, int copied);
-extern int tcp_twsk_unique(struct sock *sk,
- struct sock *sktw, void *twp);
+extern int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp);
-extern void tcp_twsk_destructor(struct sock *sk);
+extern void tcp_twsk_destructor(struct sock *sk);
-extern ssize_t tcp_splice_read(struct socket *sk, loff_t *ppos,
- struct pipe_inode_info *pipe, size_t len, unsigned int flags);
+extern ssize_t tcp_splice_read(struct socket *sk, loff_t *ppos,
+ struct pipe_inode_info *pipe, size_t len,
+ unsigned int flags);
static inline void tcp_dec_quickack_mode(struct sock *sk,
const unsigned int pkts)
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 3ceb025..1e5bad1 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -727,28 +727,31 @@ int inet_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
sock_rps_record_flow(sk);
/* We may need to bind the socket. */
- if (!inet_sk(sk)->inet_num && inet_autobind(sk))
+ if (!sk->sk_prot->no_autobind &&
+ !inet_sk(sk)->inet_num && inet_autobind(sk))
return -EAGAIN;
return sk->sk_prot->sendmsg(iocb, sk, msg, size);
}
EXPORT_SYMBOL(inet_sendmsg);
-static ssize_t inet_sendpage(struct socket *sock, struct page *page, int offset,
- size_t size, int flags)
+ssize_t inet_sendpage(struct socket *sock, struct page *page, int offset,
+ size_t size, int flags)
{
struct sock *sk = sock->sk;
sock_rps_record_flow(sk);
/* We may need to bind the socket. */
- if (!inet_sk(sk)->inet_num && inet_autobind(sk))
+ if (!sk->sk_prot->no_autobind &&
+ !inet_sk(sk)->inet_num && inet_autobind(sk))
return -EAGAIN;
if (sk->sk_prot->sendpage)
return sk->sk_prot->sendpage(sk, page, offset, size, flags);
return sock_no_sendpage(sock, page, offset, size, flags);
}
+EXPORT_SYMBOL(inet_sendpage);
int inet_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
size_t size, int flags)
@@ -894,10 +897,10 @@ const struct proto_ops inet_stream_ops = {
.shutdown = inet_shutdown,
.setsockopt = sock_common_setsockopt,
.getsockopt = sock_common_getsockopt,
- .sendmsg = tcp_sendmsg,
+ .sendmsg = inet_sendmsg,
.recvmsg = inet_recvmsg,
.mmap = sock_no_mmap,
- .sendpage = tcp_sendpage,
+ .sendpage = inet_sendpage,
.splice_read = tcp_splice_read,
#ifdef CONFIG_COMPAT
.compat_setsockopt = compat_sock_common_setsockopt,
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 4e6ddfb..b0e0e7c 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -856,15 +856,15 @@ out_err:
return sk_stream_error(sk, flags, err);
}
-ssize_t tcp_sendpage(struct socket *sock, struct page *page, int offset,
+int tcp_sendpage(struct sock *sk, struct page *page, int offset,
size_t size, int flags)
{
ssize_t res;
- struct sock *sk = sock->sk;
if (!(sk->sk_route_caps & NETIF_F_SG) ||
!(sk->sk_route_caps & NETIF_F_ALL_CSUM))
- return sock_no_sendpage(sock, page, offset, size, flags);
+ return sock_no_sendpage(sk->sk_socket, page, offset, size,
+ flags);
lock_sock(sk);
TCP_CHECK_TIMER(sk);
@@ -897,10 +897,9 @@ static inline int select_size(struct sock *sk, int sg)
return tmp;
}
-int tcp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
+int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
size_t size)
{
- struct sock *sk = sock->sk;
struct iovec *iov;
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *skb;
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 8fa32f5..f7eb3a6 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -2595,6 +2595,8 @@ struct proto tcp_prot = {
.setsockopt = tcp_setsockopt,
.getsockopt = tcp_getsockopt,
.recvmsg = tcp_recvmsg,
+ .sendmsg = tcp_sendmsg,
+ .sendpage = tcp_sendpage,
.backlog_rcv = tcp_v4_do_rcv,
.hash = inet_hash,
.unhash = inet_unhash,
@@ -2613,6 +2615,7 @@ struct proto tcp_prot = {
.twsk_prot = &tcp_timewait_sock_ops,
.rsk_prot = &tcp_request_sock_ops,
.h.hashinfo = &tcp_hashinfo,
+ .no_autobind = true,
#ifdef CONFIG_COMPAT
.compat_setsockopt = compat_tcp_setsockopt,
.compat_getsockopt = compat_tcp_getsockopt,
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index e830cd4..56b9bf2 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -522,10 +522,10 @@ const struct proto_ops inet6_stream_ops = {
.shutdown = inet_shutdown, /* ok */
.setsockopt = sock_common_setsockopt, /* ok */
.getsockopt = sock_common_getsockopt, /* ok */
- .sendmsg = tcp_sendmsg, /* ok */
- .recvmsg = sock_common_recvmsg, /* ok */
+ .sendmsg = inet_sendmsg, /* ok */
+ .recvmsg = inet_recvmsg, /* ok */
.mmap = sock_no_mmap,
- .sendpage = tcp_sendpage,
+ .sendpage = inet_sendpage,
.splice_read = tcp_splice_read,
#ifdef CONFIG_COMPAT
.compat_setsockopt = compat_sock_common_setsockopt,
@@ -549,7 +549,7 @@ const struct proto_ops inet6_dgram_ops = {
.setsockopt = sock_common_setsockopt, /* ok */
.getsockopt = sock_common_getsockopt, /* ok */
.sendmsg = inet_sendmsg, /* ok */
- .recvmsg = sock_common_recvmsg, /* ok */
+ .recvmsg = inet_recvmsg, /* ok */
.mmap = sock_no_mmap,
.sendpage = sock_no_sendpage,
#ifdef CONFIG_COMPAT
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 5ebc27e..fe6d404 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -2142,6 +2142,8 @@ struct proto tcpv6_prot = {
.setsockopt = tcp_setsockopt,
.getsockopt = tcp_getsockopt,
.recvmsg = tcp_recvmsg,
+ .sendmsg = tcp_sendmsg,
+ .sendpage = tcp_sendpage,
.backlog_rcv = tcp_v6_do_rcv,
.hash = tcp_v6_hash,
.unhash = inet_unhash,
@@ -2160,6 +2162,7 @@ struct proto tcpv6_prot = {
.twsk_prot = &tcp6_timewait_sock_ops,
.rsk_prot = &tcp6_request_sock_ops,
.h.hashinfo = &tcp_hashinfo,
+ .no_autobind = true,
#ifdef CONFIG_COMPAT
.compat_setsockopt = compat_tcp_setsockopt,
.compat_getsockopt = compat_tcp_getsockopt,
^ permalink raw reply related
* Re: [PATCH kernel 2.6.35-rc3-git7] axnet_cs: use spin_lock_irqsave in ax_interrupt
From: Ben Hutchings @ 2010-07-11 3:12 UTC (permalink / raw)
To: David Miller; +Cc: ken_kawasaki, netdev
In-Reply-To: <20100710.194928.116377282.davem@davemloft.net>
On Sat, 2010-07-10 at 19:49 -0700, David Miller wrote:
> From: Ben Hutchings <bhutchings@solarflare.com>
> Date: Sun, 11 Jul 2010 03:46:28 +0100
>
> > On Sat, 2010-07-10 at 20:18 +0900, Ken Kawasaki wrote:
> >> axnet_cs:
> >> use spin_lock_irqsave instead of spin_lock in ax_interrupt
> > [...]
> >
> > I assume this is because it's now called from ei_watchdog() and not only
> > from interrupt context. Perhaps you should explain that in the commit
> > message.
>
> No, interrupt handlers in general may not assume that interrupts
> are off or on when they are invoked.
>
> Therefore they must use irqflags saving/restoring.
But an interrupt handler will not be called recursively for the same
IRQ. Since this device only uses one IRQ, surely it was OK to use
spin_lock() in this function so long as it was only called from the
interrupt handler.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH] tproxy: nf_tproxy_assign_sock() can handle tw sockets
From: Felipe W Damasio @ 2010-07-11 3:11 UTC (permalink / raw)
To: David Miller; +Cc: eric.dumazet, kaber, linux-kernel, netdev
In-Reply-To: <20100710.123011.260095467.davem@davemloft.net>
Hi Mr. Miller,
2010/7/10 David Miller <davem@davemloft.net>:
> It could be corruption from elsewhere. Those last four hex
> digits (0x5d415d41) are "]A]A" in ascii, but that could just
> be coincidence.
What do you mean "from elsewhere"? You mean elsewhere on the network code?
Since the function that had the problem was tcp_recvmsg and we're
talking about a squid process, we're either talking about a typical
webserver-objet response, or about about an incorrect/faulty http
request from the user.
Like I told Mr. Dumazet, since on the squid logs I got a:
2010/07/08 14:51:10| clientTryParseRequest: FD 6088
(187.16.240.122:2035) Invalid Request
Only a second before the bug entry on syslog, I suppose that this
invalid request caused the problem (more like a guess, really).
If you think there's a way I can help reproduce/trigger and fix this
bug, please let me know, since the production machine is down until I
can ensure my bosses that this particular crash won't happen again.
Thanks,
Felipe Damasio
^ permalink raw reply
* Re: linux-next: build warning after merge of the net tree
From: David Miller @ 2010-07-11 2:52 UTC (permalink / raw)
To: joe; +Cc: sfr, netdev, linux-next, linux-kernel, gregkh
In-Reply-To: <1278562423.1712.43.camel@Joe-Laptop>
From: Joe Perches <joe@perches.com>
Date: Wed, 07 Jul 2010 21:13:42 -0700
> On Wed, 2010-07-07 at 18:18 -0700, David Miller wrote:
>> It looks like there are just a hand-ful of cases, so maybe we can tweak
>> them by hand. For example, in the sym53c8xx_2 driver bits we can replace
>> the NULL labels passed to sym_print_msg() with a real string and therefore
>> remove the "" case.
>>
>> Joe, any better ideas?
>
> You're right there are just a few cases where dev_info
> is uses as a preface for a hex_dump style display.
>
> Maybe it'd be OK to simply add a trailing space to the
> preface and remove any leading spaces from the subsequent
> initial printks.
>
> dev_info(dev, " ");
That might work.
The sym53c8xx_2 doesn't even need this, like I said, you could
just remove the NULL 'label' argument cases and then have that
bit cured.
Could you take a stab at this and the other scsi bits that
trigger this warning?
Thanks Joe!
^ permalink raw reply
* Re: [PATCH kernel 2.6.35-rc3-git7] axnet_cs: use spin_lock_irqsave in ax_interrupt
From: David Miller @ 2010-07-11 2:49 UTC (permalink / raw)
To: bhutchings; +Cc: ken_kawasaki, netdev
In-Reply-To: <1278816388.6139.10.camel@localhost>
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Sun, 11 Jul 2010 03:46:28 +0100
> On Sat, 2010-07-10 at 20:18 +0900, Ken Kawasaki wrote:
>> axnet_cs:
>> use spin_lock_irqsave instead of spin_lock in ax_interrupt
> [...]
>
> I assume this is because it's now called from ei_watchdog() and not only
> from interrupt context. Perhaps you should explain that in the commit
> message.
No, interrupt handlers in general may not assume that interrupts
are off or on when they are invoked.
Therefore they must use irqflags saving/restoring.
^ permalink raw reply
* Re: [PATCH kernel 2.6.35-rc3-git7] axnet_cs: use spin_lock_irqsave in ax_interrupt
From: Ben Hutchings @ 2010-07-11 2:46 UTC (permalink / raw)
To: Ken Kawasaki; +Cc: netdev
In-Reply-To: <20100710201813.a3e5c79c.ken_kawasaki@spring.nifty.jp>
On Sat, 2010-07-10 at 20:18 +0900, Ken Kawasaki wrote:
> axnet_cs:
> use spin_lock_irqsave instead of spin_lock in ax_interrupt
[...]
I assume this is because it's now called from ei_watchdog() and not only
from interrupt context. Perhaps you should explain that in the commit
message.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH 2/2] 82596: free resources on error
From: David Miller @ 2010-07-11 2:42 UTC (permalink / raw)
To: segooon
Cc: kernel-janitors, jpirko, shemminger, eric.dumazet, andre.goddard,
netdev
In-Reply-To: <1278678340-6889-1-git-send-email-segooon@gmail.com>
From: Kulikov Vasiliy <segooon@gmail.com>
Date: Fri, 9 Jul 2010 16:25:40 +0400
> IRQ 56 was not freed anywhere (neither in i596_open() on error nor in
> i596_close()), rx_bufs were not freed if init_i596_mem() fails,
> netif_stop_queue() was not called.
>
> Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Applied to net-next-2.6
^ permalink raw reply
* Re: [PATCH 1/2] 82596: do not panic on out of memory
From: David Miller @ 2010-07-11 2:42 UTC (permalink / raw)
To: segooon
Cc: kernel-janitors, jpirko, shemminger, eric.dumazet, andre.goddard,
netdev
In-Reply-To: <1278678323-6848-1-git-send-email-segooon@gmail.com>
From: Kulikov Vasiliy <segooon@gmail.com>
Date: Fri, 9 Jul 2010 16:25:22 +0400
> If dev_alloc_skb() failed then free already allocated skbs.
> remove_rx_bufs() can be called multiple times, so set rbd->skb to NULL
> to avoid double free. remove_rx_bufs() was moved upwards to be seen by
> init_rx_bufs().
>
> Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Applied to net-next-2.6
^ permalink raw reply
* Re: [PATCH net-next-2.6] be2net: Patch to determine if function is VF while running in guest OS.
From: David Miller @ 2010-07-11 2:42 UTC (permalink / raw)
To: sarveshwarb; +Cc: netdev
In-Reply-To: <20100709114344.GA2392@serverengines.com>
From: Sarveshwar Bandi <sarveshwarb@serverengines.com>
Date: Fri, 9 Jul 2010 17:13:55 +0530
> When driver is loaded in guest OS, the pci variables is_virtfn and is_physfn are
> both set to 0. This change uses registers in controller to determine the same.
>
> Signed-off-by: Sarveshwar Bandi <sarveshwarb@serverengines.com>
Applied.
^ permalink raw reply
* Re: oops in tcp_xmit_retransmit_queue() w/ v2.6.32.15
From: David Miller @ 2010-07-11 2:36 UTC (permalink / raw)
To: tj; +Cc: linux-kernel, netdev, henning.fehrmann, carsten.aulbert
In-Reply-To: <4C358AAA.9080400@kernel.org>
From: Tejun Heo <tj@kernel.org>
Date: Thu, 08 Jul 2010 10:22:02 +0200
> We've been seeing oops in tcp_xmit_retransmit_queue() w/ 2.6.32.15.
...
> Does anything ring a bell?
A long time ago we had a packet scheduler bug that could corrupt
the TCP socket queues, but that was fixed in 2.6.27 so would
definitely be fixed in your kernel.
--------------------
commit 69747650c814a8a79fef412c7416adf823293a3e
Author: David S. Miller <davem@davemloft.net>
Date: Sun Aug 17 23:55:36 2008 -0700
pkt_sched: Fix return value corruption in HTB and TBF.
Based upon a bug report by Josip Rodin.
Packet schedulers should only return NET_XMIT_DROP iff
the packet really was dropped. If the packet does reach
the device after we return NET_XMIT_DROP then TCP can
crash because it depends upon the enqueue path return
values being accurate.
Signed-off-by: David S. Miller <davem@davemloft.net>
--------------------
Nothing else jumps to mind, sorry.
^ permalink raw reply
* Re: a couple questions about drivers/net/macv*.c
From: Robert P. J. Day @ 2010-07-11 2:31 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20100710.192610.232749731.davem@davemloft.net>
On Sat, 10 Jul 2010, David Miller wrote:
> From: "Robert P. J. Day" <rpjday@crashcourse.ca>
> Date: Sat, 10 Jul 2010 19:44:59 -0400 (EDT)
>
> >
> > first (trivial) point, i notice that both macvlan.c and macvtap.c
> > are still both listed as EXPERIMENTAL -- is that still accurate?
>
> Probably the tag should be removed, a lot of people use this
> facility and it works quite well as far as I can tell.
>
> > bigger issue in macvtap.c -- notice this declaration:
> >
> > static unsigned int macvtap_major;
> >
> > that seems like a violation of coding style since that variable is
> > used later on in:
> >
> > devt = MKDEV(MAJOR(macvtap_major), dev->ifindex);
> > and
> >
> > err = alloc_chrdev_region(&macvtap_major, 0,
> > MACVTAP_NUM_DEVS, "macvtap");
> >
> > where its type should simply be the typedef "dev_t" for transparency,
> > should it not?
>
> Yep, I'll check in the following to net-next-2.6, thanks.
>
> --------------------
> macvtap: Use dev_t for macvtap_major.
>
> Reported-by: "Robert P. J. Day" <rpjday@crashcourse.ca>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
> drivers/net/macvtap.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
> index a8a94e2..2b4d59b 100644
> --- a/drivers/net/macvtap.c
> +++ b/drivers/net/macvtap.c
> @@ -58,7 +58,7 @@ static struct proto macvtap_proto = {
> * only has one tap, the interface numbers assure that the
> * device nodes are unique.
> */
> -static unsigned int macvtap_major;
> +static dev_t macvtap_major;
technically, i would drop the "_major" suffix since that variable
doesn't represent simply the major device number but the entire dev_t
typedef, but that's your call.
rday
--
========================================================================
Robert P. J. Day Waterloo, Ontario, CANADA
Top-notch, inexpensive online Linux/OSS/kernel courses
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
^ permalink raw reply
* Re: a couple questions about drivers/net/macv*.c
From: David Miller @ 2010-07-11 2:26 UTC (permalink / raw)
To: rpjday; +Cc: netdev
In-Reply-To: <alpine.DEB.2.00.1007101652030.7658@lynx>
From: "Robert P. J. Day" <rpjday@crashcourse.ca>
Date: Sat, 10 Jul 2010 19:44:59 -0400 (EDT)
>
> first (trivial) point, i notice that both macvlan.c and macvtap.c
> are still both listed as EXPERIMENTAL -- is that still accurate?
Probably the tag should be removed, a lot of people use this
facility and it works quite well as far as I can tell.
> bigger issue in macvtap.c -- notice this declaration:
>
> static unsigned int macvtap_major;
>
> that seems like a violation of coding style since that variable is
> used later on in:
>
> devt = MKDEV(MAJOR(macvtap_major), dev->ifindex);
> and
>
> err = alloc_chrdev_region(&macvtap_major, 0,
> MACVTAP_NUM_DEVS, "macvtap");
>
> where its type should simply be the typedef "dev_t" for transparency,
> should it not?
Yep, I'll check in the following to net-next-2.6, thanks.
--------------------
macvtap: Use dev_t for macvtap_major.
Reported-by: "Robert P. J. Day" <rpjday@crashcourse.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/macvtap.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index a8a94e2..2b4d59b 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -58,7 +58,7 @@ static struct proto macvtap_proto = {
* only has one tap, the interface numbers assure that the
* device nodes are unique.
*/
-static unsigned int macvtap_major;
+static dev_t macvtap_major;
#define MACVTAP_NUM_DEVS 65536
static struct class *macvtap_class;
static struct cdev macvtap_cdev;
--
1.7.1.1
^ permalink raw reply related
* a couple questions about drivers/net/macv*.c
From: Robert P. J. Day @ 2010-07-10 23:44 UTC (permalink / raw)
To: netdev
first (trivial) point, i notice that both macvlan.c and macvtap.c
are still both listed as EXPERIMENTAL -- is that still accurate?
bigger issue in macvtap.c -- notice this declaration:
static unsigned int macvtap_major;
that seems like a violation of coding style since that variable is
used later on in:
devt = MKDEV(MAJOR(macvtap_major), dev->ifindex);
and
err = alloc_chrdev_region(&macvtap_major, 0,
MACVTAP_NUM_DEVS, "macvtap");
where its type should simply be the typedef "dev_t" for transparency,
should it not? hardcoding that variable as an unsigned int seems like
a bad idea.
rday
--
========================================================================
Robert P. J. Day Waterloo, Ontario, CANADA
Top-notch, inexpensive online Linux/OSS/kernel courses
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
^ permalink raw reply
* Re: [PATCH] bnx2x: add support for receive hashing
From: David Miller @ 2010-07-11 2:12 UTC (permalink / raw)
To: therbert; +Cc: vladz, netdev
In-Reply-To: <AANLkTinRUJS6e8dwqvIMhtAUWBcj5oTk-D9MMrhbL9Bk@mail.gmail.com>
From: Tom Herbert <therbert@google.com>
Date: Wed, 7 Jul 2010 12:17:31 -0700
> It is to enable the device to provide the RSS hash in RX descriptor.
> The hash severs two purposes now, it's used internally in the device
> to perform RSS table lookup and also value in RX descriptor. The
> latter does not require multi-queue. Strictly speaking, on a single
> processor system without multqueue, it would be true that enabling the
> RX hash on bnx2x is currently superfluous (notwithstanding some other
> use of the hash might be implemented).
We intend to use the card provided RSS hash to optimize GSO
flow comparisons at some point.
There are other possible uses as well.
Therefore even in a single RX queue configuration, the driver
should provide the hash if it can.
^ permalink raw reply
* Re: linux-next: Tree for July 6 (NET_DSA + PHYLIB kconfig)
From: David Miller @ 2010-07-11 2:09 UTC (permalink / raw)
To: randy.dunlap; +Cc: sfr, netdev, linux-next, linux-kernel
In-Reply-To: <20100706103417.8923b697.randy.dunlap@oracle.com>
From: Randy Dunlap <randy.dunlap@oracle.com>
Date: Tue, 6 Jul 2010 10:34:17 -0700
> NET_DSA selects PHYLIB. PHYLIB depends on NET_ETHERNET, which is not enabled
> in this randconfig. net/dsa code does need PHYLIB code, so PHYLIB symbol should
> either drop "depends on NET_ETHERNET" or it should be changed to
> depends on NET_ETHERNET || NET_DSA
>
> Preference?
The situations seems to suggest NET_DSA depends upon NET_ETHERNET, so
adding NET_ETHERNET to NET_DSA's dependencies probably works better.
^ permalink raw reply
* [PATCH kernel 2.6.35-rc3-git7] axnet_cs: use spin_lock_irqsave in ax_interrupt
From: Ken Kawasaki @ 2010-07-10 11:18 UTC (permalink / raw)
To: netdev
In-Reply-To: <20100706202243.95319ab4.ken_kawasaki@spring.nifty.jp>
axnet_cs:
use spin_lock_irqsave instead of spin_lock in ax_interrupt
Signed-off-by: Ken Kawasaki <ken_kawasaki@spring.nifty.jp>
---
--- linux-2.6.35-git7/drivers/net/pcmcia/axnet_cs.c.orig 2010-07-04 08:28:15.000000000 +0900
+++ linux-2.6.35-git7/drivers/net/pcmcia/axnet_cs.c 2010-07-10 19:07:20.000000000 +0900
@@ -1168,6 +1168,7 @@ static irqreturn_t ax_interrupt(int irq,
int interrupts, nr_serviced = 0, i;
struct ei_device *ei_local;
int handled = 0;
+ unsigned long flags;
e8390_base = dev->base_addr;
ei_local = netdev_priv(dev);
@@ -1176,7 +1177,7 @@ static irqreturn_t ax_interrupt(int irq,
* Protect the irq test too.
*/
- spin_lock(&ei_local->page_lock);
+ spin_lock_irqsave(&ei_local->page_lock, flags);
if (ei_local->irqlock)
{
@@ -1188,7 +1189,7 @@ static irqreturn_t ax_interrupt(int irq,
dev->name, inb_p(e8390_base + EN0_ISR),
inb_p(e8390_base + EN0_IMR));
#endif
- spin_unlock(&ei_local->page_lock);
+ spin_unlock_irqrestore(&ei_local->page_lock, flags);
return IRQ_NONE;
}
@@ -1261,7 +1262,7 @@ static irqreturn_t ax_interrupt(int irq,
ei_local->irqlock = 0;
outb_p(ENISR_ALL, e8390_base + EN0_IMR);
- spin_unlock(&ei_local->page_lock);
+ spin_unlock_irqrestore(&ei_local->page_lock, flags);
return IRQ_RETVAL(handled);
}
^ permalink raw reply
* Re: [PATCH] sysfs: Don't allow the creation of symlinks we can't remove
From: Maciej W. Rozycki @ 2010-07-10 22:30 UTC (permalink / raw)
To: Eric W. Biederman
Cc: Greg KH, Andrew Morton, Rafael J. Wysocki, Kay Sievers,
Johannes Berg, Greg KH, netdev
In-Reply-To: <m1630q7x5v.fsf_-_@fess.ebiederm.org>
On Thu, 8 Jul 2010, Eric W. Biederman wrote:
> Recently my tagged sysfs support revealed a flaw in the device core
> that a few rare drivers are running into such that we don't always put
> network devices in a class subdirectory named net/.
I've been cc-ed for a reason I suppose -- any network driver I should be
looking into? What's the actual problem?
Maciej
^ permalink raw reply
* [patch] hostap: fixup strlen() math
From: Dan Carpenter @ 2010-07-10 22:10 UTC (permalink / raw)
To: Jouni Malinen
Cc: John W. Linville, Martin Decky, linux-wireless, netdev,
kernel-janitors
In hostap_add_interface() we do:
sprintf(dev->name, "%s%s", prefix, name);
dev->name has IFNAMSIZ (16) characters.
prefix is local->dev->name.
name is "wds%d"
strlen() returns the number of characters in the string not counting the
NULL so if we have a string with 11 characters we get "12345678901wds%d"
which is 16 characters and a NULL so we're past the end of the array.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c
index eb57d1e..f1bc258 100644
--- a/drivers/net/wireless/hostap/hostap_main.c
+++ b/drivers/net/wireless/hostap/hostap_main.c
@@ -186,7 +186,7 @@ int prism2_wds_add(local_info_t *local, u8 *remote_addr,
return -ENOBUFS;
/* verify that there is room for wds# postfix in the interface name */
- if (strlen(local->dev->name) > IFNAMSIZ - 5) {
+ if (strlen(local->dev->name) >= IFNAMSIZ - 5) {
printk(KERN_DEBUG "'%s' too long base device name\n",
local->dev->name);
return -EINVAL;
^ permalink raw reply related
* [PATCH -net-next-2.6] ll_temac: Fix missing validate_addr hook
From: Denis Kirjanov @ 2010-07-10 21:10 UTC (permalink / raw)
To: davem; +Cc: netdev
Fix missing validate_addr hook
Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
---
drivers/net/ll_temac_main.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ll_temac_main.c b/drivers/net/ll_temac_main.c
index 7b12d0e..13d21a3 100644
--- a/drivers/net/ll_temac_main.c
+++ b/drivers/net/ll_temac_main.c
@@ -883,6 +883,7 @@ static const struct net_device_ops temac_netdev_ops = {
.ndo_stop = temac_stop,
.ndo_start_xmit = temac_start_xmit,
.ndo_set_mac_address = netdev_set_mac_address,
+ .ndo_validate_addr = eth_validate_addr,
//.ndo_set_multicast_list = temac_set_multicast_list,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = temac_poll_controller,
--
1.6.4.4
^ permalink raw reply related
* Re: [PATCH] tproxy: nf_tproxy_assign_sock() can handle tw sockets
From: David Miller @ 2010-07-10 19:30 UTC (permalink / raw)
To: eric.dumazet; +Cc: felipewd, kaber, linux-kernel, netdev
In-Reply-To: <1278742649.2538.17.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 10 Jul 2010 08:17:29 +0200
> Strange thing with your crash report is CR2 value, with unexpected value
> of 000000000b388000 while RAX value is dce8dce85d415d41
>
> Faulting instruction is :
>
> 48 83 b8 b0 00 00 00 00 cmpq $0x0,0xb0(%rax)
>
> So I would have expected CR2 being RAX+0xb0, but its not.
It could be corruption from elsewhere. Those last four hex
digits (0x5d415d41) are "]A]A" in ascii, but that could just
be coincidence.
^ 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