Skip to content

Commit

Permalink
ipsec: Invert arguments in ipSecReplaceStateOut
Browse files Browse the repository at this point in the history
This is simply for consistency with ipSecReplaceStateIn

Signed-off-by: Paul Chaignon <[email protected]>
  • Loading branch information
pchaigno authored and ldelossa committed Jan 19, 2023
1 parent 6bb084a commit 6345321
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/datapath/linux/ipsec/ipsec_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func ipSecReplaceStateIn(localIP, remoteIP net.IP, zeroMark bool) (uint8, error)
return key.Spi, netlink.XfrmStateAdd(state)
}

func ipSecReplaceStateOut(remoteIP, localIP net.IP) (uint8, error) {
func ipSecReplaceStateOut(localIP, remoteIP net.IP) (uint8, error) {
key := getIPSecKeys(localIP)
if key == nil {
return 0, fmt.Errorf("IPSec key missing")
Expand Down Expand Up @@ -398,7 +398,7 @@ func UpsertIPsecEndpoint(local, remote *net.IPNet, outerLocal, outerRemote net.I
}

if dir == IPSecDirOut || dir == IPSecDirOutNode || dir == IPSecDirBoth {
if spi, err = ipSecReplaceStateOut(outerRemote, outerLocal); err != nil {
if spi, err = ipSecReplaceStateOut(outerLocal, outerRemote); err != nil {
if !os.IsExist(err) {
return 0, fmt.Errorf("unable to replace remote state: %s", err)
}
Expand Down

0 comments on commit 6345321

Please sign in to comment.