Skip to content

Commit 3040507

Browse files
restrict network rules type to operand network
Restrict the use of network type to network operand: "operator": { "type": "network", "operand": "dest.network", "sensitive": false, "data": "LAN", "list": [] }
1 parent 0051fa9 commit 3040507

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

daemon/rule/operator.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ func (o *Operator) Compile() error {
163163
} else if o.Type == List {
164164
o.Operand = OpList
165165
} else if o.Type == Network {
166+
if o.Operand != OpDstNetwork {
167+
return fmt.Errorf("operand %s is only allowed with type %s", Network, OpDstNetwork)
168+
}
166169
if err := o.compileNetwork(); err != nil {
167170
return err
168171
}

0 commit comments

Comments
 (0)