From 8b08ad14636444196e568803e23e7fe8ecaa79d1 Mon Sep 17 00:00:00 2001 From: Abhishek K <32607604+abhishek9686@users.noreply.github.com> Date: Tue, 16 Apr 2024 19:22:14 +0530 Subject: [PATCH] NET-1146: add node ipv6 addr to egress route (#2896) * add node ipv6 addr to egress route * fix egress route ipv6 address issue * revert ipv6 peer addr change --------- Co-authored-by: Max Ma --- logic/peers.go | 3 ++- models/mqtt.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/logic/peers.go b/logic/peers.go index df69afec5..48c5f43d6 100644 --- a/logic/peers.go +++ b/logic/peers.go @@ -173,7 +173,8 @@ func GetPeerUpdateForHost(network string, host *models.Host, allNodes []models.N } if peer.IsEgressGateway { hostPeerUpdate.EgressRoutes = append(hostPeerUpdate.EgressRoutes, models.EgressNetworkRoutes{ - NodeAddr: node.PrimaryAddressIPNet(), + NodeAddr: node.Address, + NodeAddr6: node.Address6, EgressRanges: peer.EgressGatewayRanges, }) } diff --git a/models/mqtt.go b/models/mqtt.go index 54b4b94b6..98d4625a7 100644 --- a/models/mqtt.go +++ b/models/mqtt.go @@ -43,6 +43,7 @@ type EgressInfo struct { // EgressNetworkRoutes - struct for egress network routes for adding routes to peer's interface type EgressNetworkRoutes struct { NodeAddr net.IPNet `json:"node_addr"` + NodeAddr6 net.IPNet `json:"node_addr6"` EgressRanges []string `json:"egress_ranges"` }