Skip to content

Netlink: addresses not removed from Xenstore when interface disappears

When an interface is removed, several Netlink messages are emitted (addresses removals, then iface removal), and by the time we're handling any of them, the interface usually does not exist any more. Relying on if_indextoname() to get the matching interface name cannot work, but:

  • xenstore_schema_std cache indexes interface data using their names
  • collector_net_pnet network view also uses interface names as index
  • unrustingly, the code uses "" for interface name when the OS cannot resolve an interface number - doing things in a more rusty way could have helped seeing those design issues

Also, matching interfaces to their toolstack-interface (VIF) on Linux is repeated for each network event, and this also cannot work any more when the interface has disappeared: some level of caching should be added for this.

Edited by Yann Dirson