Skip to content

Commit

Permalink
Better error message
Browse files Browse the repository at this point in the history
  • Loading branch information
hknutzen committed Apr 2, 2024
1 parent 4e1d12f commit 07bafe6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions go/pkg/pass1/set-zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -897,8 +897,9 @@ func (c *spoc) inheritNAT0() {
continue
} else if n, ok := obj.(*network); ok && !n.isAggregate {
if n.ipType == bridgedIP && !nat2.identity {
c.err("Must not inherit nat:%s at bridged %s from %s",
tag, n, from2[tag])
c.err("Must not inherit nat:%s at bridged %s from %s\n"+
" Use 'nat:%s = { identity; }' to stop inheritance",
tag, n, from2[tag], tag)
continue
}
nat2 = c.adaptNAT(n, tag, nat2)
Expand Down
1 change: 1 addition & 0 deletions go/testdata/bridged.t
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ router:bridge = {
network:n1/right = { ip = 10.1.1.0/24; }
=ERROR=
Error: Must not inherit nat:x at bridged network:n1/left from any:a
Use 'nat:x = { identity; }' to stop inheritance
=END=
############################################################
Expand Down
1 change: 1 addition & 0 deletions go/testdata/ipv6/bridged_ipv6.t
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ router:bridge = {
network:n1/right = { ip = ::a01:100/120; }
=ERROR=
Error: Must not inherit nat:x at bridged network:n1/left from any:a
Use 'nat:x = { identity; }' to stop inheritance
=END=
############################################################
Expand Down

0 comments on commit 07bafe6

Please sign in to comment.