net/ipv6: Always return result of the last finalizer

Or we will not know if overall finalization worked.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2019-02-01 21:25:26 +01:00 committed by Anas Nashif
parent f47a9565d7
commit e080dfc1de

View File

@ -167,10 +167,10 @@ int net_ipv6_finalize_new(struct net_pkt *pkt, u8_t next_header_proto)
next_header_proto == IPPROTO_ICMPV6) {
if (IS_ENABLED(CONFIG_NET_UDP) &&
next_header_proto == IPPROTO_UDP) {
net_udp_finalize(pkt);
return net_udp_finalize(pkt);
} else if (IS_ENABLED(CONFIG_NET_TCP) &&
next_header_proto == IPPROTO_TCP) {
net_tcp_finalize(pkt);
return net_tcp_finalize(pkt);
} else if (next_header_proto == IPPROTO_ICMPV6) {
return net_icmpv6_finalize(pkt);
}