lwt: Add cfg argument to build_state
authorTom Herbert <tom@herbertland.com>
Mon, 24 Aug 2015 16:45:41 +0000 (09:45 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Aug 2015 17:34:40 +0000 (10:34 -0700)
Add cfg and family arguments to lwt build state functions. cfg is a void
pointer and will either be a pointer to a fib_config or fib6_config
structure. The family parameter indicates which one (either AF_INET
or AF_INET6).

LWT encpasulation implementation may use the fib configuration to build
the LWT state.

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/lwtunnel.h
net/core/lwtunnel.c
net/ipv4/fib_semantics.c
net/ipv4/ip_tunnel_core.c
net/ipv6/ila.c
net/ipv6/route.c
net/mpls/mpls_iptunnel.c

index 8434898..fce0e35 100644 (file)
@@ -26,6 +26,7 @@ struct lwtunnel_state {
 
 struct lwtunnel_encap_ops {
        int (*build_state)(struct net_device *dev, struct nlattr *encap,
+                          unsigned int family, const void *cfg,
                           struct lwtunnel_state **ts);
        int (*output)(struct sock *sk, struct sk_buff *skb);
        int (*input)(struct sk_buff *skb);
@@ -80,6 +81,7 @@ int lwtunnel_encap_del_ops(const struct lwtunnel_encap_ops *op,
                           unsigned int num);
 int lwtunnel_build_state(struct net_device *dev, u16 encap_type,
                         struct nlattr *encap,
+                        unsigned int family, const void *cfg,
                         struct lwtunnel_state **lws);
 int lwtunnel_fill_encap(struct sk_buff *skb,
                        struct lwtunnel_state *lwtstate);
@@ -130,6 +132,7 @@ static inline int lwtunnel_encap_del_ops(const struct lwtunnel_encap_ops *op,
 
 static inline int lwtunnel_build_state(struct net_device *dev, u16 encap_type,
                                       struct nlattr *encap,
+                                      unsigned int family, const void *cfg,
                                       struct lwtunnel_state **lws)
 {
        return -EOPNOTSUPP;
index e924c2e..dfb1a9c 100644 (file)
@@ -72,7 +72,8 @@ int lwtunnel_encap_del_ops(const struct lwtunnel_encap_ops *ops,
 EXPORT_SYMBOL(lwtunnel_encap_del_ops);
 
 int lwtunnel_build_state(struct net_device *dev, u16 encap_type,
-                        struct nlattr *encap, struct lwtunnel_state **lws)
+                        struct nlattr *encap, unsigned int family,
+                        const void *cfg, struct lwtunnel_state **lws)
 {
        const struct lwtunnel_encap_ops *ops;
        int ret = -EINVAL;
@@ -85,7 +86,7 @@ int lwtunnel_build_state(struct net_device *dev, u16 encap_type,
        rcu_read_lock();
        ops = rcu_dereference(lwtun_encaps[encap_type]);
        if (likely(ops && ops->build_state))
-               ret = ops->build_state(dev, encap, lws);
+               ret = ops->build_state(dev, encap, family, cfg, lws);
        rcu_read_unlock();
 
        return ret;
Simple merge
Simple merge
diff --cc net/ipv6/ila.c
Simple merge
Simple merge
Simple merge