tailcfg: add Node.SelfNodeV4MasqAddrForThisPeer

This only adds the field, to be used in a future commit.

Updates tailscale/corp#8020

Co-authored-by: Melanie Warrick <warrick@tailscale.com>
Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
Maisem Ali
2023-03-02 16:05:07 -08:00
committed by Maisem Ali
parent 583e86b7df
commit f61b306133
5 changed files with 98 additions and 66 deletions
+11 -1
View File
@@ -349,7 +349,7 @@ func TestNodeEqual(t *testing.T) {
"Capabilities",
"UnsignedPeerAPIOnly",
"ComputedName", "computedHostIfDifferent", "ComputedNameWithHost",
"DataPlaneAuditLogID", "Expired",
"DataPlaneAuditLogID", "Expired", "SelfNodeV4MasqAddrForThisPeer",
}
if have := fieldsOf(reflect.TypeOf(Node{})); !reflect.DeepEqual(have, nodeHandles) {
t.Errorf("Node.Equal check might be out of sync\nfields: %q\nhandled: %q\n",
@@ -534,6 +534,16 @@ func TestNodeEqual(t *testing.T) {
&Node{},
false,
},
{
&Node{},
&Node{SelfNodeV4MasqAddrForThisPeer: netip.MustParseAddr("100.64.0.1")},
false,
},
{
&Node{SelfNodeV4MasqAddrForThisPeer: netip.MustParseAddr("100.64.0.1")},
&Node{SelfNodeV4MasqAddrForThisPeer: netip.MustParseAddr("100.64.0.1")},
true,
},
}
for i, tt := range tests {
got := tt.a.Equal(tt.b)