Skip to content

Commit

Permalink
incusd/network: Update for OVN function changes
Browse files Browse the repository at this point in the history
Signed-off-by: DhruvNistala <dhruv.nistala@gmail.com>
  • Loading branch information
DhruvNistala authored and stgraber committed May 6, 2024
1 parent c19f097 commit 361b0f7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/server/network/driver_ovn.go
Original file line number Diff line number Diff line change
Expand Up @@ -2174,7 +2174,7 @@ func (n *ovn) setup(update bool) error {
}
}

err = n.state.OVNNB.CreateLogicalRouterSNAT(context.TODO(), n.getRouterName(), routerIntPortIPv4Net, snatIP, update)
err = n.state.OVNNB.CreateLogicalRouterNAT(context.TODO(), n.getRouterName(), "snat", routerIntPortIPv4Net, snatIP, nil, false, update)
if err != nil {
return fmt.Errorf("Failed adding router IPv4 SNAT rule: %w", err)
}
Expand All @@ -2190,7 +2190,7 @@ func (n *ovn) setup(update bool) error {
}
}

err = n.state.OVNNB.CreateLogicalRouterSNAT(context.TODO(), n.getRouterName(), routerIntPortIPv6Net, snatIP, update)
err = n.state.OVNNB.CreateLogicalRouterNAT(context.TODO(), n.getRouterName(), "snat", routerIntPortIPv6Net, snatIP, nil, false, update)
if err != nil {
return fmt.Errorf("Failed adding router IPv6 SNAT rule: %w", err)
}
Expand Down Expand Up @@ -3758,7 +3758,7 @@ func (n *ovn) InstanceDevicePortStart(opts *OVNInstanceNICSetupOpts, securityACL
continue // No qualifying target IP from DNS records.
}

err = n.state.OVNNB.LogicalRouterDNATSNATAdd(n.getRouterName(), ip, ip, true, true)
err = n.state.OVNNB.CreateLogicalRouterNAT(context.TODO(), n.getRouterName(), "dnat_and_snat", nil, ip, ip, true, true)
if err != nil {
return "", nil, err
}
Expand Down Expand Up @@ -3824,7 +3824,7 @@ func (n *ovn) InstanceDevicePortStart(opts *OVNInstanceNICSetupOpts, securityACL
// DNAT doesn't support whole subnets.
if slices.Contains([]string{"l2proxy", ""}, opts.UplinkConfig["ovn.ingress_mode"]) {
err = SubnetIterate(externalRoute, func(ip net.IP) error {
err = n.state.OVNNB.LogicalRouterDNATSNATAdd(n.getRouterName(), ip, ip, true, true)
err = n.state.OVNNB.CreateLogicalRouterNAT(context.TODO(), n.getRouterName(), "dnat_and_snat", nil, ip, ip, true, true)
if err != nil {
return err
}
Expand Down

0 comments on commit 361b0f7

Please sign in to comment.