From 177fec0b82d18dc92fe40b51bf1a4a294fb9a7ff Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 17 Dec 2008 09:31:47 -0800 Subject: Revert "Revised version if interface renaming" This reverts commit 3b1779981cd67679dd4cddd70160859ca3d862d7. Conflicts: zebra/rt_netlink.c --- zebra/interface.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'zebra/interface.c') diff --git a/zebra/interface.c b/zebra/interface.c index 74c977a9..dec91297 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -483,6 +483,22 @@ if_delete_update (struct interface *ifp) ifp->ifindex = IFINDEX_INTERNAL; } +/* Quagga daemons don't handle rename, so delete then add */ +void +if_rename (struct interface *ifp, const char *name) +{ + int ifindex = ifp->ifindex; + + if_delete_update(ifp); + listnode_delete (iflist, ifp); + + strncpy(ifp->name, name, INTERFACE_NAMSIZ); + ifp->ifindex = ifindex; + + listnode_add_sort (iflist, ifp); + if_add_update (ifp); +} + /* Interface is up. */ void if_up (struct interface *ifp) -- cgit v1.2.3