Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 34567
b: refs/heads/master
c: 99505a8
h: refs/heads/master
i:
  34565: a1b2526
  34563: 3d99190
  34559: e8c2e9d
v: v3
  • Loading branch information
Masahide NAKAMURA authored and David S. Miller committed Sep 22, 2006
1 parent b6c7cdd commit c2c910a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 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: 9e51fd371a022318c5b64b831c43026e89bc4f75
refs/heads/master: 99505a843673faeae962a8cde128c7c034ba6b5e
2 changes: 2 additions & 0 deletions trunk/include/net/xfrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ struct xfrm_type
int (*input)(struct xfrm_state *, struct sk_buff *skb);
int (*output)(struct xfrm_state *, struct sk_buff *pskb);
int (*hdr_offset)(struct xfrm_state *, struct sk_buff *, u8 **);
xfrm_address_t *(*local_addr)(struct xfrm_state *, xfrm_address_t *);
xfrm_address_t *(*remote_addr)(struct xfrm_state *, xfrm_address_t *);
/* Estimate maximal size of result of transformation of a dgram */
u32 (*get_max_size)(struct xfrm_state *, int size);
};
Expand Down
20 changes: 18 additions & 2 deletions trunk/net/ipv6/xfrm6_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,22 @@ __xfrm6_find_bundle(struct flowi *fl, struct xfrm_policy *policy)
return dst;
}

static inline struct in6_addr*
__xfrm6_bundle_addr_remote(struct xfrm_state *x, struct in6_addr *addr)
{
return (x->type->remote_addr) ?
(struct in6_addr*)x->type->remote_addr(x, (xfrm_address_t *)addr) :
(struct in6_addr*)&x->id.daddr;
}

static inline struct in6_addr*
__xfrm6_bundle_addr_local(struct xfrm_state *x, struct in6_addr *addr)
{
return (x->type->local_addr) ?
(struct in6_addr*)x->type->local_addr(x, (xfrm_address_t *)addr) :
(struct in6_addr*)&x->props.saddr;
}

/* Allocate chain of dst_entry's, attach known xfrm's, calculate
* all the metrics... Shortly, bundle a bundle.
*/
Expand Down Expand Up @@ -115,8 +131,8 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
dst1->next = dst_prev;
dst_prev = dst1;
if (xfrm[i]->props.mode != XFRM_MODE_TRANSPORT) {
remote = (struct in6_addr*)&xfrm[i]->id.daddr;
local = (struct in6_addr*)&xfrm[i]->props.saddr;
remote = __xfrm6_bundle_addr_remote(xfrm[i], remote);
local = __xfrm6_bundle_addr_local(xfrm[i], local);
tunnel = 1;
}
header_len += xfrm[i]->props.header_len;
Expand Down

0 comments on commit c2c910a

Please sign in to comment.