Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Torvalds committed Feb 24, 2006
2 parents adb9c9a + 35eaa31 commit c0eea79
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 18 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ifb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions include/net/xfrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
1 change: 1 addition & 0 deletions net/bridge/br_netfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions net/ethernet/eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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...
*/
Expand All @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion net/ipv4/xfrm4_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
}
}
};
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion net/key/af_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
7 changes: 4 additions & 3 deletions net/xfrm/xfrm_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -796,13 +796,14 @@ int xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl,
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) {
Expand Down
8 changes: 4 additions & 4 deletions net/xfrm/xfrm_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion net/xfrm/xfrm_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit c0eea79

Please sign in to comment.