diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-02-27 11:33:51 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-02-27 11:33:51 -0500 |
commit | dbfedbb98145375106cee7ec7269611d553819dc (patch) | |
tree | 81d2a6de51b1bb3c704e5385dbc90ca79efa69bc /net | |
parent | 7b0386921db20add25afd8678ed34a9253e512fc (diff) | |
parent | e95a9ec1bb66e07b138861c743192f06e7b3e4de (diff) |
Merge branch 'master'
Diffstat (limited to 'net')
-rw-r--r-- | net/bridge/br_netfilter.c | 1 | ||||
-rw-r--r-- | net/ethernet/eth.c | 12 | ||||
-rw-r--r-- | net/ipv4/route.c | 2 | ||||
-rw-r--r-- | net/ipv4/xfrm4_policy.c | 5 | ||||
-rw-r--r-- | net/ipv6/ip6_output.c | 15 | ||||
-rw-r--r-- | net/ipv6/ip6_tunnel.c | 1 | ||||
-rw-r--r-- | net/key/af_key.c | 2 | ||||
-rw-r--r-- | net/xfrm/xfrm_policy.c | 7 | ||||
-rw-r--r-- | net/xfrm/xfrm_state.c | 8 | ||||
-rw-r--r-- | net/xfrm/xfrm_user.c | 2 |
10 files changed, 36 insertions, 19 deletions
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c index 6bb0c7eb1ef0..e060aad8624d 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c | |||
@@ -90,6 +90,7 @@ static struct rtable __fake_rtable = { | |||
90 | .dev = &__fake_net_device, | 90 | .dev = &__fake_net_device, |
91 | .path = &__fake_rtable.u.dst, | 91 | .path = &__fake_rtable.u.dst, |
92 | .metrics = {[RTAX_MTU - 1] = 1500}, | 92 | .metrics = {[RTAX_MTU - 1] = 1500}, |
93 | .flags = DST_NOXFRM, | ||
93 | } | 94 | } |
94 | }, | 95 | }, |
95 | .rt_flags = 0, | 96 | .rt_flags = 0, |
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c index 9890fd97e538..c971f14712ec 100644 --- a/net/ethernet/eth.c +++ b/net/ethernet/eth.c | |||
@@ -95,6 +95,12 @@ int eth_header(struct sk_buff *skb, struct net_device *dev, unsigned short type, | |||
95 | saddr = dev->dev_addr; | 95 | saddr = dev->dev_addr; |
96 | memcpy(eth->h_source,saddr,dev->addr_len); | 96 | memcpy(eth->h_source,saddr,dev->addr_len); |
97 | 97 | ||
98 | if(daddr) | ||
99 | { | ||
100 | memcpy(eth->h_dest,daddr,dev->addr_len); | ||
101 | return ETH_HLEN; | ||
102 | } | ||
103 | |||
98 | /* | 104 | /* |
99 | * Anyway, the loopback-device should never use this function... | 105 | * Anyway, the loopback-device should never use this function... |
100 | */ | 106 | */ |
@@ -105,12 +111,6 @@ int eth_header(struct sk_buff *skb, struct net_device *dev, unsigned short type, | |||
105 | return ETH_HLEN; | 111 | return ETH_HLEN; |
106 | } | 112 | } |
107 | 113 | ||
108 | if(daddr) | ||
109 | { | ||
110 | memcpy(eth->h_dest,daddr,dev->addr_len); | ||
111 | return ETH_HLEN; | ||
112 | } | ||
113 | |||
114 | return -ETH_HLEN; | 114 | return -ETH_HLEN; |
115 | } | 115 | } |
116 | 116 | ||
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index d82c242ea704..fca5fe0cf94a 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -835,7 +835,7 @@ static int rt_garbage_collect(void) | |||
835 | int r; | 835 | int r; |
836 | 836 | ||
837 | rthp = rt_remove_balanced_route( | 837 | rthp = rt_remove_balanced_route( |
838 | &rt_hash_table[i].chain, | 838 | &rt_hash_table[k].chain, |
839 | rth, | 839 | rth, |
840 | &r); | 840 | &r); |
841 | goal -= r; | 841 | goal -= r; |
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c index 45f7ae58f2c0..f285bbf296e2 100644 --- a/net/ipv4/xfrm4_policy.c +++ b/net/ipv4/xfrm4_policy.c | |||
@@ -35,6 +35,7 @@ __xfrm4_find_bundle(struct flowi *fl, struct xfrm_policy *policy) | |||
35 | if (xdst->u.rt.fl.oif == fl->oif && /*XXX*/ | 35 | if (xdst->u.rt.fl.oif == fl->oif && /*XXX*/ |
36 | xdst->u.rt.fl.fl4_dst == fl->fl4_dst && | 36 | xdst->u.rt.fl.fl4_dst == fl->fl4_dst && |
37 | xdst->u.rt.fl.fl4_src == fl->fl4_src && | 37 | xdst->u.rt.fl.fl4_src == fl->fl4_src && |
38 | xdst->u.rt.fl.fl4_tos == fl->fl4_tos && | ||
38 | xfrm_bundle_ok(xdst, fl, AF_INET)) { | 39 | xfrm_bundle_ok(xdst, fl, AF_INET)) { |
39 | dst_clone(dst); | 40 | dst_clone(dst); |
40 | break; | 41 | break; |
@@ -61,7 +62,8 @@ __xfrm4_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int | |||
61 | .nl_u = { | 62 | .nl_u = { |
62 | .ip4_u = { | 63 | .ip4_u = { |
63 | .saddr = local, | 64 | .saddr = local, |
64 | .daddr = remote | 65 | .daddr = remote, |
66 | .tos = fl->fl4_tos | ||
65 | } | 67 | } |
66 | } | 68 | } |
67 | }; | 69 | }; |
@@ -230,6 +232,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl) | |||
230 | fl->proto = iph->protocol; | 232 | fl->proto = iph->protocol; |
231 | fl->fl4_dst = iph->daddr; | 233 | fl->fl4_dst = iph->daddr; |
232 | fl->fl4_src = iph->saddr; | 234 | fl->fl4_src = iph->saddr; |
235 | fl->fl4_tos = iph->tos; | ||
233 | } | 236 | } |
234 | 237 | ||
235 | static inline int xfrm4_garbage_collect(void) | 238 | static inline int xfrm4_garbage_collect(void) |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index efa3e72cfcfa..f999edd846a9 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -494,6 +494,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) | |||
494 | struct net_device *dev; | 494 | struct net_device *dev; |
495 | struct sk_buff *frag; | 495 | struct sk_buff *frag; |
496 | struct rt6_info *rt = (struct rt6_info*)skb->dst; | 496 | struct rt6_info *rt = (struct rt6_info*)skb->dst; |
497 | struct ipv6_pinfo *np = skb->sk ? inet6_sk(skb->sk) : NULL; | ||
497 | struct ipv6hdr *tmp_hdr; | 498 | struct ipv6hdr *tmp_hdr; |
498 | struct frag_hdr *fh; | 499 | struct frag_hdr *fh; |
499 | unsigned int mtu, hlen, left, len; | 500 | unsigned int mtu, hlen, left, len; |
@@ -505,7 +506,12 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) | |||
505 | hlen = ip6_find_1stfragopt(skb, &prevhdr); | 506 | hlen = ip6_find_1stfragopt(skb, &prevhdr); |
506 | nexthdr = *prevhdr; | 507 | nexthdr = *prevhdr; |
507 | 508 | ||
508 | mtu = dst_mtu(&rt->u.dst) - hlen - sizeof(struct frag_hdr); | 509 | mtu = dst_mtu(&rt->u.dst); |
510 | if (np && np->frag_size < mtu) { | ||
511 | if (np->frag_size) | ||
512 | mtu = np->frag_size; | ||
513 | } | ||
514 | mtu -= hlen + sizeof(struct frag_hdr); | ||
509 | 515 | ||
510 | if (skb_shinfo(skb)->frag_list) { | 516 | if (skb_shinfo(skb)->frag_list) { |
511 | int first_len = skb_pagelen(skb); | 517 | int first_len = skb_pagelen(skb); |
@@ -882,7 +888,12 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, | |||
882 | inet->cork.fl = *fl; | 888 | inet->cork.fl = *fl; |
883 | np->cork.hop_limit = hlimit; | 889 | np->cork.hop_limit = hlimit; |
884 | np->cork.tclass = tclass; | 890 | np->cork.tclass = tclass; |
885 | inet->cork.fragsize = mtu = dst_mtu(rt->u.dst.path); | 891 | mtu = dst_mtu(rt->u.dst.path); |
892 | if (np && np->frag_size < mtu) { | ||
893 | if (np->frag_size) | ||
894 | mtu = np->frag_size; | ||
895 | } | ||
896 | inet->cork.fragsize = mtu; | ||
886 | if (dst_allfrag(rt->u.dst.path)) | 897 | if (dst_allfrag(rt->u.dst.path)) |
887 | inet->cork.flags |= IPCORK_ALLFRAG; | 898 | inet->cork.flags |= IPCORK_ALLFRAG; |
888 | inet->cork.length = 0; | 899 | inet->cork.length = 0; |
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index faea8a120ee2..48597538db3f 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
@@ -884,6 +884,7 @@ ip6ip6_tnl_change(struct ip6_tnl *t, struct ip6_tnl_parm *p) | |||
884 | t->parms.encap_limit = p->encap_limit; | 884 | t->parms.encap_limit = p->encap_limit; |
885 | t->parms.flowinfo = p->flowinfo; | 885 | t->parms.flowinfo = p->flowinfo; |
886 | t->parms.link = p->link; | 886 | t->parms.link = p->link; |
887 | ip6_tnl_dst_reset(t); | ||
887 | ip6ip6_tnl_link_config(t); | 888 | ip6ip6_tnl_link_config(t); |
888 | return 0; | 889 | return 0; |
889 | } | 890 | } |
diff --git a/net/key/af_key.c b/net/key/af_key.c index ae86d237a456..b2d4d1dd2116 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c | |||
@@ -1423,7 +1423,7 @@ static int pfkey_add(struct sock *sk, struct sk_buff *skb, struct sadb_msg *hdr, | |||
1423 | 1423 | ||
1424 | if (err < 0) { | 1424 | if (err < 0) { |
1425 | x->km.state = XFRM_STATE_DEAD; | 1425 | x->km.state = XFRM_STATE_DEAD; |
1426 | xfrm_state_put(x); | 1426 | __xfrm_state_put(x); |
1427 | goto out; | 1427 | goto out; |
1428 | } | 1428 | } |
1429 | 1429 | ||
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 5e6b05ac1260..8206025d8e46 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -782,7 +782,7 @@ int xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl, | |||
782 | int nx = 0; | 782 | int nx = 0; |
783 | int err; | 783 | int err; |
784 | u32 genid; | 784 | u32 genid; |
785 | u16 family = dst_orig->ops->family; | 785 | u16 family; |
786 | u8 dir = policy_to_flow_dir(XFRM_POLICY_OUT); | 786 | u8 dir = policy_to_flow_dir(XFRM_POLICY_OUT); |
787 | u32 sk_sid = security_sk_sid(sk, fl, dir); | 787 | u32 sk_sid = security_sk_sid(sk, fl, dir); |
788 | restart: | 788 | restart: |
@@ -796,13 +796,14 @@ restart: | |||
796 | if ((dst_orig->flags & DST_NOXFRM) || !xfrm_policy_list[XFRM_POLICY_OUT]) | 796 | if ((dst_orig->flags & DST_NOXFRM) || !xfrm_policy_list[XFRM_POLICY_OUT]) |
797 | return 0; | 797 | return 0; |
798 | 798 | ||
799 | policy = flow_cache_lookup(fl, sk_sid, family, dir, | 799 | policy = flow_cache_lookup(fl, sk_sid, dst_orig->ops->family, |
800 | xfrm_policy_lookup); | 800 | dir, xfrm_policy_lookup); |
801 | } | 801 | } |
802 | 802 | ||
803 | if (!policy) | 803 | if (!policy) |
804 | return 0; | 804 | return 0; |
805 | 805 | ||
806 | family = dst_orig->ops->family; | ||
806 | policy->curlft.use_time = (unsigned long)xtime.tv_sec; | 807 | policy->curlft.use_time = (unsigned long)xtime.tv_sec; |
807 | 808 | ||
808 | switch (policy->action) { | 809 | switch (policy->action) { |
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index e12d0be5f976..c656cbaf35e8 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
@@ -220,14 +220,14 @@ static int __xfrm_state_delete(struct xfrm_state *x) | |||
220 | x->km.state = XFRM_STATE_DEAD; | 220 | x->km.state = XFRM_STATE_DEAD; |
221 | spin_lock(&xfrm_state_lock); | 221 | spin_lock(&xfrm_state_lock); |
222 | list_del(&x->bydst); | 222 | list_del(&x->bydst); |
223 | atomic_dec(&x->refcnt); | 223 | __xfrm_state_put(x); |
224 | if (x->id.spi) { | 224 | if (x->id.spi) { |
225 | list_del(&x->byspi); | 225 | list_del(&x->byspi); |
226 | atomic_dec(&x->refcnt); | 226 | __xfrm_state_put(x); |
227 | } | 227 | } |
228 | spin_unlock(&xfrm_state_lock); | 228 | spin_unlock(&xfrm_state_lock); |
229 | if (del_timer(&x->timer)) | 229 | if (del_timer(&x->timer)) |
230 | atomic_dec(&x->refcnt); | 230 | __xfrm_state_put(x); |
231 | 231 | ||
232 | /* The number two in this test is the reference | 232 | /* The number two in this test is the reference |
233 | * mentioned in the comment below plus the reference | 233 | * mentioned in the comment below plus the reference |
@@ -243,7 +243,7 @@ static int __xfrm_state_delete(struct xfrm_state *x) | |||
243 | * The xfrm_state_alloc call gives a reference, and that | 243 | * The xfrm_state_alloc call gives a reference, and that |
244 | * is what we are dropping here. | 244 | * is what we are dropping here. |
245 | */ | 245 | */ |
246 | atomic_dec(&x->refcnt); | 246 | __xfrm_state_put(x); |
247 | err = 0; | 247 | err = 0; |
248 | } | 248 | } |
249 | 249 | ||
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index ac87a09ba83e..7de17559249a 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -345,7 +345,7 @@ static int xfrm_add_sa(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma) | |||
345 | 345 | ||
346 | if (err < 0) { | 346 | if (err < 0) { |
347 | x->km.state = XFRM_STATE_DEAD; | 347 | x->km.state = XFRM_STATE_DEAD; |
348 | xfrm_state_put(x); | 348 | __xfrm_state_put(x); |
349 | goto out; | 349 | goto out; |
350 | } | 350 | } |
351 | 351 | ||