|
@@ -2138,7 +2138,7 @@ struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig,
|
|
xfrm_pols_put(pols, drop_pols);
|
|
xfrm_pols_put(pols, drop_pols);
|
|
XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTNOSTATES);
|
|
XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTNOSTATES);
|
|
|
|
|
|
- return make_blackhole(net, family, dst_orig);
|
|
|
|
|
|
+ return ERR_PTR(-EREMOTE);
|
|
}
|
|
}
|
|
|
|
|
|
err = -EAGAIN;
|
|
err = -EAGAIN;
|
|
@@ -2195,6 +2195,22 @@ dropdst:
|
|
}
|
|
}
|
|
EXPORT_SYMBOL(xfrm_lookup);
|
|
EXPORT_SYMBOL(xfrm_lookup);
|
|
|
|
|
|
|
|
+/* Callers of xfrm_lookup_route() must ensure a call to dst_output().
|
|
|
|
+ * Otherwise we may send out blackholed packets.
|
|
|
|
+ */
|
|
|
|
+struct dst_entry *xfrm_lookup_route(struct net *net, struct dst_entry *dst_orig,
|
|
|
|
+ const struct flowi *fl,
|
|
|
|
+ struct sock *sk, int flags)
|
|
|
|
+{
|
|
|
|
+ struct dst_entry *dst = xfrm_lookup(net, dst_orig, fl, sk, flags);
|
|
|
|
+
|
|
|
|
+ if (IS_ERR(dst) && PTR_ERR(dst) == -EREMOTE)
|
|
|
|
+ return make_blackhole(net, dst_orig->ops->family, dst_orig);
|
|
|
|
+
|
|
|
|
+ return dst;
|
|
|
|
+}
|
|
|
|
+EXPORT_SYMBOL(xfrm_lookup_route);
|
|
|
|
+
|
|
static inline int
|
|
static inline int
|
|
xfrm_secpath_reject(int idx, struct sk_buff *skb, const struct flowi *fl)
|
|
xfrm_secpath_reject(int idx, struct sk_buff *skb, const struct flowi *fl)
|
|
{
|
|
{
|