aboutsummaryrefslogtreecommitdiffstats
path: root/net/mpls/mpls_iptunnel.c
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2017-05-27 16:19:29 -0600
committerDavid S. Miller <davem@davemloft.net>2017-05-30 11:55:32 -0400
commita1f10abe12b6d70f8b02dedccb48c9d234a57b67 (patch)
treebe09b101e9c3789ba4d6215f5b06059837f52600 /net/mpls/mpls_iptunnel.c
parentnet: add extack arg to lwtunnel build state (diff)
downloadlinux-dev-a1f10abe12b6d70f8b02dedccb48c9d234a57b67.tar.xz
linux-dev-a1f10abe12b6d70f8b02dedccb48c9d234a57b67.zip
net: Fill in extack for mpls lwt encap
Fill in extack for errors in build_state for mpls lwt encap including passing extack to nla_get_labels and adding error messages for failures in it. Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mpls/mpls_iptunnel.c')
-rw-r--r--net/mpls/mpls_iptunnel.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/net/mpls/mpls_iptunnel.c b/net/mpls/mpls_iptunnel.c
index 15e1aa708e50..6e558a419f60 100644
--- a/net/mpls/mpls_iptunnel.c
+++ b/net/mpls/mpls_iptunnel.c
@@ -173,13 +173,14 @@ static int mpls_build_state(struct nlattr *nla,
if (ret < 0)
return ret;
- if (!tb[MPLS_IPTUNNEL_DST])
+ if (!tb[MPLS_IPTUNNEL_DST]) {
+ NL_SET_ERR_MSG(extack, "MPLS_IPTUNNEL_DST attribute is missing");
return -EINVAL;
-
+ }
/* determine number of labels */
- if (nla_get_labels(tb[MPLS_IPTUNNEL_DST],
- MAX_NEW_LABELS, &n_labels, NULL))
+ if (nla_get_labels(tb[MPLS_IPTUNNEL_DST], MAX_NEW_LABELS,
+ &n_labels, NULL, extack))
return -EINVAL;
newts = lwtunnel_state_alloc(sizeof(*tun_encap_info) +
@@ -189,7 +190,8 @@ static int mpls_build_state(struct nlattr *nla,
tun_encap_info = mpls_lwtunnel_encap(newts);
ret = nla_get_labels(tb[MPLS_IPTUNNEL_DST], n_labels,
- &tun_encap_info->labels, tun_encap_info->label);
+ &tun_encap_info->labels, tun_encap_info->label,
+ extack);
if (ret)
goto errout;