Skip to content

Commit 1ee72b7

Browse files
yboarontpantelis
authored andcommitted
Delete xfrm rules also for IPv6
Signed-off-by: Yossi Boaron <[email protected]>
1 parent c9ba063 commit 1ee72b7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/routeagent_driver/cabledriver/xfrm_cleanup_handler.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ package cabledriver
2121
import (
2222
"github.com/submariner-io/submariner/pkg/event"
2323
"github.com/submariner-io/submariner/pkg/netlink"
24+
utilerrors "k8s.io/apimachinery/pkg/util/errors"
2425
k8snet "k8s.io/utils/net"
2526
)
2627

@@ -43,5 +44,8 @@ func (h *xrfmCleanup) GetNetworkPlugins() []string {
4344
func (h *xrfmCleanup) TransitionToNonGateway() error {
4445
logger.Info("Transitioned to non-Gateway, cleaning up the IPsec xfrm rules")
4546

46-
return netlink.DeleteXfrmRules(k8snet.IPv4) //nolint:wrapcheck // No need to wrap this error
47+
errv6 := netlink.DeleteXfrmRules(k8snet.IPv6)
48+
errv4 := netlink.DeleteXfrmRules(k8snet.IPv4)
49+
50+
return utilerrors.NewAggregate([]error{errv6, errv4})
4751
}

0 commit comments

Comments
 (0)