quagga/ripd: Fix two bugs after received SIGHUP signal
PATCH 1/1 quagga/ripd: Fix two bugs after received SIGHUP signal
There are two problems for ripd implementation after received SIGHUP signal:
1). ripd didn't clean up ifp->connected list before reload
configuration file which makes the same advertise packet being sent multiple times(depends on how many SIGHUP was recieved).
2). ripd reset ri->split_horizon flag to RIP_NO_SPLIT_HORIZON
during restart which is different from the flag when ripd is firstly started up, leading to unnecessary route to be advertised.
[YOCTO #5266]
--- .../ripd-fix-two-bugs-after-received-SIGHUP.patch | 49 ++++++++++++++++++++ .../recipes-protocols/quagga/quagga.inc | 3 +- 2 files changed, 51 insertions(+), 1 deletions(-) create mode 100644 meta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patch
meta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patch new file +49 -0
@@ -0,0 +1,49 @@ +ripd: Fix two bugs after received SIGHUP signal + +There are two problems for ripd implementation after received +SIGHUP signal: +1). ripd didn't clean up ifp->connected list before reload + configuration file. +2). ripd reset ri->split_horizon flag to RIP_NO_SPLIT_HORIZON + which lead to the unnecessary route to be advertised. + +Upstream-Status: Pending + +Signed-off-by: Xufeng Zhang <[email protected]> +--- +--- a/ripd/rip_interface.c ++++ b/ripd/rip_interface.c +@@ -500,6 +500,8 @@ + struct listnode *node; + struct interface *ifp; + struct rip_interface *ri; ++ struct connected *ifc; ++ struct listnode *conn_node, *next; + + for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp)) + { +@@ -514,6 +516,13 @@ + thread_cancel (ri->t_wakeup); + ri->t_wakeup = NULL; + } ++ ++ for (conn_node = listhead (ifp->connected); conn_node; conn_node = next) ++ { ++ ifc = listgetdata (conn_node); ++ next = conn_node->next; ++ listnode_delete (ifp->connected, ifc); ++ } + } + } + +@@ -548,8 +557,8 @@ + ri->key_chain = NULL; + } + +- ri->split_horizon = RIP_NO_SPLIT_HORIZON; +- ri->split_horizon_default = RIP_NO_SPLIT_HORIZON; ++ ri->split_horizon = RIP_SPLIT_HORIZON; ++ ri->split_horizon_default = RIP_SPLIT_HORIZON; + + ri->list[RIP_FILTER_IN] = NULL; + ri->list[RIP_FILTER_OUT] = NULL;
meta-networking/recipes-protocols/quagga/quagga.inc +2 -1
@@ -31,7 +31,8 @@ SRC_URI = "http://download.savannah.gnu.org/releases/quagga${QUAGGASUBDIR}/quagg file://quagga.default \ file://watchquagga.init \ file://watchquagga.default \ - file://volatiles.03_quagga" + file://volatiles.03_quagga \ + file://ripd-fix-two-bugs-after-received-SIGHUP.patch" PACKAGECONFIG ??= "" PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap"
Signature · 1 line
1.7.0.2
Quoted 6 lines · Xufeng Zhang
There are two problems for ripd implementation after received SIGHUP signal:
1). ripd didn't clean upifp->connectedlist before reload
configuration file which makes the same advertise packet being sent multiple times(depends on how many SIGHUP was recieved).
More comment:
Generally this connected interface address stuff is cleaned up in rip_interface_address_delete() which is triggered by zsend_interface_address(), but just as the annotation said above zsend_interface_address() function in zebra/zserv.c, ZEBRA_INTERFACE_ADDRESS_DELETE message could only happens in two cases:
1). ip address uninstall
2). RTM_NEWADDR on routing/netlink socket
It didn't take the SIGHUP signal into consideration, but since the SIGHUP is handled by every daemon independently, this cleanup is not easy to be implemented commonly, so I think this is a proper way to do this.
Thanks,
Xufeng
Quoted 83 lines
2). ripd reset
ri->split_horizonflag toRIP_NO_SPLIT_HORIZON
during restart which is different from the flag when ripd is firstly started up, leading to unnecessary route to be advertised.[YOCTO #5266]
Signed-off-by Xufeng Zhang<[email protected]>--- .../ripd-fix-two-bugs-after-received-SIGHUP.patch | 49 ++++++++++++++++++++ .../recipes-protocols/quagga/quagga.inc | 3 +- 2 files changed, 51 insertions(+), 1 deletions(-)create mode 100644
meta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patchmeta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patch new file +49
-0@@ -0,0 +1,49 @@ +ripd: Fix two bugs after received SIGHUP signal + +There are two problems for ripd implementation after received +SIGHUP signal: +1). ripd didn't clean up ifp->connected list before reload + configuration file. +2). ripd reset ri->split_horizon flag to RIP_NO_SPLIT_HORIZON + which lead to the unnecessary route to be advertised. + +Upstream-Status: Pending + +Signed-off-by: Xufeng Zhang<[email protected]> +--- +--- a/ripd/rip_interface.c ++++ b/ripd/rip_interface.c +@@ -500,6 +500,8 @@ + struct listnode *node; + struct interface *ifp; + struct rip_interface *ri; ++ struct connected *ifc; ++ struct listnode *conn_node, *next; + + for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp)) + { +@@ -514,6 +516,13 @@ + thread_cancel (ri->t_wakeup); + ri->t_wakeup = NULL; + } ++ ++ for (conn_node = listhead (ifp->connected); conn_node; conn_node = next) ++ { ++ ifc = listgetdata (conn_node); ++ next = conn_node->next; ++ listnode_delete (ifp->connected, ifc); ++ } + } + } + +@@ -548,8 +557,8 @@ + ri->key_chain = NULL; + } + +- ri->split_horizon = RIP_NO_SPLIT_HORIZON; +- ri->split_horizon_default = RIP_NO_SPLIT_HORIZON; ++ ri->split_horizon = RIP_SPLIT_HORIZON; ++ ri->split_horizon_default = RIP_SPLIT_HORIZON; + + ri->list[RIP_FILTER_IN] = NULL; + ri->list[RIP_FILTER_OUT] = NULL;meta-networking/recipes-protocols/quagga/quagga.inc +2
-1@@ -31,7 +31,8 @@ SRC_URI = "http://download.savannah.gnu.org/releases/quagga${QUAGGASUBDIR}/quagg file://quagga.default \ file://watchquagga.init \ file://watchquagga.default \ - file://volatiles.03_quagga" + file://volatiles.03_quagga \ + file://ripd-fix-two-bugs-after-received-SIGHUP.patch" PACKAGECONFIG ??= "" PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap"
Quoted 10 lines · [[oe] [OE] [PATCH meta-networking] quagga/ripd: Fix two bugs after received…
There are two problems for ripd implementation after received SIGHUP signal:
1). ripd didn't clean upifp->connectedlist before reload
configuration file which makes the same advertise packet being sent multiple times(depends on how many SIGHUP was recieved).
2). ripd resetri->split_horizonflag toRIP_NO_SPLIT_HORIZON
during restart which is different from the flag when ripd is firstly started up, leading to unnecessary route to be advertised.[YOCTO #5266]
Hey Xufeng,
Normally I wouldn't go this deep into the detail but since you referenced the Yocto bug and the Quagga discussion in the commit log and the bug itself, I thought I'd try to understand what's going on here. The last thing I saw from the Quagga maintainer is this:
The ifp->connected list contains connected prefixes of a given interface. These exist regardless of particular routing protocols and emptying the list during ripd reconfiguration would be plain wrong. I allow for a chance there is a bug that is related to ifp->connected and SIGHUP handling at once, but not in this specific way.
and it looks like the patch here is the same as the one that the maintainer indicated is "plain wrong". Can you help me get some confidence that this isn't going to have negative side-effects if we integrate it?
-J.
Quoted 77 lines
Signed-off-by Xufeng Zhang <[email protected]>--- .../ripd-fix-two-bugs-after-received-SIGHUP.patch | 49 ++++++++++++++++++++ .../recipes-protocols/quagga/quagga.inc | 3 +- 2 files changed, 51 insertions(+), 1 deletions(-) create mode 100644 meta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patchmeta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patch new file +49
-0@@ -0,0 +1,49 @@ +ripd: Fix two bugs after received SIGHUP signal + +There are two problems for ripd implementation after received +SIGHUP signal: +1). ripd didn't clean up ifp->connected list before reload + configuration file. +2). ripd reset ri->split_horizon flag to RIP_NO_SPLIT_HORIZON + which lead to the unnecessary route to be advertised. + +Upstream-Status: Pending + +Signed-off-by: Xufeng Zhang <[email protected]> +--- +--- a/ripd/rip_interface.c ++++ b/ripd/rip_interface.c +@@ -500,6 +500,8 @@ + struct listnode *node; + struct interface *ifp; + struct rip_interface *ri; ++ struct connected *ifc; ++ struct listnode *conn_node, *next; + + for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp)) + { +@@ -514,6 +516,13 @@ + thread_cancel (ri->t_wakeup); + ri->t_wakeup = NULL; + } ++ ++ for (conn_node = listhead (ifp->connected); conn_node; conn_node = next) ++ { ++ ifc = listgetdata (conn_node); ++ next = conn_node->next; ++ listnode_delete (ifp->connected, ifc); ++ } + } + } + +@@ -548,8 +557,8 @@ + ri->key_chain = NULL; + } + +- ri->split_horizon = RIP_NO_SPLIT_HORIZON; +- ri->split_horizon_default = RIP_NO_SPLIT_HORIZON; ++ ri->split_horizon = RIP_SPLIT_HORIZON; ++ ri->split_horizon_default = RIP_SPLIT_HORIZON; + + ri->list[RIP_FILTER_IN] = NULL; + ri->list[RIP_FILTER_OUT] = NULL;meta-networking/recipes-protocols/quagga/quagga.inc +2
-1@@ -31,7 +31,8 @@ SRC_URI = "http://download.savannah.gnu.org/releases/quagga${QUAGGASUBDIR}/quagg file://quagga.default \ file://watchquagga.init \ file://watchquagga.default \ - file://volatiles.03_quagga" + file://volatiles.03_quagga \ + file://ripd-fix-two-bugs-after-received-SIGHUP.patch" PACKAGECONFIG ??= "" PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap"
Signature · 2 lines
-Joe MacDonald. :wq
Quoted 21 lines · Joe MacDonald
Quoted 11 lines · [[oe] [OE] [PATCH meta-networking] quagga/ripd: Fix two bugs after received…
There are two problems for ripd implementation after received SIGHUP signal:
1). ripd didn't clean upifp->connectedlist before reload
configuration file which makes the same advertise packet being sent multiple times(depends on how many SIGHUP was recieved).
2). ripd resetri->split_horizonflag toRIP_NO_SPLIT_HORIZON
during restart which is different from the flag when ripd is firstly started up, leading to unnecessary route to be advertised.[YOCTO #5266]
Hey Xufeng,
Normally I wouldn't go this deep into the detail but since you referenced the Yocto bug and the Quagga discussion in the commit log and the bug itself, I thought I'd try to understand what's going on here. The last thing I saw from the Quagga maintainer is this:
Quoted 6 lines
The
ifp->connectedlist contains connected prefixes of a given interface. These exist regardless of particular routing protocols and emptying the list during ripd reconfiguration would be plain wrong. I allow for a chance there is a bug that is related toifp->connectedand SIGHUP handling at once, but not in this specific way.
What he said is that this ifp->connected list is exist in all routing protocols, and if it needs cleanup, it should be done in a more general way, such as
in zebra client which is independent of routing protocol.
But I have specified the reasons in the above email that why it's not easy to implement this general way:
#########################################
More comments:
Generally this connected interface address stuff is cleaned up in rip_interface_address_delete() which is triggered by zsend_interface_address(), but just as the annotation said above zsend_interface_address() function in zebra/zserv.c, ZEBRA_INTERFACE_ADDRESS_DELETE message could only happens in two cases:
1). ip address uninstall
2). RTM_NEWADDR on routing/netlink socket
It didn't take the SIGHUP signal into consideration, but since the SIGHUP is handled by every daemon independently, this cleanup is not easy to be implemented commonly, so I think this is a proper way to do this.
#########################################
So it needs to redesign a lot of stuff to implement this.
Quoted 6 lines
and it looks like the patch here is the same as the one that the maintainer indicated is "plain wrong".
Can you help me get some
confidence that this isn't going to have negative side-effects if we integrate it?
Yes, there should be no side-effects:
1. This modification is only going into ripd daemon and it only takes effect when ripd is restarting.
2. The fix for problem 1). just remove the previously connected addresses of the interface, and these connected addresses list will be reconstructed when ripd read the
configuration during restarting.
3. The fix for problem 2). definitely has not any side-effect because I just restore the horizon flag to the values when ripd daemon is firstly start up.
And the customer has already test the fix for a lot of times, no problem is found.
Thanks,
Xufeng
Quoted 87 lines
-J.
Quoted 84 lines
Signed-off-by Xufeng Zhang<[email protected]>--- .../ripd-fix-two-bugs-after-received-SIGHUP.patch | 49 ++++++++++++++++++++ .../recipes-protocols/quagga/quagga.inc | 3 +- 2 files changed, 51 insertions(+), 1 deletions(-)create mode 100644
meta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patchmeta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patch new file +49
-0@@ -0,0 +1,49 @@ +ripd: Fix two bugs after received SIGHUP signal + +There are two problems for ripd implementation after received +SIGHUP signal: +1). ripd didn't clean up ifp->connected list before reload + configuration file. +2). ripd reset ri->split_horizon flag to RIP_NO_SPLIT_HORIZON + which lead to the unnecessary route to be advertised. + +Upstream-Status: Pending + +Signed-off-by: Xufeng Zhang<[email protected]> +--- +--- a/ripd/rip_interface.c ++++ b/ripd/rip_interface.c +@@ -500,6 +500,8 @@ + struct listnode *node; + struct interface *ifp; + struct rip_interface *ri; ++ struct connected *ifc; ++ struct listnode *conn_node, *next; + + for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp)) + { +@@ -514,6 +516,13 @@ + thread_cancel (ri->t_wakeup); + ri->t_wakeup = NULL; + } ++ ++ for (conn_node = listhead (ifp->connected); conn_node; conn_node = next) ++ { ++ ifc = listgetdata (conn_node); ++ next = conn_node->next; ++ listnode_delete (ifp->connected, ifc); ++ } + } + } + +@@ -548,8 +557,8 @@ + ri->key_chain = NULL; + } + +- ri->split_horizon = RIP_NO_SPLIT_HORIZON; +- ri->split_horizon_default = RIP_NO_SPLIT_HORIZON; ++ ri->split_horizon = RIP_SPLIT_HORIZON; ++ ri->split_horizon_default = RIP_SPLIT_HORIZON; + + ri->list[RIP_FILTER_IN] = NULL; + ri->list[RIP_FILTER_OUT] = NULL;meta-networking/recipes-protocols/quagga/quagga.inc +2
-1@@ -31,7 +31,8 @@ SRC_URI = "http://download.savannah.gnu.org/releases/quagga${QUAGGASUBDIR}/quagg file://quagga.default \ file://watchquagga.init \ file://watchquagga.default \ - file://volatiles.03_quagga" + file://volatiles.03_quagga \ + file://ripd-fix-two-bugs-after-received-SIGHUP.patch" PACKAGECONFIG ??= "" PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap"_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Quoted 25 lines · [Re: [oe] [OE] [PATCH meta-networking] quagga/ripd: Fix two bugs after…
Quoted 19 lines · Joe MacDonald
Quoted 10 lines · [[oe] [OE] [PATCH meta-networking] quagga/ripd: Fix two bugs after received…
There are two problems for ripd implementation after received SIGHUP signal:
1). ripd didn't clean upifp->connectedlist before reload
configuration file which makes the same advertise packet being sent multiple times(depends on how many SIGHUP was recieved).
2). ripd resetri->split_horizonflag toRIP_NO_SPLIT_HORIZON
during restart which is different from the flag when ripd is firstly started up, leading to unnecessary route to be advertised.[YOCTO #5266]
Hey Xufeng,
Normally I wouldn't go this deep into the detail but since you referenced the Yocto bug and the Quagga discussion in the commit log and the bug itself, I thought I'd try to understand what's going on here. The last thing I saw from the Quagga maintainer is this:
Quoted 5 lines
The
ifp->connectedlist contains connected prefixes of a given interface. These exist regardless of particular routing protocols and emptying the list during ripd reconfiguration would be plain wrong. I allow for a chance there is a bug that is related toifp->connectedand SIGHUP handling at once, but not in this specific way.
Quoted 4 lines
What he said is that this
ifp->connectedlist is exist in all routing protocols,
and if it needs cleanup, it should be done in a more general way, such as in zebra client which is independent of routing protocol.
I'm not sure that's the interpretation I would have taken from the quoted text, but if what you indicate is what the maintainer meant, then is he not saying that the SIGHUP handling issue also exists for other routing daemons in the suite? Are you saying a similar patch would then be required for potentially all daemons in quagga?
Don't get me wrong, repairing one is better than repairing none, but on my first read of his comments it didn't seem like the maintainer even agreed that there was a bug at all and your interpretation suggests that the same bug likely impacts all quagga daemons. Any sense on whether that's the case?
-J.
Quoted 135 lines
But I have specified the reasons in the above email that why it's not easy to
implement this general way:
#########################################
More comments:
Generally this connected interface address stuff is cleaned up inrip_interface_address_delete()
which is triggered byzsend_interface_address(), but just as the annotation said abovezsend_interface_address()function inzebra/zserv.c,ZEBRA_INTERFACE_ADDRESS_DELETE
message could only happens in two cases:
1). ip address uninstall
2).RTM_NEWADDRon routing/netlink socketIt didn't take the SIGHUP signal into consideration, but since the SIGHUP is handled
by every daemon independently, this cleanup is not easy to be implemented commonly,
so I think this is a proper way to do this.
#########################################
So it needs to redesign a lot of stuff to implement this.Quoted 5 lines
and it looks like the patch here is the same as the one that the maintainer indicated is "plain wrong".
Can you help me get some
confidence that this isn't going to have negative side-effects if we integrate it?Yes, there should be no side-effects:
1. This modification is only going into ripd daemon and it only takes effect when ripd is restarting.
2. The fix for problem 1). just remove the previously connected addresses of the interface, and these
connected addresses list will be reconstructed when ripd read
the configuration during restarting.
3. The fix for problem 2). definitely has not any side-effect because I just restore the horizon flag to
the values when ripd daemon is firstly start up.And the customer has already test the fix for a lot of times, no problem is found.
Thanks,
XufengQuoted 76 lines
-J.
Quoted 74 lines
Signed-off-by Xufeng Zhang<[email protected]>--- .../ripd-fix-two-bugs-after-received-SIGHUP.patch | 49 ++++++++++++++++++++ .../recipes-protocols/quagga/quagga.inc | 3 +- 2 files changed, 51 insertions(+), 1 deletions(-) create mode 100644 meta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patchmeta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patch new file +49
-0@@ -0,0 +1,49 @@ +ripd: Fix two bugs after received SIGHUP signal + +There are two problems for ripd implementation after received +SIGHUP signal: +1). ripd didn't clean up ifp->connected list before reload + configuration file. +2). ripd reset ri->split_horizon flag to RIP_NO_SPLIT_HORIZON + which lead to the unnecessary route to be advertised. + +Upstream-Status: Pending + +Signed-off-by: Xufeng Zhang<[email protected]> +--- +--- a/ripd/rip_interface.c ++++ b/ripd/rip_interface.c +@@ -500,6 +500,8 @@ + struct listnode *node; + struct interface *ifp; + struct rip_interface *ri; ++ struct connected *ifc; ++ struct listnode *conn_node, *next; + + for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp)) + { +@@ -514,6 +516,13 @@ + thread_cancel (ri->t_wakeup); + ri->t_wakeup = NULL; + } ++ ++ for (conn_node = listhead (ifp->connected); conn_node; conn_node = next) ++ { ++ ifc = listgetdata (conn_node); ++ next = conn_node->next; ++ listnode_delete (ifp->connected, ifc); ++ } + } + } + +@@ -548,8 +557,8 @@ + ri->key_chain = NULL; + } + +- ri->split_horizon = RIP_NO_SPLIT_HORIZON; +- ri->split_horizon_default = RIP_NO_SPLIT_HORIZON; ++ ri->split_horizon = RIP_SPLIT_HORIZON; ++ ri->split_horizon_default = RIP_SPLIT_HORIZON; + + ri->list[RIP_FILTER_IN] = NULL; + ri->list[RIP_FILTER_OUT] = NULL;meta-networking/recipes-protocols/quagga/quagga.inc +2
-1@@ -31,7 +31,8 @@ SRC_URI = "http://download.savannah.gnu.org/releases/quagga${QUAGGASUBDIR}/quagg file://quagga.default \ file://watchquagga.init \ file://watchquagga.default \ - file://volatiles.03_quagga" + file://volatiles.03_quagga \ + file://ripd-fix-two-bugs-after-received-SIGHUP.patch"Quoted 8 lines
Quoted 8 lines
meta-networking/recipes-protocols/quagga/quagga.inc +0
-0PACKAGECONFIG ??= "" PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap"_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Signature · 2 lines
-Joe MacDonald. :wq
Quoted 37 lines · Joe MacDonald
Quoted 29 lines · [Re: [oe] [OE] [PATCH meta-networking] quagga/ripd: Fix two bugs after…
Quoted 21 lines · Joe MacDonald
Quoted 11 lines · [[oe] [OE] [PATCH meta-networking] quagga/ripd: Fix two bugs after received…
There are two problems for ripd implementation after received SIGHUP signal:
1). ripd didn't clean upifp->connectedlist before reload
configuration file which makes the same advertise packet being sent multiple times(depends on how many SIGHUP was recieved).
2). ripd resetri->split_horizonflag toRIP_NO_SPLIT_HORIZON
during restart which is different from the flag when ripd is firstly started up, leading to unnecessary route to be advertised.[YOCTO #5266]
Hey Xufeng,
Normally I wouldn't go this deep into the detail but since you referenced the Yocto bug and the Quagga discussion in the commit log and the bug itself, I thought I'd try to understand what's going on here. The last thing I saw from the Quagga maintainer is this:
Quoted 6 lines
The
ifp->connectedlist contains connected prefixes of a given interface. These exist regardless of particular routing protocols and emptying the list during ripd reconfiguration would be plain wrong. I allow for a chance there is a bug that is related toifp->connectedand SIGHUP handling at once, but not in this specific way.Quoted 5 lines
What he said is that this
ifp->connectedlist is exist in all routing protocols,
and if it needs cleanup, it should be done in a more general way, such as in zebra client which is independent of routing protocol.
Quoted 4 lines
I'm not sure that's the interpretation I would have taken from the quoted text, but if what you indicate is what the maintainer meant, then is he not saying that the SIGHUP handling issue also exists for other routing daemons in the suite?
quoted the sentence:
"
The ifp->connected list contains connected prefixes of a given interface. These exist regardless of particular routing protocols and emptying the list during ripd reconfiguration would be plain wrong.
"
All the other daemons also refer to the ifp->connected list, and I have checked the SIGHUP handler code of all daemons, except ospfd and ospf6d(they only print a log when SIGHUP is received), all the other daemons suffer the same problem as ripd since they reload the configuration file.
Quoted 3 lines
Are you saying a similar patch would then be required for potentially all daemons in quagga?
Not all.
Quoted 6 lines
Don't get me wrong, repairing one is better than repairing none, but on my first read of his comments it didn't seem like the maintainer even agreed that there was a bug at all and your interpretation suggests that the same bug likely impacts all quagga daemons. Any sense on whether that's the case?
"
I allow for a chance there is a bug that is related to ifp->connected and SIGHUP handling at once, but not in this specific way.
"
My understanding is that if there is a bug related to ifp->connected, we should not fix in such specific way. Yes, the maintainer didn't agree that there is really a bug here, but this is really a abnormal behavior:
every time when SIGHUP is received, the same address is appended to ifp->connected list over and over again, so if too much SIGHUP are received, there will be a flood for the advertised packets.
Thanks,
Xufeng
Quoted 144 lines
-J.
Quoted 140 lines
But I have specified the reasons in the above email that why it's not easy to
implement this general way:
#########################################
More comments:
Generally this connected interface address stuff is cleaned up inrip_interface_address_delete()
which is triggered byzsend_interface_address(), but just as the annotation said abovezsend_interface_address()function inzebra/zserv.c,ZEBRA_INTERFACE_ADDRESS_DELETE
message could only happens in two cases:
1). ip address uninstall
2).RTM_NEWADDRon routing/netlink socketIt didn't take the SIGHUP signal into consideration, but since the SIGHUP is handled
by every daemon independently, this cleanup is not easy to be implemented commonly,
so I think this is a proper way to do this.
#########################################
So it needs to redesign a lot of stuff to implement this.Quoted 6 lines
and it looks like the patch here is the same as the one that the maintainer indicated is "plain wrong".
Can you help me get some
confidence that this isn't going to have negative side-effects if we integrate it?Yes, there should be no side-effects:
1. This modification is only going into ripd daemon and it only takes effect when ripd is restarting.
2. The fix for problem 1). just remove the previously connected addresses of the interface, and these
connected addresses list will be reconstructed when ripd read
the configuration during restarting.
3. The fix for problem 2). definitely has not any side-effect because I just restore the horizon flag to
the values when ripd daemon is firstly start up.And the customer has already test the fix for a lot of times, no problem is found.
Thanks,
XufengQuoted 81 lines
-J.
Quoted 78 lines
Signed-off-by Xufeng Zhang<[email protected]>--- .../ripd-fix-two-bugs-after-received-SIGHUP.patch | 49 ++++++++++++++++++++ .../recipes-protocols/quagga/quagga.inc | 3 +- 2 files changed, 51 insertions(+), 1 deletions(-)create mode 100644
meta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patchmeta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patch new file +49
-0@@ -0,0 +1,49 @@ +ripd: Fix two bugs after received SIGHUP signal + +There are two problems for ripd implementation after received +SIGHUP signal: +1). ripd didn't clean up ifp->connected list before reload + configuration file. +2). ripd reset ri->split_horizon flag to RIP_NO_SPLIT_HORIZON + which lead to the unnecessary route to be advertised. + +Upstream-Status: Pending + +Signed-off-by: Xufeng Zhang<[email protected]> +--- +--- a/ripd/rip_interface.c ++++ b/ripd/rip_interface.c +@@ -500,6 +500,8 @@ + struct listnode *node; + struct interface *ifp; + struct rip_interface *ri; ++ struct connected *ifc; ++ struct listnode *conn_node, *next; + + for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp)) + { +@@ -514,6 +516,13 @@ + thread_cancel (ri->t_wakeup); + ri->t_wakeup = NULL; + } ++ ++ for (conn_node = listhead (ifp->connected); conn_node; conn_node = next) ++ { ++ ifc = listgetdata (conn_node); ++ next = conn_node->next; ++ listnode_delete (ifp->connected, ifc); ++ } + } + } + +@@ -548,8 +557,8 @@ + ri->key_chain = NULL; + } + +- ri->split_horizon = RIP_NO_SPLIT_HORIZON; +- ri->split_horizon_default = RIP_NO_SPLIT_HORIZON; ++ ri->split_horizon = RIP_SPLIT_HORIZON; ++ ri->split_horizon_default = RIP_SPLIT_HORIZON; + + ri->list[RIP_FILTER_IN] = NULL; + ri->list[RIP_FILTER_OUT] = NULL;meta-networking/recipes-protocols/quagga/quagga.inc +2
-1@@ -31,7 +31,8 @@ SRC_URI = "http://download.savannah.gnu.org/releases/quagga${QUAGGASUBDIR}/quagg file://quagga.default \ file://watchquagga.init \ file://watchquagga.default \ - file://volatiles.03_quagga" + file://volatiles.03_quagga \ + file://ripd-fix-two-bugs-after-received-SIGHUP.patch" PACKAGECONFIG ??= "" PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap"Quoted 5 lines
Quoted 5 lines
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Hi Xufeng,
Quoted 49 lines · [Re: [oe] [OE] [PATCH meta-networking] quagga/ripd: Fix two bugs after…
Quoted 27 lines · Joe MacDonald
Quoted 25 lines · [Re: [oe] [OE] [PATCH meta-networking] quagga/ripd: Fix two bugs after…
Quoted 24 lines · Joe MacDonald
Quoted 10 lines · [[oe] [OE] [PATCH meta-networking] quagga/ripd: Fix two bugs after received…
There are two problems for ripd implementation after received SIGHUP signal:
1). ripd didn't clean upifp->connectedlist before reload
configuration file which makes the same advertise packet being sent multiple times(depends on how many SIGHUP was recieved).
2). ripd resetri->split_horizonflag toRIP_NO_SPLIT_HORIZON
during restart which is different from the flag when ripd is firstly started up, leading to unnecessary route to be advertised.[YOCTO #5266]
Hey Xufeng,
Normally I wouldn't go this deep into the detail but since you referenced the Yocto bug and the Quagga discussion in the commit log and the bug itself, I thought I'd try to understand what's going on here. The last thing I saw from the Quagga maintainer is this:
The
ifp->connectedlist contains connected prefixes of a given interface. These exist regardless of particular routing protocols and emptying the list during ripd reconfiguration would be plain wrong. I allow for a chance there is a bug that is related toifp->connectedand SIGHUP handling at once, but not in this specific way.Quoted 8 lines
Quoted 4 lines
What he said is that this
ifp->connectedlist is exist in all routing protocols,
and if it needs cleanup, it should be done in a more general way, such as in zebra client which is independent of routing protocol.I'm not sure that's the interpretation I would have taken from the quoted text, but if what you indicate is what the maintainer meant, then is he not saying that the SIGHUP handling issue also exists for other routing daemons in the suite?
quoted the sentence:
"The
ifp->connectedlist contains connected prefixes of a given interface. These exist regardless of particular routing protocols and emptying the list during ripd reconfiguration would be plain wrong."
All the other daemons also refer to theifp->connectedlist, and I have checked the SIGHUP handler code of all daemons, except ospfd and ospf6d(they only print a log when SIGHUP is received), all the other daemons suffer the same problem as ripd since
they reload the configuration file.
Quoted 3 lines
Quoted 2 lines
Are you saying a similar patch would then be required for potentially all daemons in quagga?
Not all.
Six of eight, then. ;-) Nine, if watchquagga also contains dodgy SIGHUP handler code, but it probably doesn't care about the connected list.
Quoted 9 lines
Quoted 5 lines
Don't get me wrong, repairing one is better than repairing none, but on my first read of his comments it didn't seem like the maintainer even agreed that there was a bug at all and your interpretation suggests that the same bug likely impacts all quagga daemons. Any sense on whether that's the case?
"
I allow for a chance there is a bug that is related to
ifp->connectedand SIGHUP handling at once, but not in this specific way.
Quoted 9 lines
"
My understanding is that if there is a bug related toifp->connected, we should not fix in such specific way. Yes, the maintainer didn't agree that there is really a bug here, but this is really a abnormal behavior:
every time when SIGHUP is received, the same address is appended toifp->connectedlist over and over again,
so if too much SIGHUP are received, there will be a flood for the advertised packets.
Okay, so given that, I'm inclined to merge this set with a note in the upstream-status in the patch indicating it is unlikely to be merged. How about "Submitted" with a footnote pointing at the discussion thread?
Do you think it'd be possible to provide similar patches for the other daemons that suffer this problem? I'll take the current submission, but if you had time to do a follow-up later on for the other daemons, that'd be great.
Thanks,
-J.
Quoted 142 lines
Thanks,
XufengQuoted 136 lines
-J.
Quoted 134 lines
But I have specified the reasons in the above email that why it's not easy to
implement this general way:
#########################################
More comments:
Generally this connected interface address stuff is cleaned up inrip_interface_address_delete()
which is triggered byzsend_interface_address(), but just as the annotation said abovezsend_interface_address()function inzebra/zserv.c,ZEBRA_INTERFACE_ADDRESS_DELETE
message could only happens in two cases:
1). ip address uninstall
2).RTM_NEWADDRon routing/netlink socketIt didn't take the SIGHUP signal into consideration, but since the SIGHUP is handled
by every daemon independently, this cleanup is not easy to be implemented commonly,
so I think this is a proper way to do this.
#########################################
So it needs to redesign a lot of stuff to implement this.Quoted 5 lines
and it looks like the patch here is the same as the one that the maintainer indicated is "plain wrong".
Can you help me get some
confidence that this isn't going to have negative side-effects if we integrate it?Yes, there should be no side-effects:
1. This modification is only going into ripd daemon and it only takes effect when ripd is restarting.
2. The fix for problem 1). just remove the previously connected addresses of the interface, and these
connected addresses list will be reconstructed when ripd read
the configuration during restarting.
3. The fix for problem 2). definitely has not any side-effect because I just restore the horizon flag to
the values when ripd daemon is firstly start up.And the customer has already test the fix for a lot of times, no problem is found.
Thanks,
XufengQuoted 76 lines
-J.
Quoted 74 lines
Signed-off-by Xufeng Zhang<[email protected]>--- .../ripd-fix-two-bugs-after-received-SIGHUP.patch | 49 ++++++++++++++++++++ .../recipes-protocols/quagga/quagga.inc | 3 +- 2 files changed, 51 insertions(+), 1 deletions(-) create mode 100644 meta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patchmeta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patch new file +49
-0@@ -0,0 +1,49 @@ +ripd: Fix two bugs after received SIGHUP signal + +There are two problems for ripd implementation after received +SIGHUP signal: +1). ripd didn't clean up ifp->connected list before reload + configuration file. +2). ripd reset ri->split_horizon flag to RIP_NO_SPLIT_HORIZON + which lead to the unnecessary route to be advertised. + +Upstream-Status: Pending + +Signed-off-by: Xufeng Zhang<[email protected]> +--- +--- a/ripd/rip_interface.c ++++ b/ripd/rip_interface.c +@@ -500,6 +500,8 @@ + struct listnode *node; + struct interface *ifp; + struct rip_interface *ri; ++ struct connected *ifc; ++ struct listnode *conn_node, *next; + + for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp)) + { +@@ -514,6 +516,13 @@ + thread_cancel (ri->t_wakeup); + ri->t_wakeup = NULL; + } ++ ++ for (conn_node = listhead (ifp->connected); conn_node; conn_node = next) ++ { ++ ifc = listgetdata (conn_node); ++ next = conn_node->next; ++ listnode_delete (ifp->connected, ifc); ++ } + } + } + +@@ -548,8 +557,8 @@ + ri->key_chain = NULL; + } + +- ri->split_horizon = RIP_NO_SPLIT_HORIZON; +- ri->split_horizon_default = RIP_NO_SPLIT_HORIZON; ++ ri->split_horizon = RIP_SPLIT_HORIZON; ++ ri->split_horizon_default = RIP_SPLIT_HORIZON; + + ri->list[RIP_FILTER_IN] = NULL; + ri->list[RIP_FILTER_OUT] = NULL;meta-networking/recipes-protocols/quagga/quagga.inc +2
-1@@ -31,7 +31,8 @@ SRC_URI = "http://download.savannah.gnu.org/releases/quagga${QUAGGASUBDIR}/quagg file://quagga.default \ file://watchquagga.init \ file://watchquagga.default \ - file://volatiles.03_quagga" + file://volatiles.03_quagga \ + file://ripd-fix-two-bugs-after-received-SIGHUP.patch"Quoted 8 lines
Quoted 8 lines
meta-networking/recipes-protocols/quagga/quagga.inc +0
-0PACKAGECONFIG ??= "" PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap"_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Signature · 2 lines
-Joe MacDonald. :wq
Quoted 93 lines · Joe MacDonald
Hi Xufeng,
Quoted 58 lines · [Re: [oe] [OE] [PATCH meta-networking] quagga/ripd: Fix two bugs after…
Quoted 37 lines · Joe MacDonald
Quoted 29 lines · [Re: [oe] [OE] [PATCH meta-networking] quagga/ripd: Fix two bugs after…
Quoted 21 lines · Joe MacDonald
Quoted 11 lines · [[oe] [OE] [PATCH meta-networking] quagga/ripd: Fix two bugs after received…
There are two problems for ripd implementation after received SIGHUP signal:
1). ripd didn't clean upifp->connectedlist before reload
configuration file which makes the same advertise packet being sent multiple times(depends on how many SIGHUP was recieved).
2). ripd resetri->split_horizonflag toRIP_NO_SPLIT_HORIZON
during restart which is different from the flag when ripd is firstly started up, leading to unnecessary route to be advertised.[YOCTO #5266]
Hey Xufeng,
Normally I wouldn't go this deep into the detail but since you referenced the Yocto bug and the Quagga discussion in the commit log and the bug itself, I thought I'd try to understand what's going on here. The last thing I saw from the Quagga maintainer is this:
Quoted 6 lines
The
ifp->connectedlist contains connected prefixes of a given interface. These exist regardless of particular routing protocols and emptying the list during ripd reconfiguration would be plain wrong. I allow for a chance there is a bug that is related toifp->connectedand SIGHUP handling at once, but not in this specific way.Quoted 5 lines
What he said is that this
ifp->connectedlist is exist in all routing protocols,
and if it needs cleanup, it should be done in a more general way, such as in zebra client which is independent of routing protocol.Quoted 5 lines
I'm not sure that's the interpretation I would have taken from the quoted text, but if what you indicate is what the maintainer meant, then is he not saying that the SIGHUP handling issue also exists for other routing daemons in the suite?
quoted the sentence:
"The
ifp->connectedlist contains connected prefixes of a given interface. These exist regardless of particular routing protocols and emptying the list during ripd reconfiguration would be plain wrong."
All the other daemons also refer to theifp->connectedlist, and I have checked the SIGHUP handler code of all daemons, except ospfd and ospf6d(they only print a log when SIGHUP is received), all the other daemons suffer the same problem as ripd since
they reload the configuration file.Quoted 5 lines
Quoted 3 lines
Are you saying a similar patch would then be required for potentially all daemons in quagga?
Not all.
Six of eight, then. ;-) Nine, if watchquagga also contains dodgy SIGHUP handler code, but it probably doesn't care about the connected list.
Quoted 10 lines
Quoted 6 lines
Don't get me wrong, repairing one is better than repairing none, but on my first read of his comments it didn't seem like the maintainer even agreed that there was a bug at all and your interpretation suggests that the same bug likely impacts all quagga daemons. Any sense on whether that's the case?
"
I allow for a chance there is a bug that is related to
ifp->connectedand SIGHUP handling at once, but not in this specific way.Quoted 10 lines
"
My understanding is that if there is a bug related toifp->connected, we should not fix in such specific way. Yes, the maintainer didn't agree that there is really a bug here, but this is really a abnormal behavior:
every time when SIGHUP is received, the same address is appended toifp->connectedlist over and over again,
so if too much SIGHUP are received, there will be a flood for the advertised packets.
Quoted 4 lines
Okay, so given that, I'm inclined to merge this set with a note in the upstream-status in the patch indicating it is unlikely to be merged. How about "Submitted" with a footnote pointing at the discussion thread?
I think it's fine.
Do I need to send V2 patch?
Quoted 5 lines
Do you think it'd be possible to provide similar patches for the other daemons that suffer this problem? I'll take the current submission, but if you had time to do a follow-up later on for the other daemons, that'd be great.
Ok, I'll do this job for the other daemons.
Thanks a lot for the review!
Thanks,
Xufeng
Quoted 154 lines
Thanks,
-J.Quoted 149 lines
Thanks,
XufengQuoted 143 lines
-J.
Quoted 140 lines
But I have specified the reasons in the above email that why it's not easy to
implement this general way:
#########################################
More comments:
Generally this connected interface address stuff is cleaned up inrip_interface_address_delete()
which is triggered byzsend_interface_address(), but just as the annotation said abovezsend_interface_address()function inzebra/zserv.c,ZEBRA_INTERFACE_ADDRESS_DELETE
message could only happens in two cases:
1). ip address uninstall
2).RTM_NEWADDRon routing/netlink socketIt didn't take the SIGHUP signal into consideration, but since the SIGHUP is handled
by every daemon independently, this cleanup is not easy to be implemented commonly,
so I think this is a proper way to do this.
#########################################
So it needs to redesign a lot of stuff to implement this.Quoted 6 lines
and it looks like the patch here is the same as the one that the maintainer indicated is "plain wrong".
Can you help me get some
confidence that this isn't going to have negative side-effects if we integrate it?Yes, there should be no side-effects:
1. This modification is only going into ripd daemon and it only takes effect when ripd is restarting.
2. The fix for problem 1). just remove the previously connected addresses of the interface, and these
connected addresses list will be reconstructed when ripd read
the configuration during restarting.
3. The fix for problem 2). definitely has not any side-effect because I just restore the horizon flag to
the values when ripd daemon is firstly start up.And the customer has already test the fix for a lot of times, no problem is found.
Thanks,
XufengQuoted 81 lines
-J.
Quoted 78 lines
Signed-off-by Xufeng Zhang<[email protected]>--- .../ripd-fix-two-bugs-after-received-SIGHUP.patch | 49 ++++++++++++++++++++ .../recipes-protocols/quagga/quagga.inc | 3 +- 2 files changed, 51 insertions(+), 1 deletions(-)create mode 100644
meta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patchmeta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patch new file +49
-0@@ -0,0 +1,49 @@ +ripd: Fix two bugs after received SIGHUP signal + +There are two problems for ripd implementation after received +SIGHUP signal: +1). ripd didn't clean up ifp->connected list before reload + configuration file. +2). ripd reset ri->split_horizon flag to RIP_NO_SPLIT_HORIZON + which lead to the unnecessary route to be advertised. + +Upstream-Status: Pending + +Signed-off-by: Xufeng Zhang<[email protected]> +--- +--- a/ripd/rip_interface.c ++++ b/ripd/rip_interface.c +@@ -500,6 +500,8 @@ + struct listnode *node; + struct interface *ifp; + struct rip_interface *ri; ++ struct connected *ifc; ++ struct listnode *conn_node, *next; + + for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp)) + { +@@ -514,6 +516,13 @@ + thread_cancel (ri->t_wakeup); + ri->t_wakeup = NULL; + } ++ ++ for (conn_node = listhead (ifp->connected); conn_node; conn_node = next) ++ { ++ ifc = listgetdata (conn_node); ++ next = conn_node->next; ++ listnode_delete (ifp->connected, ifc); ++ } + } + } + +@@ -548,8 +557,8 @@ + ri->key_chain = NULL; + } + +- ri->split_horizon = RIP_NO_SPLIT_HORIZON; +- ri->split_horizon_default = RIP_NO_SPLIT_HORIZON; ++ ri->split_horizon = RIP_SPLIT_HORIZON; ++ ri->split_horizon_default = RIP_SPLIT_HORIZON; + + ri->list[RIP_FILTER_IN] = NULL; + ri->list[RIP_FILTER_OUT] = NULL;meta-networking/recipes-protocols/quagga/quagga.inc +2
-1@@ -31,7 +31,8 @@ SRC_URI = "http://download.savannah.gnu.org/releases/quagga${QUAGGASUBDIR}/quagg file://quagga.default \ file://watchquagga.init \ file://watchquagga.default \ - file://volatiles.03_quagga" + file://volatiles.03_quagga \ + file://ripd-fix-two-bugs-after-received-SIGHUP.patch" PACKAGECONFIG ??= "" PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap"Quoted 5 lines
Quoted 5 lines
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Quoted 79 lines · [Re: [oe] [OE] [PATCH meta-networking] quagga/ripd: Fix two bugs after…
Quoted 78 lines · Joe MacDonald
Hi Xufeng,
Quoted 49 lines · [Re: [oe] [OE] [PATCH meta-networking] quagga/ripd: Fix two bugs after…
Quoted 27 lines · Joe MacDonald
Quoted 25 lines · [Re: [oe] [OE] [PATCH meta-networking] quagga/ripd: Fix two bugs after…
Quoted 24 lines · Joe MacDonald
Quoted 10 lines · [[oe] [OE] [PATCH meta-networking] quagga/ripd: Fix two bugs after received…
There are two problems for ripd implementation after received SIGHUP signal:
1). ripd didn't clean upifp->connectedlist before reload
configuration file which makes the same advertise packet being sent multiple times(depends on how many SIGHUP was recieved).
2). ripd resetri->split_horizonflag toRIP_NO_SPLIT_HORIZON
during restart which is different from the flag when ripd is firstly started up, leading to unnecessary route to be advertised.[YOCTO #5266]
Hey Xufeng,
Normally I wouldn't go this deep into the detail but since you referenced the Yocto bug and the Quagga discussion in the commit log and the bug itself, I thought I'd try to understand what's going on here. The last thing I saw from the Quagga maintainer is this:
The
ifp->connectedlist contains connected prefixes of a given interface. These exist regardless of particular routing protocols and emptying the list during ripd reconfiguration would be plain wrong. I allow for a chance there is a bug that is related toifp->connectedand SIGHUP handling at once, but not in this specific way.Quoted 8 lines
Quoted 4 lines
What he said is that this
ifp->connectedlist is exist in all routing protocols,
and if it needs cleanup, it should be done in a more general way, such as in zebra client which is independent of routing protocol.I'm not sure that's the interpretation I would have taken from the quoted text, but if what you indicate is what the maintainer meant, then is he not saying that the SIGHUP handling issue also exists for other routing daemons in the suite?
quoted the sentence:
"The
ifp->connectedlist contains connected prefixes of a given interface. These exist regardless of particular routing protocols and emptying the list during ripd reconfiguration would be plain wrong."
All the other daemons also refer to theifp->connectedlist, and I have checked the SIGHUP handler code of all daemons, except ospfd and ospf6d(they only print a log when SIGHUP is received), all the other daemons suffer the same problem as ripd since
they reload the configuration file.Quoted 3 lines
Quoted 2 lines
Are you saying a similar patch would then be required for potentially all daemons in quagga?
Not all.
Six of eight, then. ;-) Nine, if watchquagga also contains dodgy SIGHUP handler code, but it probably doesn't care about the connected list.
Quoted 18 lines
Quoted 5 lines
Don't get me wrong, repairing one is better than repairing none, but on my first read of his comments it didn't seem like the maintainer even agreed that there was a bug at all and your interpretation suggests that the same bug likely impacts all quagga daemons. Any sense on whether that's the case?
"
I allow for a chance there is a bug that is related to
ifp->connectedand SIGHUP handling at once, but not in this specific way."
My understanding is that if there is a bug related toifp->connected, we should not fix in such specific way. Yes, the maintainer didn't agree that there is really a bug here, but this is really a abnormal behavior:
every time when SIGHUP is received, the same address is appended toifp->connectedlist over and over again,
so if too much SIGHUP are received, there will be a flood for the advertised packets.
Quoted 6 lines
Quoted 3 lines
Okay, so given that, I'm inclined to merge this set with a note in the upstream-status in the patch indicating it is unlikely to be merged. How about "Submitted" with a footnote pointing at the discussion thread?
I think it's fine.
Do I need to send V2 patch?
Nope, if you're happy with my proposed amendments, I'll just update the patch in my tree.
Quoted 6 lines
Quoted 4 lines
Do you think it'd be possible to provide similar patches for the other daemons that suffer this problem? I'll take the current submission, but if you had time to do a follow-up later on for the other daemons, that'd be great.
Ok, I'll do this job for the other daemons.
Fantastic, thanks!
-J.
Quoted 152 lines
Thanks a lot for the review!
Thanks,
XufengQuoted 143 lines
Thanks,
-J.Quoted 140 lines
Thanks,
XufengQuoted 136 lines
-J.
Quoted 134 lines
But I have specified the reasons in the above email that why it's not easy to
implement this general way:
#########################################
More comments:
Generally this connected interface address stuff is cleaned up inrip_interface_address_delete()
which is triggered byzsend_interface_address(), but just as the annotation said abovezsend_interface_address()function inzebra/zserv.c,ZEBRA_INTERFACE_ADDRESS_DELETE
message could only happens in two cases:
1). ip address uninstall
2).RTM_NEWADDRon routing/netlink socketIt didn't take the SIGHUP signal into consideration, but since the SIGHUP is handled
by every daemon independently, this cleanup is not easy to be implemented commonly,
so I think this is a proper way to do this.
#########################################
So it needs to redesign a lot of stuff to implement this.Quoted 5 lines
and it looks like the patch here is the same as the one that the maintainer indicated is "plain wrong".
Can you help me get some
confidence that this isn't going to have negative side-effects if we integrate it?Yes, there should be no side-effects:
1. This modification is only going into ripd daemon and it only takes effect when ripd is restarting.
2. The fix for problem 1). just remove the previously connected addresses of the interface, and these
connected addresses list will be reconstructed when ripd read
the configuration during restarting.
3. The fix for problem 2). definitely has not any side-effect because I just restore the horizon flag to
the values when ripd daemon is firstly start up.And the customer has already test the fix for a lot of times, no problem is found.
Thanks,
XufengQuoted 76 lines
-J.
Quoted 74 lines
Signed-off-by Xufeng Zhang<[email protected]>--- .../ripd-fix-two-bugs-after-received-SIGHUP.patch | 49 ++++++++++++++++++++ .../recipes-protocols/quagga/quagga.inc | 3 +- 2 files changed, 51 insertions(+), 1 deletions(-) create mode 100644 meta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patchmeta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patch new file +49
-0@@ -0,0 +1,49 @@ +ripd: Fix two bugs after received SIGHUP signal + +There are two problems for ripd implementation after received +SIGHUP signal: +1). ripd didn't clean up ifp->connected list before reload + configuration file. +2). ripd reset ri->split_horizon flag to RIP_NO_SPLIT_HORIZON + which lead to the unnecessary route to be advertised. + +Upstream-Status: Pending + +Signed-off-by: Xufeng Zhang<[email protected]> +--- +--- a/ripd/rip_interface.c ++++ b/ripd/rip_interface.c +@@ -500,6 +500,8 @@ + struct listnode *node; + struct interface *ifp; + struct rip_interface *ri; ++ struct connected *ifc; ++ struct listnode *conn_node, *next; + + for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp)) + { +@@ -514,6 +516,13 @@ + thread_cancel (ri->t_wakeup); + ri->t_wakeup = NULL; + } ++ ++ for (conn_node = listhead (ifp->connected); conn_node; conn_node = next) ++ { ++ ifc = listgetdata (conn_node); ++ next = conn_node->next; ++ listnode_delete (ifp->connected, ifc); ++ } + } + } + +@@ -548,8 +557,8 @@ + ri->key_chain = NULL; + } + +- ri->split_horizon = RIP_NO_SPLIT_HORIZON; +- ri->split_horizon_default = RIP_NO_SPLIT_HORIZON; ++ ri->split_horizon = RIP_SPLIT_HORIZON; ++ ri->split_horizon_default = RIP_SPLIT_HORIZON; + + ri->list[RIP_FILTER_IN] = NULL; + ri->list[RIP_FILTER_OUT] = NULL;meta-networking/recipes-protocols/quagga/quagga.inc +2
-1@@ -31,7 +31,8 @@ SRC_URI = "http://download.savannah.gnu.org/releases/quagga${QUAGGASUBDIR}/quagg file://quagga.default \ file://watchquagga.init \ file://watchquagga.default \ - file://volatiles.03_quagga" + file://volatiles.03_quagga \ + file://ripd-fix-two-bugs-after-received-SIGHUP.patch"Quoted 8 lines
Quoted 8 lines
meta-networking/recipes-protocols/quagga/quagga.inc +0
-0PACKAGECONFIG ??= "" PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap"_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Signature · 2 lines
-Joe MacDonald. :wq
And to close the loop, I merged the modified version of your patch that we discussed below. Thanks.
-J.
Quoted 255 lines · [Re: [oe] [OE] [PATCH meta-networking] quagga/ripd: Fix two bugs after…
Quoted 79 lines · [Re: [oe] [OE] [PATCH meta-networking] quagga/ripd: Fix two bugs after…
Quoted 78 lines · Joe MacDonald
Hi Xufeng,
Quoted 49 lines · [Re: [oe] [OE] [PATCH meta-networking] quagga/ripd: Fix two bugs after…
Quoted 27 lines · Joe MacDonald
Quoted 25 lines · [Re: [oe] [OE] [PATCH meta-networking] quagga/ripd: Fix two bugs after…
Quoted 24 lines · Joe MacDonald
Quoted 10 lines · [[oe] [OE] [PATCH meta-networking] quagga/ripd: Fix two bugs after received…
There are two problems for ripd implementation after received SIGHUP signal:
1). ripd didn't clean upifp->connectedlist before reload
configuration file which makes the same advertise packet being sent multiple times(depends on how many SIGHUP was recieved).
2). ripd resetri->split_horizonflag toRIP_NO_SPLIT_HORIZON
during restart which is different from the flag when ripd is firstly started up, leading to unnecessary route to be advertised.[YOCTO #5266]
Hey Xufeng,
Normally I wouldn't go this deep into the detail but since you referenced the Yocto bug and the Quagga discussion in the commit log and the bug itself, I thought I'd try to understand what's going on here. The last thing I saw from the Quagga maintainer is this:
The
ifp->connectedlist contains connected prefixes of a given interface. These exist regardless of particular routing protocols and emptying the list during ripd reconfiguration would be plain wrong. I allow for a chance there is a bug that is related toifp->connectedand SIGHUP handling at once, but not in this specific way.Quoted 8 lines
Quoted 4 lines
What he said is that this
ifp->connectedlist is exist in all routing protocols,
and if it needs cleanup, it should be done in a more general way, such as in zebra client which is independent of routing protocol.I'm not sure that's the interpretation I would have taken from the quoted text, but if what you indicate is what the maintainer meant, then is he not saying that the SIGHUP handling issue also exists for other routing daemons in the suite?
quoted the sentence:
"The
ifp->connectedlist contains connected prefixes of a given interface. These exist regardless of particular routing protocols and emptying the list during ripd reconfiguration would be plain wrong."
All the other daemons also refer to theifp->connectedlist, and I have checked the SIGHUP handler code of all daemons, except ospfd and ospf6d(they only print a log when SIGHUP is received), all the other daemons suffer the same problem as ripd since
they reload the configuration file.Quoted 3 lines
Quoted 2 lines
Are you saying a similar patch would then be required for potentially all daemons in quagga?
Not all.
Six of eight, then. ;-) Nine, if watchquagga also contains dodgy SIGHUP handler code, but it probably doesn't care about the connected list.
Quoted 18 lines
Quoted 5 lines
Don't get me wrong, repairing one is better than repairing none, but on my first read of his comments it didn't seem like the maintainer even agreed that there was a bug at all and your interpretation suggests that the same bug likely impacts all quagga daemons. Any sense on whether that's the case?
"
I allow for a chance there is a bug that is related to
ifp->connectedand SIGHUP handling at once, but not in this specific way."
My understanding is that if there is a bug related toifp->connected, we should not fix in such specific way. Yes, the maintainer didn't agree that there is really a bug here, but this is really a abnormal behavior:
every time when SIGHUP is received, the same address is appended toifp->connectedlist over and over again,
so if too much SIGHUP are received, there will be a flood for the advertised packets.Quoted 6 lines
Quoted 3 lines
Okay, so given that, I'm inclined to merge this set with a note in the upstream-status in the patch indicating it is unlikely to be merged. How about "Submitted" with a footnote pointing at the discussion thread?
I think it's fine.
Do I need to send V2 patch?Nope, if you're happy with my proposed amendments, I'll just update the patch in my tree.
Quoted 6 lines
Quoted 4 lines
Do you think it'd be possible to provide similar patches for the other daemons that suffer this problem? I'll take the current submission, but if you had time to do a follow-up later on for the other daemons, that'd be great.
Ok, I'll do this job for the other daemons.
Fantastic, thanks!
-J.
Quoted 152 lines
Thanks a lot for the review!
Thanks,
XufengQuoted 143 lines
Thanks,
-J.Quoted 140 lines
Thanks,
XufengQuoted 136 lines
-J.
Quoted 134 lines
But I have specified the reasons in the above email that why it's not easy to
implement this general way:
#########################################
More comments:
Generally this connected interface address stuff is cleaned up inrip_interface_address_delete()
which is triggered byzsend_interface_address(), but just as the annotation said abovezsend_interface_address()function inzebra/zserv.c,ZEBRA_INTERFACE_ADDRESS_DELETE
message could only happens in two cases:
1). ip address uninstall
2).RTM_NEWADDRon routing/netlink socketIt didn't take the SIGHUP signal into consideration, but since the SIGHUP is handled
by every daemon independently, this cleanup is not easy to be implemented commonly,
so I think this is a proper way to do this.
#########################################
So it needs to redesign a lot of stuff to implement this.Quoted 5 lines
and it looks like the patch here is the same as the one that the maintainer indicated is "plain wrong".
Can you help me get some
confidence that this isn't going to have negative side-effects if we integrate it?Yes, there should be no side-effects:
1. This modification is only going into ripd daemon and it only takes effect when ripd is restarting.
2. The fix for problem 1). just remove the previously connected addresses of the interface, and these
connected addresses list will be reconstructed when ripd read
the configuration during restarting.
3. The fix for problem 2). definitely has not any side-effect because I just restore the horizon flag to
the values when ripd daemon is firstly start up.And the customer has already test the fix for a lot of times, no problem is found.
Thanks,
XufengQuoted 76 lines
-J.
Quoted 74 lines
Signed-off-by Xufeng Zhang<[email protected]>--- .../ripd-fix-two-bugs-after-received-SIGHUP.patch | 49 ++++++++++++++++++++ .../recipes-protocols/quagga/quagga.inc | 3 +- 2 files changed, 51 insertions(+), 1 deletions(-) create mode 100644 meta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patchmeta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patch new file +49
-0@@ -0,0 +1,49 @@ +ripd: Fix two bugs after received SIGHUP signal + +There are two problems for ripd implementation after received +SIGHUP signal: +1). ripd didn't clean up ifp->connected list before reload + configuration file. +2). ripd reset ri->split_horizon flag to RIP_NO_SPLIT_HORIZON + which lead to the unnecessary route to be advertised. + +Upstream-Status: Pending + +Signed-off-by: Xufeng Zhang<[email protected]> +--- +--- a/ripd/rip_interface.c ++++ b/ripd/rip_interface.c +@@ -500,6 +500,8 @@ + struct listnode *node; + struct interface *ifp; + struct rip_interface *ri; ++ struct connected *ifc; ++ struct listnode *conn_node, *next; + + for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp)) + { +@@ -514,6 +516,13 @@ + thread_cancel (ri->t_wakeup); + ri->t_wakeup = NULL; + } ++ ++ for (conn_node = listhead (ifp->connected); conn_node; conn_node = next) ++ { ++ ifc = listgetdata (conn_node); ++ next = conn_node->next; ++ listnode_delete (ifp->connected, ifc); ++ } + } + } + +@@ -548,8 +557,8 @@ + ri->key_chain = NULL; + } + +- ri->split_horizon = RIP_NO_SPLIT_HORIZON; +- ri->split_horizon_default = RIP_NO_SPLIT_HORIZON; ++ ri->split_horizon = RIP_SPLIT_HORIZON; ++ ri->split_horizon_default = RIP_SPLIT_HORIZON; + + ri->list[RIP_FILTER_IN] = NULL; + ri->list[RIP_FILTER_OUT] = NULL;meta-networking/recipes-protocols/quagga/quagga.inc +2
-1@@ -31,7 +31,8 @@ SRC_URI = "http://download.savannah.gnu.org/releases/quagga${QUAGGASUBDIR}/quagg file://quagga.default \ file://watchquagga.init \ file://watchquagga.default \ - file://volatiles.03_quagga" + file://volatiles.03_quagga \ + file://ripd-fix-two-bugs-after-received-SIGHUP.patch"Quoted 8 lines
Quoted 8 lines
meta-networking/recipes-protocols/quagga/quagga.inc +0
-0PACKAGECONFIG ??= "" PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap"_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Signature · 2 lines
-Joe MacDonald. :wq