Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

This commit is contained in:
Linus Torvalds 2006-02-23 20:40:17 -08:00
commit c0eea79bd2
10 changed files with 28 additions and 18 deletions

View File

@ -57,7 +57,7 @@ struct ifb_private {
struct sk_buff_head tq;
};
static int numifbs = 1;
static int numifbs = 2;
static void ri_tasklet(unsigned long dev);
static int ifb_xmit(struct sk_buff *skb, struct net_device *dev);

View File

@ -403,6 +403,11 @@ unsigned xfrm_spi_hash(xfrm_address_t *addr, u32 spi, u8 proto, unsigned short f
extern void __xfrm_state_destroy(struct xfrm_state *);
static inline void __xfrm_state_put(struct xfrm_state *x)
{
atomic_dec(&x->refcnt);
}
static inline void xfrm_state_put(struct xfrm_state *x)
{
if (atomic_dec_and_test(&x->refcnt))

View File

@ -90,6 +90,7 @@ static struct rtable __fake_rtable = {
.dev = &__fake_net_device,
.path = &__fake_rtable.u.dst,
.metrics = {[RTAX_MTU - 1] = 1500},
.flags = DST_NOXFRM,
}
},
.rt_flags = 0,

View File

@ -95,6 +95,12 @@ int eth_header(struct sk_buff *skb, struct net_device *dev, unsigned short type,
saddr = dev->dev_addr;
memcpy(eth->h_source,saddr,dev->addr_len);
if(daddr)
{
memcpy(eth->h_dest,daddr,dev->addr_len);
return ETH_HLEN;
}
/*
* Anyway, the loopback-device should never use this function...
*/
@ -105,12 +111,6 @@ int eth_header(struct sk_buff *skb, struct net_device *dev, unsigned short type,
return ETH_HLEN;
}
if(daddr)
{
memcpy(eth->h_dest,daddr,dev->addr_len);
return ETH_HLEN;
}
return -ETH_HLEN;
}

View File

@ -835,7 +835,7 @@ static int rt_garbage_collect(void)
int r;
rthp = rt_remove_balanced_route(
&rt_hash_table[i].chain,
&rt_hash_table[k].chain,
rth,
&r);
goal -= r;

View File

@ -35,6 +35,7 @@ __xfrm4_find_bundle(struct flowi *fl, struct xfrm_policy *policy)
if (xdst->u.rt.fl.oif == fl->oif && /*XXX*/
xdst->u.rt.fl.fl4_dst == fl->fl4_dst &&
xdst->u.rt.fl.fl4_src == fl->fl4_src &&
xdst->u.rt.fl.fl4_tos == fl->fl4_tos &&
xfrm_bundle_ok(xdst, fl, AF_INET)) {
dst_clone(dst);
break;
@ -61,7 +62,8 @@ __xfrm4_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
.nl_u = {
.ip4_u = {
.saddr = local,
.daddr = remote
.daddr = remote,
.tos = fl->fl4_tos
}
}
};
@ -230,6 +232,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl)
fl->proto = iph->protocol;
fl->fl4_dst = iph->daddr;
fl->fl4_src = iph->saddr;
fl->fl4_tos = iph->tos;
}
static inline int xfrm4_garbage_collect(void)

View File

@ -1423,7 +1423,7 @@ static int pfkey_add(struct sock *sk, struct sk_buff *skb, struct sadb_msg *hdr,
if (err < 0) {
x->km.state = XFRM_STATE_DEAD;
xfrm_state_put(x);
__xfrm_state_put(x);
goto out;
}

View File

@ -782,7 +782,7 @@ int xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl,
int nx = 0;
int err;
u32 genid;
u16 family = dst_orig->ops->family;
u16 family;
u8 dir = policy_to_flow_dir(XFRM_POLICY_OUT);
u32 sk_sid = security_sk_sid(sk, fl, dir);
restart:
@ -796,13 +796,14 @@ restart:
if ((dst_orig->flags & DST_NOXFRM) || !xfrm_policy_list[XFRM_POLICY_OUT])
return 0;
policy = flow_cache_lookup(fl, sk_sid, family, dir,
xfrm_policy_lookup);
policy = flow_cache_lookup(fl, sk_sid, dst_orig->ops->family,
dir, xfrm_policy_lookup);
}
if (!policy)
return 0;
family = dst_orig->ops->family;
policy->curlft.use_time = (unsigned long)xtime.tv_sec;
switch (policy->action) {

View File

@ -220,14 +220,14 @@ static int __xfrm_state_delete(struct xfrm_state *x)
x->km.state = XFRM_STATE_DEAD;
spin_lock(&xfrm_state_lock);
list_del(&x->bydst);
atomic_dec(&x->refcnt);
__xfrm_state_put(x);
if (x->id.spi) {
list_del(&x->byspi);
atomic_dec(&x->refcnt);
__xfrm_state_put(x);
}
spin_unlock(&xfrm_state_lock);
if (del_timer(&x->timer))
atomic_dec(&x->refcnt);
__xfrm_state_put(x);
/* The number two in this test is the reference
* mentioned in the comment below plus the reference
@ -243,7 +243,7 @@ static int __xfrm_state_delete(struct xfrm_state *x)
* The xfrm_state_alloc call gives a reference, and that
* is what we are dropping here.
*/
atomic_dec(&x->refcnt);
__xfrm_state_put(x);
err = 0;
}

View File

@ -345,7 +345,7 @@ static int xfrm_add_sa(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma)
if (err < 0) {
x->km.state = XFRM_STATE_DEAD;
xfrm_state_put(x);
__xfrm_state_put(x);
goto out;
}