[ovs-git] [ovn-org/ovn] 719f1a: ovn-northd: Fix update of a mac prefix.

Ilya Maximets noreply at github.com
Mon Sep 13 18:37:16 UTC 2021


  Branch: refs/heads/branch-21.03
  Home:   https://github.com/ovn-org/ovn
  Commit: 719f1a961416155403067b5fabe3a4a79b1010a5
      https://github.com/ovn-org/ovn/commit/719f1a961416155403067b5fabe3a4a79b1010a5
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2021-09-13 (Mon, 13 Sep 2021)

  Changed paths:
    M northd/ovn-northd.c
    M tests/ovn.at

  Log Message:
  -----------
  ovn-northd: Fix update of a mac prefix.

'smap_add' doesn't check for duplicates.  This leads to having
more than one entry with a 'mac_prefix' key in the 'options' smap.

'ovsdb_datum_sort_unique' removes duplicates before sending the
transaction.  It does that by sorting values and keeping the first one
per key.  In normal case 'mac_prefix' transitions from nothing to
random and it works fine.  However, northd also tries to change
all-zero prefix to random one and this fails, because all-zero prefix
goes first in a sorted map and a new random value gets dropped from
the transaction.  This makes northd to update macs of all ports
on every iteration with a new random mac prefix.

Fix that by replacing smap value and not relying on IDL for removing
duplicates.

Fixes: 39242c106eff ("northd: refactor and split some IPAM functions")
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
Acked-by: Mark D. Gray <mark.d.gray at redhat.com>
Signed-off-by: Mark Michelson <mmichels at redhat.com>




More information about the git mailing list