1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
From 7f062c217b262e362a3362c677dea6c5e820adf1 Mon Sep 17 00:00:00 2001
From: David Lamparter <equinox@diac24.net>
Date: Mon, 1 Feb 2010 16:41:26 +0100
Subject: [PATCH] zebra: lingering IP address after deletion (BZ#486)
Upstream-status: Backport
zebra address bookkeeping is a mess. this is just a workaround to have
IPv4 address deletion somewhat working on Linux.
the if_unset_prefix call is synchronous, when it returns success the
address deletion completed successfully. this is either signaled by a
netlink ACK or by an OK return value from ioctl().
This version is wrapped by #ifdef HAVE_NETLINK so we don't touch the
BSDs for now.
* zebra/interface.c: On Linux, update zebra internal state after
deleting an address.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
---
zebra/interface.c | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/zebra/interface.c b/zebra/interface.c
index 2242259..3578b79 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -1297,13 +1297,28 @@ ip_address_uninstall (struct vty *vty, struct interface *ifp,
safe_strerror(errno), VTY_NEWLINE);
return CMD_WARNING;
}
+ /* success! call returned that the address deletion went through.
+ * this is a synchronous operation, so we know it succeeded and can
+ * now update all internal state. */
+
+ /* the HAVE_NETLINK check is only here because, on BSD, although the
+ * call above is still synchronous, we get a second confirmation later
+ * through the route socket, and we don't want to touch that behaviour
+ * for now. It should work without the #ifdef, but why take the risk...
+ * -- equinox 2012-07-13 */
+#ifdef HAVE_NETLINK
+
+ /* Remove connected route. */
+ connected_down_ipv4 (ifp, ifc);
-#if 0
/* Redistribute this information. */
zebra_interface_address_delete_update (ifp, ifc);
- /* Remove connected route. */
- connected_down_ipv4 (ifp, ifc);
+ /* IP address propery set. */
+ UNSET_FLAG (ifc->conf, ZEBRA_IFC_REAL);
+
+ /* remove from interface, remark secondaries */
+ if_subnet_delete (ifp, ifc);
/* Free address information. */
listnode_delete (ifp->connected, ifc);
--
1.7.10.4
|