Browse Source

add ingress GW address to route info

Abhishek Kondur 2 years ago
parent
commit
2ffd3cab72
2 changed files with 5 additions and 0 deletions
  1. 4 0
      logic/peers.go
  2. 1 0
      models/mqtt.go

+ 4 - 0
logic/peers.go

@@ -441,6 +441,10 @@ func GetPeerUpdateForHost(host *models.Host) (models.HostPeerUpdate, error) {
 					}
 					hostPeerUpdate.IngressInfo.ExtPeers[extPeerIdAndAddr.ID] = models.ExtClientInfo{
 						Masquerade: true,
+						IngGwAddr: net.IPNet{
+							IP:   net.ParseIP(node.PrimaryAddress()),
+							Mask: net.CIDRMask(32, 32),
+						},
 						ExtPeerAddr: net.IPNet{
 							IP:   net.ParseIP(extPeerIdAndAddr.Address),
 							Mask: net.CIDRMask(32, 32),

+ 1 - 0
models/mqtt.go

@@ -42,6 +42,7 @@ type PeerExtInfo struct {
 }
 
 type ExtClientInfo struct {
+	IngGwAddr   net.IPNet              `json:"ingress_gw_addr" yaml:"ingress_gw_addr"`
 	Masquerade  bool                   `json:"masquerade" yaml:"masquerade"`
 	ExtPeerAddr net.IPNet              `json:"ext_peer_addr" yaml:"ext_peer_addr"`
 	ExtPeerKey  string                 `json:"ext_peer_key" yaml:"ext_peer_key"`