]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: dst: provide accessor function to dst->xfrm
authorVlad Yasevich <vyasevich@gmail.com>
Wed, 16 Oct 2013 02:01:29 +0000 (22:01 -0400)
committerWilly Tarreau <w@1wt.eu>
Mon, 19 May 2014 05:53:35 +0000 (07:53 +0200)
[ Upstream commit e87b3998d795123b4139bc3f25490dd236f68212 ]

dst->xfrm is conditionally defined.  Provide accessor funtion that
is always available.

Signed-off-by: Vlad Yasevich <vyasevich@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Willy Tarreau <w@1wt.eu>
include/net/dst.h

index 5a900ddcf10dbbf4a0021ebc3023c41f028575f6..49f443bd38f73917bb486e07cf4422368177df96 100644 (file)
@@ -286,11 +286,22 @@ static inline int __xfrm_lookup(struct net *net, struct dst_entry **dst_p,
 {
        return 0;
 }
+static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst)
+{
+       return NULL;
+}
+
 #else
 extern int xfrm_lookup(struct net *net, struct dst_entry **dst_p,
                       struct flowi *fl, struct sock *sk, int flags);
 extern int __xfrm_lookup(struct net *net, struct dst_entry **dst_p,
                         struct flowi *fl, struct sock *sk, int flags);
+
+/* skb attached with this dst needs transformation if dst->xfrm is valid */
+static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst)
+{
+       return dst->xfrm;
+}
 #endif
 #endif