Skip to content

Commit

Permalink
fix acl log name too long (exceed 63) (#1612)
Browse files Browse the repository at this point in the history
  • Loading branch information
halfcrazy committed Jun 16, 2022
1 parent 0b84039 commit d6915bd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/ovs/ovn-nbctl-legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,11 @@ func (c LegacyClient) ResetLogicalSwitchAcl(ls string) error {
// SetPrivateLogicalSwitch will drop all ingress traffic except allow subnets
func (c LegacyClient) SetPrivateLogicalSwitch(ls, cidr string, allow []string) error {
ovnArgs := []string{"acl-del", ls}
dropArgs := []string{"--", "--log", fmt.Sprintf("--name=%s", ls), fmt.Sprintf("--severity=%s", "warning"), "acl-add", ls, "to-lport", util.DefaultDropPriority, "ip", "drop"}
trimName := ls
if len(ls) > 63 {
trimName = ls[:63]
}
dropArgs := []string{"--", "--log", fmt.Sprintf("--name=%s", trimName), fmt.Sprintf("--severity=%s", "warning"), "acl-add", ls, "to-lport", util.DefaultDropPriority, "ip", "drop"}
ovnArgs = append(ovnArgs, dropArgs...)

for _, cidrBlock := range strings.Split(cidr, ",") {
Expand Down

0 comments on commit d6915bd

Please sign in to comment.