mirror of
https://github.com/moby/moby.git
synced 2026-08-07 08:31:39 +00:00
d/libn/i/nftables: add trailing semicolon
The syntax for specifying the parameters of a base chain is documented to have a mandatory semicolon terminating each parameter clause. In practice, nft sometimes accepts a chain definition with a newline instead of a semicolon after the terminal parameter, only to reject the rules that follow with strange errors. Add trailing semicolons to the policy parameters of base chain definitions to satisfy the parsers of all versions of nft we might encounter. Signed-off-by: Cory Snider <csnider@mirantis.com>
This commit is contained in:
@@ -34,7 +34,7 @@ table {{$family}} {{$tableName}} {
|
||||
}
|
||||
{{end}}
|
||||
{{range .Chains}}{{if .MustFlush}}chain {{.Name}} {
|
||||
{{if .ChainType}}type {{.ChainType}} hook {{.Hook}}{{if .Device}} device "{{.Device}}"{{end}} priority {{.Priority}}; policy {{.Policy}}{{end}}
|
||||
{{if .ChainType}}type {{.ChainType}} hook {{.Hook}}{{if .Device}} device "{{.Device}}"{{end}} priority {{.Priority}}; policy {{.Policy}};{{end}}
|
||||
} ; {{end}}{{end}}
|
||||
}
|
||||
{{if .MustFlush}}flush table {{$family}} {{$tableName}}{{end}}
|
||||
@@ -52,7 +52,7 @@ table {{$family}} {{$tableName}} {
|
||||
{{end}}
|
||||
table {{$family}} {{$tableName}} {
|
||||
{{range .Chains}}{{if .MustFlush}}chain {{.Name}} {
|
||||
{{if .ChainType}}type {{.ChainType}} hook {{.Hook}}{{if .Device}} device "{{.Device}}"{{end}} priority {{.Priority}}; policy {{.Policy}}{{end}}
|
||||
{{if .ChainType}}type {{.ChainType}} hook {{.Hook}}{{if .Device}} device "{{.Device}}"{{end}} priority {{.Priority}}; policy {{.Policy}};{{end}}
|
||||
{{range .Rules}}{{.}}
|
||||
{{end}}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ table {{$family}} {{$tableName}} {
|
||||
}
|
||||
{{end}}
|
||||
{{range .Chains}}chain {{.Name}} {
|
||||
{{if .ChainType}}type {{.ChainType}} hook {{.Hook}}{{if .Device}} device "{{.Device}}"{{end}} priority {{.Priority}}; policy {{.Policy}}{{end}}
|
||||
{{if .ChainType}}type {{.ChainType}} hook {{.Hook}}{{if .Device}} device "{{.Device}}"{{end}} priority {{.Priority}}; policy {{.Policy}};{{end}}
|
||||
{{range .Rules}}{{.}}
|
||||
{{end}}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user