summaryrefslogtreecommitdiffstats
path: root/include/net/lwtunnel.h
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2017-05-27 16:19:27 -0600
committerDavid S. Miller <davem@davemloft.net>2017-05-30 11:55:31 -0400
commitc255bd681d1a93fff2a2c249d91449cce830ac64 (patch)
tree926aa52879b0b1c3f348e37e599375c0e7a06641 /include/net/lwtunnel.h
parent78055998954b7a3e6c31eb24d1d26f0b63a7ec0d (diff)
downloadlinux-stable-c255bd681d1a93fff2a2c249d91449cce830ac64.tar.gz
linux-stable-c255bd681d1a93fff2a2c249d91449cce830ac64.tar.bz2
linux-stable-c255bd681d1a93fff2a2c249d91449cce830ac64.zip
net: lwtunnel: Add extack to encap attr validation
Pass extack down to lwtunnel_valid_encap_type and lwtunnel_valid_encap_type_attr. Add messages for unknown or unsupported encap types. Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/lwtunnel.h')
-rw-r--r--include/net/lwtunnel.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/include/net/lwtunnel.h b/include/net/lwtunnel.h
index ebfe237aad7e..ca6f002774ef 100644
--- a/include/net/lwtunnel.h
+++ b/include/net/lwtunnel.h
@@ -107,8 +107,10 @@ int lwtunnel_encap_add_ops(const struct lwtunnel_encap_ops *op,
unsigned int num);
int lwtunnel_encap_del_ops(const struct lwtunnel_encap_ops *op,
unsigned int num);
-int lwtunnel_valid_encap_type(u16 encap_type);
-int lwtunnel_valid_encap_type_attr(struct nlattr *attr, int len);
+int lwtunnel_valid_encap_type(u16 encap_type,
+ struct netlink_ext_ack *extack);
+int lwtunnel_valid_encap_type_attr(struct nlattr *attr, int len,
+ struct netlink_ext_ack *extack);
int lwtunnel_build_state(u16 encap_type,
struct nlattr *encap,
unsigned int family, const void *cfg,
@@ -172,11 +174,14 @@ static inline int lwtunnel_encap_del_ops(const struct lwtunnel_encap_ops *op,
return -EOPNOTSUPP;
}
-static inline int lwtunnel_valid_encap_type(u16 encap_type)
+static inline int lwtunnel_valid_encap_type(u16 encap_type,
+ struct netlink_ext_ack *extack)
{
+ NL_SET_ERR_MSG(extack, "CONFIG_LWTUNNEL is not enabled in this kernel");
return -EOPNOTSUPP;
}
-static inline int lwtunnel_valid_encap_type_attr(struct nlattr *attr, int len)
+static inline int lwtunnel_valid_encap_type_attr(struct nlattr *attr, int len,
+ struct netlink_ext_ack *extack)
{
/* return 0 since we are not walking attr looking for
* RTA_ENCAP_TYPE attribute on nexthops.