mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-08 07:38:10 +00:00
xfrm: remove init_path indirection from afinfo_policy
handle this directly, its only used by ipv6. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
This commit is contained in:
parent
f24ea52873
commit
2e8b4aa816
4 changed files with 7 additions and 38 deletions
|
@ -329,9 +329,6 @@ struct xfrm_policy_afinfo {
|
||||||
void (*decode_session)(struct sk_buff *skb,
|
void (*decode_session)(struct sk_buff *skb,
|
||||||
struct flowi *fl,
|
struct flowi *fl,
|
||||||
int reverse);
|
int reverse);
|
||||||
int (*init_path)(struct xfrm_dst *path,
|
|
||||||
struct dst_entry *dst,
|
|
||||||
int nfheader_len);
|
|
||||||
int (*fill_dst)(struct xfrm_dst *xdst,
|
int (*fill_dst)(struct xfrm_dst *xdst,
|
||||||
struct net_device *dev,
|
struct net_device *dev,
|
||||||
const struct flowi *fl);
|
const struct flowi *fl);
|
||||||
|
|
|
@ -69,12 +69,6 @@ static int xfrm4_get_saddr(struct net *net, int oif,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int xfrm4_init_path(struct xfrm_dst *path, struct dst_entry *dst,
|
|
||||||
int nfheader_len)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int xfrm4_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
|
static int xfrm4_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
|
||||||
const struct flowi *fl)
|
const struct flowi *fl)
|
||||||
{
|
{
|
||||||
|
@ -267,7 +261,6 @@ static const struct xfrm_policy_afinfo xfrm4_policy_afinfo = {
|
||||||
.dst_lookup = xfrm4_dst_lookup,
|
.dst_lookup = xfrm4_dst_lookup,
|
||||||
.get_saddr = xfrm4_get_saddr,
|
.get_saddr = xfrm4_get_saddr,
|
||||||
.decode_session = _decode_session4,
|
.decode_session = _decode_session4,
|
||||||
.init_path = xfrm4_init_path,
|
|
||||||
.fill_dst = xfrm4_fill_dst,
|
.fill_dst = xfrm4_fill_dst,
|
||||||
.blackhole_route = ipv4_blackhole_route,
|
.blackhole_route = ipv4_blackhole_route,
|
||||||
};
|
};
|
||||||
|
|
|
@ -71,19 +71,6 @@ static int xfrm6_get_saddr(struct net *net, int oif,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int xfrm6_init_path(struct xfrm_dst *path, struct dst_entry *dst,
|
|
||||||
int nfheader_len)
|
|
||||||
{
|
|
||||||
if (dst->ops->family == AF_INET6) {
|
|
||||||
struct rt6_info *rt = (struct rt6_info *)dst;
|
|
||||||
path->path_cookie = rt6_get_cookie(rt);
|
|
||||||
}
|
|
||||||
|
|
||||||
path->u.rt6.rt6i_nfheader_len = nfheader_len;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int xfrm6_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
|
static int xfrm6_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
|
||||||
const struct flowi *fl)
|
const struct flowi *fl)
|
||||||
{
|
{
|
||||||
|
@ -287,7 +274,6 @@ static const struct xfrm_policy_afinfo xfrm6_policy_afinfo = {
|
||||||
.dst_lookup = xfrm6_dst_lookup,
|
.dst_lookup = xfrm6_dst_lookup,
|
||||||
.get_saddr = xfrm6_get_saddr,
|
.get_saddr = xfrm6_get_saddr,
|
||||||
.decode_session = _decode_session6,
|
.decode_session = _decode_session6,
|
||||||
.init_path = xfrm6_init_path,
|
|
||||||
.fill_dst = xfrm6_fill_dst,
|
.fill_dst = xfrm6_fill_dst,
|
||||||
.blackhole_route = ip6_blackhole_route,
|
.blackhole_route = ip6_blackhole_route,
|
||||||
};
|
};
|
||||||
|
|
|
@ -2491,21 +2491,14 @@ static inline struct xfrm_dst *xfrm_alloc_dst(struct net *net, int family)
|
||||||
return xdst;
|
return xdst;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int xfrm_init_path(struct xfrm_dst *path, struct dst_entry *dst,
|
static void xfrm_init_path(struct xfrm_dst *path, struct dst_entry *dst,
|
||||||
int nfheader_len)
|
int nfheader_len)
|
||||||
{
|
{
|
||||||
const struct xfrm_policy_afinfo *afinfo =
|
if (dst->ops->family == AF_INET6) {
|
||||||
xfrm_policy_get_afinfo(dst->ops->family);
|
struct rt6_info *rt = (struct rt6_info *)dst;
|
||||||
int err;
|
path->path_cookie = rt6_get_cookie(rt);
|
||||||
|
path->u.rt6.rt6i_nfheader_len = nfheader_len;
|
||||||
if (!afinfo)
|
}
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
err = afinfo->init_path(path, dst, nfheader_len);
|
|
||||||
|
|
||||||
rcu_read_unlock();
|
|
||||||
|
|
||||||
return err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int xfrm_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
|
static inline int xfrm_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
|
||||||
|
|
Loading…
Add table
Reference in a new issue