Commit 49ac163b authored by David S. Miller's avatar David S. Miller

Merge nuts.ninka.net:/disk1/davem/BK/network-2.5

into nuts.ninka.net:/disk1/davem/BK/net-2.5
parents 01d259fe 57bcaf82
......@@ -511,7 +511,11 @@ extern struct net_device *__dev_get_by_flags(unsigned short flags,
unsigned short mask);
extern struct net_device *dev_get_by_name(const char *name);
extern struct net_device *__dev_get_by_name(const char *name);
extern struct net_device *dev_alloc(const char *name, int *err);
extern struct net_device *__dev_alloc(const char *name, int *err);
static inline __deprecated struct net_device *dev_alloc(const char *name, int *err)
{
return __dev_alloc(name, err);
}
extern int dev_alloc_name(struct net_device *dev, const char *name);
extern int dev_open(struct net_device *dev);
extern int dev_close(struct net_device *dev);
......
......@@ -175,7 +175,7 @@ static int ebt_among_check(const char *tablename, unsigned int hookmask,
if (datalen != EBT_ALIGN(expected_length)) {
printk(KERN_WARNING
"ebtables: among: wrong size: %d"
"against expected %d, rounded to %d\n",
"against expected %d, rounded to %Zd\n",
datalen, expected_length,
EBT_ALIGN(expected_length));
return -EINVAL;
......
......@@ -646,11 +646,12 @@ int dev_alloc_name(struct net_device *dev, const char *name)
* failed. The cause of an error is returned as a negative errno code
* in the variable @err points to.
*
* The caller must hold the @dev_base or RTNL locks when doing this in
* This call is deprecated in favor of alloc_netdev because
* the caller must hold the @dev_base or RTNL locks when doing this in
* order to avoid duplicate name allocations.
*/
struct net_device *dev_alloc(const char *name, int *err)
struct net_device *__dev_alloc(const char *name, int *err)
{
struct net_device *dev = kmalloc(sizeof(*dev), GFP_KERNEL);
......@@ -2997,7 +2998,7 @@ EXPORT_SYMBOL(__dev_remove_pack);
EXPORT_SYMBOL(__skb_linearize);
EXPORT_SYMBOL(call_netdevice_notifiers);
EXPORT_SYMBOL(dev_add_pack);
EXPORT_SYMBOL(dev_alloc);
EXPORT_SYMBOL(__dev_alloc);
EXPORT_SYMBOL(dev_alloc_name);
EXPORT_SYMBOL(dev_close);
EXPORT_SYMBOL(dev_get_by_flags);
......
......@@ -37,6 +37,7 @@
#include <net/arp.h>
#include <net/checksum.h>
#include <net/inet_ecn.h>
#include <net/xfrm.h>
#ifdef CONFIG_IPV6
#include <net/ipv6.h>
......@@ -600,6 +601,9 @@ int ipgre_rcv(struct sk_buff *skb)
read_lock(&ipgre_lock);
if ((tunnel = ipgre_tunnel_lookup(iph->saddr, iph->daddr, key)) != NULL) {
secpath_put(skb->sp);
skb->sp = NULL;
skb->mac.raw = skb->nh.raw;
skb->nh.raw = __pskb_pull(skb, offset);
memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
......
......@@ -493,7 +493,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
goto slow_path;
/* Correct socket ownership. */
if (frag->sk == NULL)
if (frag->sk == NULL && skb->sk)
goto slow_path;
/* Partially cloned skb? */
......
......@@ -483,6 +483,9 @@ static int ipip_rcv(struct sk_buff *skb)
return 0;
}
secpath_put(skb->sp);
skb->sp = NULL;
skb->mac.raw = skb->nh.raw;
skb->nh.raw = skb->data;
memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
......
......@@ -2145,7 +2145,6 @@ static void *listening_get_first(struct seq_file *seq)
if (!sk)
continue;
++st->num;
if (sk->sk_family == st->family) {
rc = sk;
goto out;
......@@ -2159,7 +2158,7 @@ static void *listening_get_first(struct seq_file *seq)
for (st->sbucket = 0; st->sbucket < TCP_SYNQ_HSIZE;
++st->sbucket) {
for (req = tp->listen_opt->syn_table[st->sbucket];
req; req = req->dl_next, ++st->num) {
req; req = req->dl_next) {
if (req->class->family != st->family)
continue;
rc = req;
......@@ -2181,6 +2180,8 @@ static void *listening_get_next(struct seq_file *seq, void *cur)
struct sock *sk = cur;
struct tcp_iter_state* st = seq->private;
++st->num;
if (st->state == TCP_SEQ_STATE_OPENREQ) {
struct open_request *req = cur;
......@@ -2188,7 +2189,6 @@ static void *listening_get_next(struct seq_file *seq, void *cur)
req = req->dl_next;
while (1) {
while (req) {
++st->num;
if (req->class->family == st->family) {
cur = req;
goto out;
......@@ -2235,10 +2235,11 @@ static void *listening_get_idx(struct seq_file *seq, loff_t *pos)
{
void *rc = listening_get_first(seq);
if (rc)
while (*pos && (rc = listening_get_next(seq, rc)))
--*pos;
return *pos ? NULL : rc;
while (rc && *pos) {
rc = listening_get_next(seq, rc);
--*pos;
}
return rc;
}
static void *established_get_first(struct seq_file *seq)
......@@ -2254,7 +2255,6 @@ static void *established_get_first(struct seq_file *seq)
read_lock(&tcp_ehash[st->bucket].lock);
sk_for_each(sk, node, &tcp_ehash[st->bucket].chain) {
if (sk->sk_family != st->family) {
++st->num;
continue;
}
rc = sk;
......@@ -2264,7 +2264,6 @@ static void *established_get_first(struct seq_file *seq)
tw_for_each(tw, node,
&tcp_ehash[st->bucket + tcp_ehash_size].chain) {
if (tw->tw_family != st->family) {
++st->num;
continue;
}
rc = tw;
......@@ -2284,12 +2283,13 @@ static void *established_get_next(struct seq_file *seq, void *cur)
struct hlist_node *node;
struct tcp_iter_state* st = seq->private;
++st->num;
if (st->state == TCP_SEQ_STATE_TIME_WAIT) {
tw = cur;
tw = tw_next(tw);
get_tw:
while (tw && tw->tw_family != st->family) {
++st->num;
tw = tw_next(tw);
}
if (tw) {
......@@ -2311,7 +2311,6 @@ static void *established_get_next(struct seq_file *seq, void *cur)
sk_for_each_from(sk, node) {
if (sk->sk_family == st->family)
goto found;
++st->num;
}
st->state = TCP_SEQ_STATE_TIME_WAIT;
......@@ -2327,10 +2326,11 @@ static void *established_get_idx(struct seq_file *seq, loff_t pos)
{
void *rc = established_get_first(seq);
if (rc)
while (pos && (rc = established_get_next(seq, rc)))
--pos;
return pos ? NULL : rc;
while (rc && pos) {
rc = established_get_next(seq, rc);
--pos;
}
return rc;
}
static void *tcp_get_idx(struct seq_file *seq, loff_t pos)
......@@ -2354,6 +2354,8 @@ static void *tcp_get_idx(struct seq_file *seq, loff_t pos)
static void *tcp_seq_start(struct seq_file *seq, loff_t *pos)
{
struct tcp_iter_state* st = seq->private;
st->num = 0;
return *pos ? tcp_get_idx(seq, *pos - 1) : SEQ_START_TOKEN;
}
......
......@@ -47,6 +47,7 @@
#include <net/ip6_route.h>
#include <net/addrconf.h>
#include <net/ip6_tunnel.h>
#include <net/xfrm.h>
MODULE_AUTHOR("Ville Nuorvala");
MODULE_DESCRIPTION("IPv6-in-IPv6 tunnel");
......@@ -514,6 +515,8 @@ int ip6ip6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
read_unlock(&ip6ip6_lock);
goto discard;
}
secpath_put(skb->sp);
skb->sp = NULL;
skb->mac.raw = skb->nh.raw;
skb->nh.raw = skb->data;
skb->protocol = htons(ETH_P_IPV6);
......
......@@ -49,6 +49,7 @@
#include <net/icmp.h>
#include <net/ipip.h>
#include <net/inet_ecn.h>
#include <net/xfrm.h>
/*
This version of net/ipv6/sit.c is cloned of net/ipv4/ip_gre.c
......@@ -376,6 +377,8 @@ static int ipip6_rcv(struct sk_buff *skb)
read_lock(&ipip6_lock);
if ((tunnel = ipip6_tunnel_lookup(iph->saddr, iph->daddr)) != NULL) {
secpath_put(skb->sp);
skb->sp = NULL;
skb->mac.raw = skb->nh.raw;
skb->nh.raw = skb->data;
memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
......
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