All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH meta-networking] quagga: Avoid duplicate connected address adding to the list
@ 2013-11-19  7:02 Xufeng Zhang
  2013-11-19  7:04 ` Xufeng Zhang
  2013-11-26 16:24 ` Joe MacDonald
  0 siblings, 2 replies; 6+ messages in thread
From: Xufeng Zhang @ 2013-11-19  7:02 UTC (permalink / raw)
  To: openembedded-devel

commit 27ba970b9("quagga/ripd: Fix two bugs after received SIGHUP signal")
introduces an regression: ifp->connected list is cleaned up when ripd is
restarting, however, for interface addresses which are not specified in
ripd configuration file, they are never to be added into ifp->connected
again, this will lead to some abnormal behavior for route advertising.

Instead of cleaning up the ifp->connected list to avoid duplicated
connected address being added into this list, we can check this
condition during interface address adding process and return early
when an identical address has already been added.

Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
---
 .../quagga-Avoid-duplicate-connected-address.patch |   53 ++++++++++++++++++++
 .../recipes-protocols/quagga/quagga.inc            |    3 +-
 2 files changed, 55 insertions(+), 1 deletions(-)
 create mode 100644 meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch

diff --git a/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch b/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch
new file mode 100644
index 0000000..585dc29
--- /dev/null
+++ b/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch
@@ -0,0 +1,53 @@
+quagga: Avoid duplicate connected address adding to the list
+
+commit 27ba970b9("quagga/ripd: Fix two bugs after received SIGHUP signal")
+introduces an regression: ifp->connected list is cleaned up when ripd is
+restarting, however, for interface addresses which are not specified in
+ripd configuration file, they are never to be added into ifp->connected
+again, this will lead to some abnormal behavior for route advertising.
+
+Instead of cleaning up the ifp->connected list to avoid duplicated
+connected address being added into this list, we can check this
+condition during interface address adding process and return early
+when an identical address has already been added.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hu Yadi <Yadi.hu@windriver.com>
+Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
+---
+--- a/lib/if.c
++++ b/lib/if.c
+@@ -738,6 +738,16 @@
+                          struct prefix *destination)
+ {
+   struct connected *ifc;
++  struct listnode *cnode;
++  struct connected *c;
++  int ret = 0;
++
++  for (ALL_LIST_ELEMENTS_RO (ifp->connected, cnode, c))
++    {
++      ret = connected_same_prefix (p, (c->address));
++      if(ret == 1)
++        return NULL;
++    }
+ 
+   /* Allocate new connected address. */
+   ifc = connected_new ();
+--- a/ripd/rip_interface.c
++++ b/ripd/rip_interface.c
+@@ -516,13 +516,6 @@
+ 	  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);
+-	}
+     }
+ }
+ 
diff --git a/meta-networking/recipes-protocols/quagga/quagga.inc b/meta-networking/recipes-protocols/quagga/quagga.inc
index 2106c9b..21c2028 100644
--- a/meta-networking/recipes-protocols/quagga/quagga.inc
+++ b/meta-networking/recipes-protocols/quagga/quagga.inc
@@ -32,7 +32,8 @@ SRC_URI = "http://download.savannah.gnu.org/releases/quagga${QUAGGASUBDIR}/quagg
            file://watchquagga.init \
            file://watchquagga.default \
            file://volatiles.03_quagga \
-           file://ripd-fix-two-bugs-after-received-SIGHUP.patch"
+           file://ripd-fix-two-bugs-after-received-SIGHUP.patch \
+           file://quagga-Avoid-duplicate-connected-address.patch"
 
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap"
-- 
1.7.0.2



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH meta-networking] quagga: Avoid duplicate connected address adding to the list
  2013-11-19  7:02 [PATCH meta-networking] quagga: Avoid duplicate connected address adding to the list Xufeng Zhang
@ 2013-11-19  7:04 ` Xufeng Zhang
  2013-11-26 14:51   ` Joe MacDonald
  2013-11-26 16:24 ` Joe MacDonald
  1 sibling, 1 reply; 6+ messages in thread
From: Xufeng Zhang @ 2013-11-19  7:04 UTC (permalink / raw)
  To: openembedded-devel, Joe MacDonald

Hi Joe,

After this fix, we can do nothing to other daemons.


Thanks,
Xufeng

On 11/19/2013 03:02 PM, Xufeng Zhang wrote:
> commit 27ba970b9("quagga/ripd: Fix two bugs after received SIGHUP signal")
> introduces an regression: ifp->connected list is cleaned up when ripd is
> restarting, however, for interface addresses which are not specified in
> ripd configuration file, they are never to be added into ifp->connected
> again, this will lead to some abnormal behavior for route advertising.
>
> Instead of cleaning up the ifp->connected list to avoid duplicated
> connected address being added into this list, we can check this
> condition during interface address adding process and return early
> when an identical address has already been added.
>
> Signed-off-by: Xufeng Zhang<xufeng.zhang@windriver.com>
> ---
>   .../quagga-Avoid-duplicate-connected-address.patch |   53 ++++++++++++++++++++
>   .../recipes-protocols/quagga/quagga.inc            |    3 +-
>   2 files changed, 55 insertions(+), 1 deletions(-)
>   create mode 100644 meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch
>
> diff --git a/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch b/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch
> new file mode 100644
> index 0000000..585dc29
> --- /dev/null
> +++ b/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch
> @@ -0,0 +1,53 @@
> +quagga: Avoid duplicate connected address adding to the list
> +
> +commit 27ba970b9("quagga/ripd: Fix two bugs after received SIGHUP signal")
> +introduces an regression: ifp->connected list is cleaned up when ripd is
> +restarting, however, for interface addresses which are not specified in
> +ripd configuration file, they are never to be added into ifp->connected
> +again, this will lead to some abnormal behavior for route advertising.
> +
> +Instead of cleaning up the ifp->connected list to avoid duplicated
> +connected address being added into this list, we can check this
> +condition during interface address adding process and return early
> +when an identical address has already been added.
> +
> +Upstream-Status: Pending
> +
> +Signed-off-by: Hu Yadi<Yadi.hu@windriver.com>
> +Signed-off-by: Xufeng Zhang<xufeng.zhang@windriver.com>
> +---
> +--- a/lib/if.c
> ++++ b/lib/if.c
> +@@ -738,6 +738,16 @@
> +                          struct prefix *destination)
> + {
> +   struct connected *ifc;
> ++  struct listnode *cnode;
> ++  struct connected *c;
> ++  int ret = 0;
> ++
> ++  for (ALL_LIST_ELEMENTS_RO (ifp->connected, cnode, c))
> ++    {
> ++      ret = connected_same_prefix (p, (c->address));
> ++      if(ret == 1)
> ++        return NULL;
> ++    }
> +
> +   /* Allocate new connected address. */
> +   ifc = connected_new ();
> +--- a/ripd/rip_interface.c
> ++++ b/ripd/rip_interface.c
> +@@ -516,13 +516,6 @@
> + 	  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);
> +-	}
> +     }
> + }
> +
> diff --git a/meta-networking/recipes-protocols/quagga/quagga.inc b/meta-networking/recipes-protocols/quagga/quagga.inc
> index 2106c9b..21c2028 100644
> --- a/meta-networking/recipes-protocols/quagga/quagga.inc
> +++ b/meta-networking/recipes-protocols/quagga/quagga.inc
> @@ -32,7 +32,8 @@ SRC_URI = "http://download.savannah.gnu.org/releases/quagga${QUAGGASUBDIR}/quagg
>              file://watchquagga.init \
>              file://watchquagga.default \
>              file://volatiles.03_quagga \
> -           file://ripd-fix-two-bugs-after-received-SIGHUP.patch"
> +           file://ripd-fix-two-bugs-after-received-SIGHUP.patch \
> +           file://quagga-Avoid-duplicate-connected-address.patch"
>
>   PACKAGECONFIG ??= ""
>   PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap"
>    



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH meta-networking] quagga: Avoid duplicate connected address adding to the list
  2013-11-19  7:04 ` Xufeng Zhang
@ 2013-11-26 14:51   ` Joe MacDonald
  2013-11-27  2:14     ` Xufeng Zhang
  0 siblings, 1 reply; 6+ messages in thread
From: Joe MacDonald @ 2013-11-26 14:51 UTC (permalink / raw)
  To: Xufeng Zhang; +Cc: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 4673 bytes --]

[Re: [oe] [OE][PATCH meta-networking] quagga: Avoid duplicate connected address adding to the list] On 13.11.19 (Tue 15:04) Xufeng Zhang wrote:

> Hi Joe,
> 
> After this fix, we can do nothing to other daemons.

Nice.  Thanks for following up on this, Xufeng.  Do you think it is
reasonable to remove ripd-fix-two-bugs-after-received-SIGHUP.patch, or
is it still required for ripd?

-J.

> 
> 
> Thanks,
> Xufeng
> 
> On 11/19/2013 03:02 PM, Xufeng Zhang wrote:
> >commit 27ba970b9("quagga/ripd: Fix two bugs after received SIGHUP signal")
> >introduces an regression: ifp->connected list is cleaned up when ripd is
> >restarting, however, for interface addresses which are not specified in
> >ripd configuration file, they are never to be added into ifp->connected
> >again, this will lead to some abnormal behavior for route advertising.
> >
> >Instead of cleaning up the ifp->connected list to avoid duplicated
> >connected address being added into this list, we can check this
> >condition during interface address adding process and return early
> >when an identical address has already been added.
> >
> >Signed-off-by: Xufeng Zhang<xufeng.zhang@windriver.com>
> >---
> >  .../quagga-Avoid-duplicate-connected-address.patch |   53 ++++++++++++++++++++
> >  .../recipes-protocols/quagga/quagga.inc            |    3 +-
> >  2 files changed, 55 insertions(+), 1 deletions(-)
> >  create mode 100644 meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch
> >
> >diff --git a/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch b/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch
> >new file mode 100644
> >index 0000000..585dc29
> >--- /dev/null
> >+++ b/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch
> >@@ -0,0 +1,53 @@
> >+quagga: Avoid duplicate connected address adding to the list
> >+
> >+commit 27ba970b9("quagga/ripd: Fix two bugs after received SIGHUP signal")
> >+introduces an regression: ifp->connected list is cleaned up when ripd is
> >+restarting, however, for interface addresses which are not specified in
> >+ripd configuration file, they are never to be added into ifp->connected
> >+again, this will lead to some abnormal behavior for route advertising.
> >+
> >+Instead of cleaning up the ifp->connected list to avoid duplicated
> >+connected address being added into this list, we can check this
> >+condition during interface address adding process and return early
> >+when an identical address has already been added.
> >+
> >+Upstream-Status: Pending
> >+
> >+Signed-off-by: Hu Yadi<Yadi.hu@windriver.com>
> >+Signed-off-by: Xufeng Zhang<xufeng.zhang@windriver.com>
> >+---
> >+--- a/lib/if.c
> >++++ b/lib/if.c
> >+@@ -738,6 +738,16 @@
> >+                          struct prefix *destination)
> >+ {
> >+   struct connected *ifc;
> >++  struct listnode *cnode;
> >++  struct connected *c;
> >++  int ret = 0;
> >++
> >++  for (ALL_LIST_ELEMENTS_RO (ifp->connected, cnode, c))
> >++    {
> >++      ret = connected_same_prefix (p, (c->address));
> >++      if(ret == 1)
> >++        return NULL;
> >++    }
> >+
> >+   /* Allocate new connected address. */
> >+   ifc = connected_new ();
> >+--- a/ripd/rip_interface.c
> >++++ b/ripd/rip_interface.c
> >+@@ -516,13 +516,6 @@
> >+ 	  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);
> >+-	}
> >+     }
> >+ }
> >+
> >diff --git a/meta-networking/recipes-protocols/quagga/quagga.inc b/meta-networking/recipes-protocols/quagga/quagga.inc
> >index 2106c9b..21c2028 100644
> >--- a/meta-networking/recipes-protocols/quagga/quagga.inc
> >+++ b/meta-networking/recipes-protocols/quagga/quagga.inc
> >@@ -32,7 +32,8 @@ SRC_URI = "http://download.savannah.gnu.org/releases/quagga${QUAGGASUBDIR}/quagg
> >             file://watchquagga.init \
> >             file://watchquagga.default \
> >             file://volatiles.03_quagga \
> >-           file://ripd-fix-two-bugs-after-received-SIGHUP.patch"
> >+           file://ripd-fix-two-bugs-after-received-SIGHUP.patch \
> >+           file://quagga-Avoid-duplicate-connected-address.patch"
> >
> >  PACKAGECONFIG ??= ""
> >  PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap"
> 

-- 
-Joe MacDonald.
:wq

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH meta-networking] quagga: Avoid duplicate connected address adding to the list
  2013-11-19  7:02 [PATCH meta-networking] quagga: Avoid duplicate connected address adding to the list Xufeng Zhang
  2013-11-19  7:04 ` Xufeng Zhang
@ 2013-11-26 16:24 ` Joe MacDonald
  1 sibling, 0 replies; 6+ messages in thread
From: Joe MacDonald @ 2013-11-26 16:24 UTC (permalink / raw)
  To: Xufeng Zhang; +Cc: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 4265 bytes --]

Merged, thanks.
-J.

[[oe] [OE][PATCH meta-networking] quagga: Avoid duplicate connected address adding to the list] On 13.11.19 (Tue 15:02) Xufeng Zhang wrote:

> commit 27ba970b9("quagga/ripd: Fix two bugs after received SIGHUP signal")
> introduces an regression: ifp->connected list is cleaned up when ripd is
> restarting, however, for interface addresses which are not specified in
> ripd configuration file, they are never to be added into ifp->connected
> again, this will lead to some abnormal behavior for route advertising.
> 
> Instead of cleaning up the ifp->connected list to avoid duplicated
> connected address being added into this list, we can check this
> condition during interface address adding process and return early
> when an identical address has already been added.
> 
> Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
> ---
>  .../quagga-Avoid-duplicate-connected-address.patch |   53 ++++++++++++++++++++
>  .../recipes-protocols/quagga/quagga.inc            |    3 +-
>  2 files changed, 55 insertions(+), 1 deletions(-)
>  create mode 100644 meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch
> 
> diff --git a/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch b/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch
> new file mode 100644
> index 0000000..585dc29
> --- /dev/null
> +++ b/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch
> @@ -0,0 +1,53 @@
> +quagga: Avoid duplicate connected address adding to the list
> +
> +commit 27ba970b9("quagga/ripd: Fix two bugs after received SIGHUP signal")
> +introduces an regression: ifp->connected list is cleaned up when ripd is
> +restarting, however, for interface addresses which are not specified in
> +ripd configuration file, they are never to be added into ifp->connected
> +again, this will lead to some abnormal behavior for route advertising.
> +
> +Instead of cleaning up the ifp->connected list to avoid duplicated
> +connected address being added into this list, we can check this
> +condition during interface address adding process and return early
> +when an identical address has already been added.
> +
> +Upstream-Status: Pending
> +
> +Signed-off-by: Hu Yadi <Yadi.hu@windriver.com>
> +Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
> +---
> +--- a/lib/if.c
> ++++ b/lib/if.c
> +@@ -738,6 +738,16 @@
> +                          struct prefix *destination)
> + {
> +   struct connected *ifc;
> ++  struct listnode *cnode;
> ++  struct connected *c;
> ++  int ret = 0;
> ++
> ++  for (ALL_LIST_ELEMENTS_RO (ifp->connected, cnode, c))
> ++    {
> ++      ret = connected_same_prefix (p, (c->address));
> ++      if(ret == 1)
> ++        return NULL;
> ++    }
> + 
> +   /* Allocate new connected address. */
> +   ifc = connected_new ();
> +--- a/ripd/rip_interface.c
> ++++ b/ripd/rip_interface.c
> +@@ -516,13 +516,6 @@
> + 	  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);
> +-	}
> +     }
> + }
> + 
> diff --git a/meta-networking/recipes-protocols/quagga/quagga.inc b/meta-networking/recipes-protocols/quagga/quagga.inc
> index 2106c9b..21c2028 100644
> --- a/meta-networking/recipes-protocols/quagga/quagga.inc
> +++ b/meta-networking/recipes-protocols/quagga/quagga.inc
> @@ -32,7 +32,8 @@ SRC_URI = "http://download.savannah.gnu.org/releases/quagga${QUAGGASUBDIR}/quagg
>             file://watchquagga.init \
>             file://watchquagga.default \
>             file://volatiles.03_quagga \
> -           file://ripd-fix-two-bugs-after-received-SIGHUP.patch"
> +           file://ripd-fix-two-bugs-after-received-SIGHUP.patch \
> +           file://quagga-Avoid-duplicate-connected-address.patch"
>  
>  PACKAGECONFIG ??= ""
>  PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap"
-- 
-Joe MacDonald.
:wq

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH meta-networking] quagga: Avoid duplicate connected address adding to the list
  2013-11-26 14:51   ` Joe MacDonald
@ 2013-11-27  2:14     ` Xufeng Zhang
  2013-11-27 20:19       ` Joe MacDonald
  0 siblings, 1 reply; 6+ messages in thread
From: Xufeng Zhang @ 2013-11-27  2:14 UTC (permalink / raw)
  To: Joe MacDonald; +Cc: openembedded-devel

On 11/26/2013 10:51 PM, Joe MacDonald wrote:
> [Re: [oe] [OE][PATCH meta-networking] quagga: Avoid duplicate connected address adding to the list] On 13.11.19 (Tue 15:04) Xufeng Zhang wrote:
>
>    
>> Hi Joe,
>>
>> After this fix, we can do nothing to other daemons.
>>      
> Nice.  Thanks for following up on this, Xufeng.  Do you think it is
> reasonable to remove ripd-fix-two-bugs-after-received-SIGHUP.patch, or
> is it still required for ripd?
>    

We should still keep it since 
ripd-fix-two-bugs-after-received-SIGHUP.patch also
fix another bug(RIP_NO_SPLIT_HORIZON flag problem).


Thanks,
Xufeng

> -J.
>
>    
>>
>> Thanks,
>> Xufeng
>>
>> On 11/19/2013 03:02 PM, Xufeng Zhang wrote:
>>      
>>> commit 27ba970b9("quagga/ripd: Fix two bugs after received SIGHUP signal")
>>> introduces an regression: ifp->connected list is cleaned up when ripd is
>>> restarting, however, for interface addresses which are not specified in
>>> ripd configuration file, they are never to be added into ifp->connected
>>> again, this will lead to some abnormal behavior for route advertising.
>>>
>>> Instead of cleaning up the ifp->connected list to avoid duplicated
>>> connected address being added into this list, we can check this
>>> condition during interface address adding process and return early
>>> when an identical address has already been added.
>>>
>>> Signed-off-by: Xufeng Zhang<xufeng.zhang@windriver.com>
>>> ---
>>>   .../quagga-Avoid-duplicate-connected-address.patch |   53 ++++++++++++++++++++
>>>   .../recipes-protocols/quagga/quagga.inc            |    3 +-
>>>   2 files changed, 55 insertions(+), 1 deletions(-)
>>>   create mode 100644 meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch
>>>
>>> diff --git a/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch b/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch
>>> new file mode 100644
>>> index 0000000..585dc29
>>> --- /dev/null
>>> +++ b/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch
>>> @@ -0,0 +1,53 @@
>>> +quagga: Avoid duplicate connected address adding to the list
>>> +
>>> +commit 27ba970b9("quagga/ripd: Fix two bugs after received SIGHUP signal")
>>> +introduces an regression: ifp->connected list is cleaned up when ripd is
>>> +restarting, however, for interface addresses which are not specified in
>>> +ripd configuration file, they are never to be added into ifp->connected
>>> +again, this will lead to some abnormal behavior for route advertising.
>>> +
>>> +Instead of cleaning up the ifp->connected list to avoid duplicated
>>> +connected address being added into this list, we can check this
>>> +condition during interface address adding process and return early
>>> +when an identical address has already been added.
>>> +
>>> +Upstream-Status: Pending
>>> +
>>> +Signed-off-by: Hu Yadi<Yadi.hu@windriver.com>
>>> +Signed-off-by: Xufeng Zhang<xufeng.zhang@windriver.com>
>>> +---
>>> +--- a/lib/if.c
>>> ++++ b/lib/if.c
>>> +@@ -738,6 +738,16 @@
>>> +                          struct prefix *destination)
>>> + {
>>> +   struct connected *ifc;
>>> ++  struct listnode *cnode;
>>> ++  struct connected *c;
>>> ++  int ret = 0;
>>> ++
>>> ++  for (ALL_LIST_ELEMENTS_RO (ifp->connected, cnode, c))
>>> ++    {
>>> ++      ret = connected_same_prefix (p, (c->address));
>>> ++      if(ret == 1)
>>> ++        return NULL;
>>> ++    }
>>> +
>>> +   /* Allocate new connected address. */
>>> +   ifc = connected_new ();
>>> +--- a/ripd/rip_interface.c
>>> ++++ b/ripd/rip_interface.c
>>> +@@ -516,13 +516,6 @@
>>> + 	  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);
>>> +-	}
>>> +     }
>>> + }
>>> +
>>> diff --git a/meta-networking/recipes-protocols/quagga/quagga.inc b/meta-networking/recipes-protocols/quagga/quagga.inc
>>> index 2106c9b..21c2028 100644
>>> --- a/meta-networking/recipes-protocols/quagga/quagga.inc
>>> +++ b/meta-networking/recipes-protocols/quagga/quagga.inc
>>> @@ -32,7 +32,8 @@ SRC_URI = "http://download.savannah.gnu.org/releases/quagga${QUAGGASUBDIR}/quagg
>>>              file://watchquagga.init \
>>>              file://watchquagga.default \
>>>              file://volatiles.03_quagga \
>>> -           file://ripd-fix-two-bugs-after-received-SIGHUP.patch"
>>> +           file://ripd-fix-two-bugs-after-received-SIGHUP.patch \
>>> +           file://quagga-Avoid-duplicate-connected-address.patch"
>>>
>>>   PACKAGECONFIG ??= ""
>>>   PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap"
>>>        
>>      
>    



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH meta-networking] quagga: Avoid duplicate connected address adding to the list
  2013-11-27  2:14     ` Xufeng Zhang
@ 2013-11-27 20:19       ` Joe MacDonald
  0 siblings, 0 replies; 6+ messages in thread
From: Joe MacDonald @ 2013-11-27 20:19 UTC (permalink / raw)
  To: Xufeng Zhang; +Cc: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 5366 bytes --]

[Re: [oe] [OE][PATCH meta-networking] quagga: Avoid duplicate connected address adding to the list] On 13.11.27 (Wed 10:14) Xufeng Zhang wrote:

> On 11/26/2013 10:51 PM, Joe MacDonald wrote:
> >[Re: [oe] [OE][PATCH meta-networking] quagga: Avoid duplicate connected address adding to the list] On 13.11.19 (Tue 15:04) Xufeng Zhang wrote:
> >
> >>Hi Joe,
> >>
> >>After this fix, we can do nothing to other daemons.
> >Nice.  Thanks for following up on this, Xufeng.  Do you think it is
> >reasonable to remove ripd-fix-two-bugs-after-received-SIGHUP.patch, or
> >is it still required for ripd?
> 
> We should still keep it since
> ripd-fix-two-bugs-after-received-SIGHUP.patch also
> fix another bug(RIP_NO_SPLIT_HORIZON flag problem).

That's what I was thinking after I looked at the patch again, but thanks
for the confirmation.

-J.

> 
> 
> Thanks,
> Xufeng
> 
> >-J.
> >
> >>
> >>Thanks,
> >>Xufeng
> >>
> >>On 11/19/2013 03:02 PM, Xufeng Zhang wrote:
> >>>commit 27ba970b9("quagga/ripd: Fix two bugs after received SIGHUP signal")
> >>>introduces an regression: ifp->connected list is cleaned up when ripd is
> >>>restarting, however, for interface addresses which are not specified in
> >>>ripd configuration file, they are never to be added into ifp->connected
> >>>again, this will lead to some abnormal behavior for route advertising.
> >>>
> >>>Instead of cleaning up the ifp->connected list to avoid duplicated
> >>>connected address being added into this list, we can check this
> >>>condition during interface address adding process and return early
> >>>when an identical address has already been added.
> >>>
> >>>Signed-off-by: Xufeng Zhang<xufeng.zhang@windriver.com>
> >>>---
> >>>  .../quagga-Avoid-duplicate-connected-address.patch |   53 ++++++++++++++++++++
> >>>  .../recipes-protocols/quagga/quagga.inc            |    3 +-
> >>>  2 files changed, 55 insertions(+), 1 deletions(-)
> >>>  create mode 100644 meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch
> >>>
> >>>diff --git a/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch b/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch
> >>>new file mode 100644
> >>>index 0000000..585dc29
> >>>--- /dev/null
> >>>+++ b/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch
> >>>@@ -0,0 +1,53 @@
> >>>+quagga: Avoid duplicate connected address adding to the list
> >>>+
> >>>+commit 27ba970b9("quagga/ripd: Fix two bugs after received SIGHUP signal")
> >>>+introduces an regression: ifp->connected list is cleaned up when ripd is
> >>>+restarting, however, for interface addresses which are not specified in
> >>>+ripd configuration file, they are never to be added into ifp->connected
> >>>+again, this will lead to some abnormal behavior for route advertising.
> >>>+
> >>>+Instead of cleaning up the ifp->connected list to avoid duplicated
> >>>+connected address being added into this list, we can check this
> >>>+condition during interface address adding process and return early
> >>>+when an identical address has already been added.
> >>>+
> >>>+Upstream-Status: Pending
> >>>+
> >>>+Signed-off-by: Hu Yadi<Yadi.hu@windriver.com>
> >>>+Signed-off-by: Xufeng Zhang<xufeng.zhang@windriver.com>
> >>>+---
> >>>+--- a/lib/if.c
> >>>++++ b/lib/if.c
> >>>+@@ -738,6 +738,16 @@
> >>>+                          struct prefix *destination)
> >>>+ {
> >>>+   struct connected *ifc;
> >>>++  struct listnode *cnode;
> >>>++  struct connected *c;
> >>>++  int ret = 0;
> >>>++
> >>>++  for (ALL_LIST_ELEMENTS_RO (ifp->connected, cnode, c))
> >>>++    {
> >>>++      ret = connected_same_prefix (p, (c->address));
> >>>++      if(ret == 1)
> >>>++        return NULL;
> >>>++    }
> >>>+
> >>>+   /* Allocate new connected address. */
> >>>+   ifc = connected_new ();
> >>>+--- a/ripd/rip_interface.c
> >>>++++ b/ripd/rip_interface.c
> >>>+@@ -516,13 +516,6 @@
> >>>+ 	  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);
> >>>+-	}
> >>>+     }
> >>>+ }
> >>>+
> >>>diff --git a/meta-networking/recipes-protocols/quagga/quagga.inc b/meta-networking/recipes-protocols/quagga/quagga.inc
> >>>index 2106c9b..21c2028 100644
> >>>--- a/meta-networking/recipes-protocols/quagga/quagga.inc
> >>>+++ b/meta-networking/recipes-protocols/quagga/quagga.inc
> >>>@@ -32,7 +32,8 @@ SRC_URI = "http://download.savannah.gnu.org/releases/quagga${QUAGGASUBDIR}/quagg
> >>>             file://watchquagga.init \
> >>>             file://watchquagga.default \
> >>>             file://volatiles.03_quagga \
> >>>-           file://ripd-fix-two-bugs-after-received-SIGHUP.patch"
> >>>+           file://ripd-fix-two-bugs-after-received-SIGHUP.patch \
> >>>+           file://quagga-Avoid-duplicate-connected-address.patch"
> >>>
> >>>  PACKAGECONFIG ??= ""
> >>>  PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap"
> 

-- 
-Joe MacDonald.
:wq

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-11-27 20:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-19  7:02 [PATCH meta-networking] quagga: Avoid duplicate connected address adding to the list Xufeng Zhang
2013-11-19  7:04 ` Xufeng Zhang
2013-11-26 14:51   ` Joe MacDonald
2013-11-27  2:14     ` Xufeng Zhang
2013-11-27 20:19       ` Joe MacDonald
2013-11-26 16:24 ` Joe MacDonald

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.