Commit 434f8122 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/davem/net-2.5

into home.osdl.org:/home/torvalds/v2.5/linux
parents 3656b384 2d7b2832
......@@ -20,7 +20,16 @@
static spinlock_t limit_lock = SPIN_LOCK_UNLOCKED;
#define CREDITS_PER_JIFFY 128
#define MAX_CPJ (0xFFFFFFFF / (HZ*60*60*24))
#define _POW2_BELOW2(x) ((x)|((x)>>1))
#define _POW2_BELOW4(x) (_POW2_BELOW2(x)|_POW2_BELOW2((x)>>2))
#define _POW2_BELOW8(x) (_POW2_BELOW4(x)|_POW2_BELOW4((x)>>4))
#define _POW2_BELOW16(x) (_POW2_BELOW8(x)|_POW2_BELOW8((x)>>8))
#define _POW2_BELOW32(x) (_POW2_BELOW16(x)|_POW2_BELOW16((x)>>16))
#define POW2_BELOW32(x) ((_POW2_BELOW32(x)>>1) + 1)
#define CREDITS_PER_JIFFY POW2_BELOW32(MAX_CPJ)
static int ebt_limit_match(const struct sk_buff *skb,
const struct net_device *in, const struct net_device *out,
......@@ -68,7 +77,7 @@ static int ebt_limit_check(const char *tablename, unsigned int hookmask,
/* Check for overflow. */
if (info->burst == 0 ||
user2credits(info->avg * info->burst) < user2credits(info->avg)) {
printk("Overflow in ebt_limit: %u/%u\n",
printk("Overflow in ebt_limit, try lower: %u/%u\n",
info->avg, info->burst);
return -EINVAL;
}
......
......@@ -1276,6 +1276,10 @@ static void *arp_get_idx(struct seq_file *seq, loff_t pos)
static void *arp_seq_start(struct seq_file *seq, loff_t *pos)
{
struct arp_iter_state* state = seq->private;
state->is_pneigh = 0;
state->bucket = 0;
return *pos ? arp_get_idx(seq, *pos - 1) : SEQ_START_TOKEN;
}
......@@ -1399,7 +1403,6 @@ static int arp_seq_open(struct inode *inode, struct file *file)
seq = file->private_data;
seq->private = s;
memset(s, 0, sizeof(*s));
out:
return rc;
out_kfree:
......
......@@ -421,7 +421,8 @@ get_unique_tuple(struct ip_conntrack_tuple *tuple,
*tuple = ((struct ip_conntrack_tuple)
{ *manip, orig_tuple->dst });
DEBUGP("get_unique_tuple: Found current src map\n");
return 1;
if (!ip_nat_used_tuple(tuple, conntrack))
return 1;
}
}
......
......@@ -581,15 +581,14 @@ static struct notifier_block ipq_nl_notifier = {
.notifier_call = ipq_rcv_nl_event,
};
static int sysctl_maxlen = IPQ_QMAX_DEFAULT;
static struct ctl_table_header *ipq_sysctl_header;
static ctl_table ipq_table[] = {
{
.ctl_name = NET_IPQ_QMAX,
.procname = NET_IPQ_QMAX_NAME,
.data = &sysctl_maxlen,
.maxlen = sizeof(sysctl_maxlen),
.data = &queue_maxlen,
.maxlen = sizeof(queue_maxlen),
.mode = 0644,
.proc_handler = proc_dointvec
},
......
......@@ -584,15 +584,14 @@ static struct notifier_block ipq_nl_notifier = {
.notifier_call = ipq_rcv_nl_event,
};
static int sysctl_maxlen = IPQ_QMAX_DEFAULT;
static struct ctl_table_header *ipq_sysctl_header;
static ctl_table ipq_table[] = {
{
.ctl_name = NET_IPQ_QMAX,
.procname = NET_IPQ_QMAX_NAME,
.data = &sysctl_maxlen,
.maxlen = sizeof(sysctl_maxlen),
.data = &queue_maxlen,
.maxlen = sizeof(queue_maxlen),
.mode = 0644,
.proc_handler = proc_dointvec
},
......
......@@ -188,8 +188,10 @@ static void irda_connect_confirm(void *instance, void *sap,
IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self);
sk = self->sk;
if (sk == NULL)
if (sk == NULL) {
dev_kfree_skb(skb);
return;
}
dev_kfree_skb(skb);
// Should be ??? skb_queue_tail(&sk->sk_receive_queue, skb);
......@@ -248,8 +250,10 @@ static void irda_connect_indication(void *instance, void *sap,
IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self);
sk = self->sk;
if (sk == NULL)
if (sk == NULL) {
dev_kfree_skb(skb);
return;
}
/* How much header space do we need to reserve */
self->max_header_size = max_header_size;
......
......@@ -1812,6 +1812,7 @@ static void *irlmp_seq_start(struct seq_file *seq, loff_t *pos)
void *v;
loff_t off = *pos;
iter->hashbin = NULL;
if (off-- == 0)
return LSAP_START_TOKEN;
......@@ -1950,7 +1951,6 @@ static int irlmp_seq_open(struct inode *inode, struct file *file)
seq = file->private_data;
seq->private = s;
memset(s, 0, sizeof(*s));
out:
return rc;
out_kfree:
......
......@@ -394,6 +394,7 @@ static int netlink_getname(struct socket *sock, struct sockaddr *addr, int *addr
struct sockaddr_nl *nladdr=(struct sockaddr_nl *)addr;
nladdr->nl_family = AF_NETLINK;
nladdr->nl_pad = 0;
*addr_len = sizeof(*nladdr);
if (peer) {
......@@ -717,6 +718,7 @@ static int netlink_recvmsg(struct kiocb *kiocb, struct socket *sock,
if (msg->msg_name) {
struct sockaddr_nl *addr = (struct sockaddr_nl*)msg->msg_name;
addr->nl_family = AF_NETLINK;
addr->nl_pad = 0;
addr->nl_pid = NETLINK_CB(skb).pid;
addr->nl_groups = NETLINK_CB(skb).dst_groups;
msg->msg_namelen = sizeof(*addr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment