Skip to content

Commit 5483844

Browse files
a3a3elklassert
authored andcommitted
vti4: ipip tunnel deregistration fixes.
If tunnel registration failed during module initialization, the module would fail to deregister the IPPROTO_COMP protocol and would attempt to deregister the tunnel. The tunnel was not deregistered during module-exit. Fixes: dd9ee34 ("vti4: Fix a ipip packet processing bug in 'IPCOMP' virtual tunnel") Signed-off-by: Jeremy Sowden <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
1 parent bfc01dd commit 5483844

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

net/ipv4/ip_vti.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,9 +659,9 @@ static int __init vti_init(void)
659659
return err;
660660

661661
rtnl_link_failed:
662-
xfrm4_protocol_deregister(&vti_ipcomp4_protocol, IPPROTO_COMP);
663-
xfrm_tunnel_failed:
664662
xfrm4_tunnel_deregister(&ipip_handler, AF_INET);
663+
xfrm_tunnel_failed:
664+
xfrm4_protocol_deregister(&vti_ipcomp4_protocol, IPPROTO_COMP);
665665
xfrm_proto_comp_failed:
666666
xfrm4_protocol_deregister(&vti_ah4_protocol, IPPROTO_AH);
667667
xfrm_proto_ah_failed:
@@ -676,6 +676,7 @@ static int __init vti_init(void)
676676
static void __exit vti_fini(void)
677677
{
678678
rtnl_link_unregister(&vti_link_ops);
679+
xfrm4_tunnel_deregister(&ipip_handler, AF_INET);
679680
xfrm4_protocol_deregister(&vti_ipcomp4_protocol, IPPROTO_COMP);
680681
xfrm4_protocol_deregister(&vti_ah4_protocol, IPPROTO_AH);
681682
xfrm4_protocol_deregister(&vti_esp4_protocol, IPPROTO_ESP);

0 commit comments

Comments
 (0)