net: lwtunnel: Handle lwtunnel_fill_encap failure
Handle failure in lwtunnel_fill_encap adding attributes to skb. Fixes:571e722676
("ipv4: support for fib route lwtunnel encap attributes") Fixes:19e42e4515
("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>
This commit is contained in:

committed by
David S. Miller

parent
18a3ed59d0
commit
ea7a80858f
@@ -3317,7 +3317,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;
|
||||
|
Reference in New Issue
Block a user