Skip to content

NDB loses sync: Removing all IPs from an interface also removes the routes which NDB doesn't recognize #849

Closed
@sirkrypt0

Description

@sirkrypt0

When removing all IPs from an interface, Linux removes all routes associated with that interfaces. NDB does not recognize this and loses sync when trying to remove one of the previously associated routes.

Steps to reproduce

import pyroute2
ndb = pyroute2.NDB()
interface = ndb.interfaces.create(ifname='test', kind='bridge')
interface.set('state', 'up').commit()
interface.add_ip('10.0.0.1/32').commit()
ndb.routes.create(dst='10.0.0.2/32', oif=interface['index']).commit()
interface.del_ip('10.0.0.1/32').commit()
ndb.routes['10.0.0.2/32'].remove().commit()

Running the above script hangs for a while and finally terminates with Exception: lost sync in apply().

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions