summaryrefslogtreecommitdiff
path: root/net/ipv6/route.c
diff options
context:
space:
mode:
authorDavid Ahern <dsa@cumulusnetworks.com>2017-01-11 14:29:54 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-02-04 09:47:08 +0100
commit6980c52c4efb951c972409ebd146cfc348144918 (patch)
treedac55bb122db1cd2e4ba452425726dd883e96c91 /net/ipv6/route.c
parentec1aa8d495326435d956af325391b775038daa08 (diff)
net: lwtunnel: Handle lwtunnel_fill_encap failure
[ Upstream commit ea7a80858f57d8878b1499ea0f1b8a635cc48de7 ] Handle failure in lwtunnel_fill_encap adding attributes to skb. Fixes: 571e722676fe ("ipv4: support for fib route lwtunnel encap attributes") Fixes: 19e42e451506 ("ipv6: support for fib route lwtunnel encap attributes") Signed-off-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r--net/ipv6/route.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 1b57e11e6e0d..acd8023763cb 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -3306,7 +3306,8 @@ static int rt6_fill_node(struct net *net,
if (nla_put_u8(skb, RTA_PREF, IPV6_EXTRACT_PREF(rt->rt6i_flags)))
goto nla_put_failure;
- lwtunnel_fill_encap(skb, rt->dst.lwtstate);
+ if (lwtunnel_fill_encap(skb, rt->dst.lwtstate) < 0)
+ goto nla_put_failure;
nlmsg_end(skb, nlh);
return 0;