Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78087
b: refs/heads/master
c: 0148894
h: refs/heads/master
i:
  78085: 4be1ee1
  78083: 3d28826
  78079: c5974ca
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed Jan 28, 2008
1 parent 201fcdd commit 57ca414
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b24b8a247ff65c01b252025926fe564209fae4fc
refs/heads/master: 0148894223740da4818d7f4e6f92cbb5481a25b8
3 changes: 2 additions & 1 deletion trunk/net/ipv6/ip6_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,8 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
inet->cork.length = 0;
sk->sk_sndmsg_page = NULL;
sk->sk_sndmsg_off = 0;
exthdrlen = rt->u.dst.header_len + (opt ? opt->opt_flen : 0);
exthdrlen = rt->u.dst.header_len + (opt ? opt->opt_flen : 0) -
rt->u.dst.nfheader_len;
length += exthdrlen;
transhdrlen += exthdrlen;
} else {
Expand Down
26 changes: 4 additions & 22 deletions trunk/net/ipv6/xfrm6_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,24 +102,6 @@ __xfrm6_bundle_addr_local(struct xfrm_state *x, struct in6_addr *addr)
(struct in6_addr*)&x->props.saddr;
}

static inline void
__xfrm6_bundle_len_inc(int *len, int *nflen, struct xfrm_state *x)
{
if (x->type->flags & XFRM_TYPE_NON_FRAGMENT)
*nflen += x->props.header_len;
else
*len += x->props.header_len;
}

static inline void
__xfrm6_bundle_len_dec(int *len, int *nflen, struct xfrm_state *x)
{
if (x->type->flags & XFRM_TYPE_NON_FRAGMENT)
*nflen -= x->props.header_len;
else
*len -= x->props.header_len;
}

/* Allocate chain of dst_entry's, attach known xfrm's, calculate
* all the metrics... Shortly, bundle a bundle.
*/
Expand All @@ -142,7 +124,6 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
int i;
int err = 0;
int header_len = 0;
int nfheader_len = 0;
int trailer_len = 0;

dst = dst_prev = NULL;
Expand Down Expand Up @@ -175,7 +156,9 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
dst1->next = dst_prev;
dst_prev = dst1;

__xfrm6_bundle_len_inc(&header_len, &nfheader_len, xfrm[i]);
if (xfrm[i]->type->flags & XFRM_TYPE_NON_FRAGMENT)
dst->nfheader_len += xfrm[i]->props.header_len;
header_len += xfrm[i]->props.header_len;
trailer_len += xfrm[i]->props.trailer_len;

if (xfrm[i]->props.mode != XFRM_MODE_TRANSPORT) {
Expand Down Expand Up @@ -223,7 +206,6 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
dst_prev->flags |= DST_HOST;
dst_prev->lastuse = jiffies;
dst_prev->header_len = header_len;
dst_prev->nfheader_len = nfheader_len;
dst_prev->trailer_len = trailer_len;
memcpy(&dst_prev->metrics, &x->route->metrics, sizeof(dst_prev->metrics));

Expand All @@ -242,7 +224,7 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
x->u.rt6.rt6i_src = rt0->rt6i_src;
x->u.rt6.rt6i_idev = rt0->rt6i_idev;
in6_dev_hold(rt0->rt6i_idev);
__xfrm6_bundle_len_dec(&header_len, &nfheader_len, x->u.dst.xfrm);
header_len -= x->u.dst.xfrm->props.header_len;
trailer_len -= x->u.dst.xfrm->props.trailer_len;
}

Expand Down

0 comments on commit 57ca414

Please sign in to comment.