Skip to content

Commit e2fddf5

Browse files
Daniel Lezcanodavem330
authored andcommitted
[IPV6]: Make af_inet6 to check ip6_route_init return value.
The af_inet6 initialization function does not check the return code of the route initilization, so if something goes wrong, the protocol initialization will continue anyway. This patch takes into account the modification made in the different route's initialization subroutines to check the return value and to make the protocol initialization to fail. Signed-off-by: Daniel Lezcano <[email protected]> Acked-by: Benjamin Thery <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 433d49c commit e2fddf5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

net/ipv6/af_inet6.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,9 @@ static int __init inet6_init(void)
849849
if (if6_proc_init())
850850
goto proc_if6_fail;
851851
#endif
852-
ip6_route_init();
852+
err = ip6_route_init();
853+
if (err)
854+
goto ip6_route_fail;
853855
ip6_flowlabel_init();
854856
err = addrconf_init();
855857
if (err)
@@ -874,6 +876,7 @@ static int __init inet6_init(void)
874876
addrconf_fail:
875877
ip6_flowlabel_cleanup();
876878
ip6_route_cleanup();
879+
ip6_route_fail:
877880
#ifdef CONFIG_PROC_FS
878881
if6_proc_exit();
879882
proc_if6_fail:
@@ -904,6 +907,7 @@ static int __init inet6_init(void)
904907
cleanup_ipv6_mibs();
905908
out_unregister_sock:
906909
sock_unregister(PF_INET6);
910+
rtnl_unregister_all(PF_INET6);
907911
out_unregister_raw_proto:
908912
proto_unregister(&rawv6_prot);
909913
out_unregister_udplite_proto:

0 commit comments

Comments
 (0)