bisdn / basebox

A tiny OpenFlow controller for OF-DPA switches.
Mozilla Public License 2.0
45 stars 9 forks source link

replace termination mac reference count with check for ip addresses #368

Closed KanjiMonster closed 2 years ago

KanjiMonster commented 2 years ago

Replace the refcounts of termination mac entries with simple checks for the existence of entries on adding addresses, and existing other addresses on removing other addresses.

Description

This avoids a race on start up where a logical bond or bridge interface's address may get added/counted twice:

  1. libnl: attach port to bond
  2. libnl: new address on bond
  3. baseboxd: handle attach port event
  4. baseboxd: handle new address event

On attachment, we scan the interface for addresses to add them (since we only should handle them once there is port interface attached). If an address gets added before we manage to handle the attachment event, we will see it in the attachment, and then add it again when handling the new address event.

So to avoid this, don't try to have valid reference count, and instead make adding the termination mac entry too often a NOP.

How Has This Been Tested?

Running a pipeline on as4630-54pe pair, with no shown regressions.