Skip to content

Commit 947c0c5

Browse files
committed
Show IPv4 areas for combined zone
Must not accidently overwrite v4 areas by v6 areas, when combined zones have same name.
1 parent b8a4acd commit 947c0c5

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed

Changes

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{{$NEXT}}
22

3+
- Fixed command 'export-netspoc'.
4+
Show IPv4 areas for combined zone. Must not accidently overwrite
5+
IPv4 areas by IPv6 areas, when combined zones have same name.
6+
37
6.074 2024-12-16 11:52:23+01:00 Europe/Berlin
48

59
- Fixed wrong error on duplicate interface from router in ipv6/ directory.

go/pkg/pass1/export.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,17 @@ func ipNatForObject(obj srvObj, dst jsonMap) {
182182
}
183183
}
184184

185-
// Zone with network 0/0 doesn't have an aggregate 0/0.
186185
func (c *spoc) getZoneName(z *zone) string {
186+
// Ignore IPv6 part of dual stack zone.
187+
// This must match check in exportZone2Areas.
188+
if z.ipV6 && z.combined46 != nil {
189+
z = z.combined46
190+
}
187191
ipp := c.getNetwork00(z.ipV6).ipp
188192
if any := z.ipPrefix2aggregate[ipp]; any != nil {
189193
return any.name
190194
} else {
195+
// Zone with network 0/0 doesn't have an aggregate 0/0.
191196
return z.name
192197
}
193198
}
@@ -1307,6 +1312,9 @@ func (c *spoc) exportMasterOwner(dir string, masterOwner string) {
13071312
func (c *spoc) exportZone2Areas(dir string) {
13081313
result := make(jsonMap)
13091314
for _, z := range c.allZones {
1315+
if z.ipV6 && z.combined46 != nil {
1316+
continue
1317+
}
13101318
var l stringList
13111319
a := z.inArea
13121320
for a != nil {

go/testdata/export-netspoc/combined46.t

+24-1
Original file line numberDiff line numberDiff line change
@@ -354,4 +354,27 @@ service:s1 = {
354354
"any:n2-v6"
355355
]
356356
}
357-
=END=
357+
=END=
358+
359+
############################################################
360+
=TITLE=Show v4 areas for combined zone
361+
=INPUT=
362+
area:all-v4 = { anchor = network:n1; ipv4_only; }
363+
area:all-v6 = { anchor = network:n1; ipv6_only; }
364+
area:a1-v4 = { border = interface:r1.n1; ipv4_only; }
365+
366+
network:n1 = { ip = 10.1.1.0/24; ip6 = 2001:db8:1:1::/64; }
367+
network:n2 = { ip6 = 2001:db8:1:2::/64; }
368+
router:r1 = {
369+
managed;
370+
model = ASA;
371+
interface:n1 = { ip = 10.1.1.1; ip6 = 2001:db8:1:1::1; hardware = n1; }
372+
interface:n2 = { ip6 = 2001:db8:1:2::1; hardware = n2; }
373+
}
374+
=OUTPUT=
375+
--zone2areas
376+
{
377+
"any:[network:n1]": [ "a1-v4", "all-v4" ],
378+
"any:[network:n2]": [ "all-v6" ]
379+
}
380+
=END=

0 commit comments

Comments
 (0)