Bug#663280: Updated patch against 1.3.7

2013-05-06 Thread Mark Wooding
Now that wheezy's been released -- without the patch I submitted over a
year ago -- I have to fix all of my machines again, so I've respun the
patch, and here it is.  Not that I have a great deal of hope that
submitting it here will actually cause anything to happen.

Index: bird-1.3.7/nest/iface.c
===
--- bird-1.3.7.orig/nest/iface.c2013-05-06 11:35:21.0 +0100
+++ bird-1.3.7/nest/iface.c 2013-05-06 11:37:13.0 +0100
@@ -289,7 +289,7 @@
 struct iface *
 if_update(struct iface *new)
 {
-  struct iface *i;
+  struct iface *i, *j, *jj;
   unsigned c;
 
   WALK_LIST(i, iface_list)
@@ -324,6 +324,26 @@
   init_list(i-neighbors);
   i-flags |= IF_UPDATED | IF_TMP_DOWN;/* Tmp down as we don't 
have addresses yet */
   add_tail(iface_list, i-n);
+
+  /* If we're unlucky then what just happened is that an interface had its
+   * name changed.  In that case, we've just invented a new iface node with
+   * the new name, but with the same index number as an existing node, and
+   * we've just arranged so that a search by index will find the old node and
+   * not the new one.  This isn't good, so trawl through the list again,
+   * picking out nodes with colliding indices and moving them to the end of
+   * the list.
+   */
+  WALK_LIST_DELSAFE(j, jj, iface_list)
+{
+  if (i == j)
+   break;
+  else if (i-index == j-index)
+   {
+ rem_node(j-n);
+ add_tail(iface_list, j-n);
+   }
+}
+
   return i;
 }
 

-- [mdw]


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#663280: Updated patch against 1.3.7

2013-05-06 Thread Ondřej Surý
Mark,

sorry, I must have somehow missed your bug report.

I have forwarded your bugreport to the upstream.

O.

On Mon, May 6, 2013 at 12:42 PM, Mark Wooding m...@distorted.org.uk wrote:
 Now that wheezy's been released -- without the patch I submitted over a
 year ago -- I have to fix all of my machines again, so I've respun the
 patch, and here it is.  Not that I have a great deal of hope that
 submitting it here will actually cause anything to happen.

 Index: bird-1.3.7/nest/iface.c
 ===
 --- bird-1.3.7.orig/nest/iface.c2013-05-06 11:35:21.0 +0100
 +++ bird-1.3.7/nest/iface.c 2013-05-06 11:37:13.0 +0100
 @@ -289,7 +289,7 @@
  struct iface *
  if_update(struct iface *new)
  {
 -  struct iface *i;
 +  struct iface *i, *j, *jj;
unsigned c;

WALK_LIST(i, iface_list)
 @@ -324,6 +324,26 @@
init_list(i-neighbors);
i-flags |= IF_UPDATED | IF_TMP_DOWN;/* Tmp down as we 
 don't have addresses yet */
add_tail(iface_list, i-n);
 +
 +  /* If we're unlucky then what just happened is that an interface had its
 +   * name changed.  In that case, we've just invented a new iface node with
 +   * the new name, but with the same index number as an existing node, and
 +   * we've just arranged so that a search by index will find the old node and
 +   * not the new one.  This isn't good, so trawl through the list again,
 +   * picking out nodes with colliding indices and moving them to the end of
 +   * the list.
 +   */
 +  WALK_LIST_DELSAFE(j, jj, iface_list)
 +{
 +  if (i == j)
 +   break;
 +  else if (i-index == j-index)
 +   {
 + rem_node(j-n);
 + add_tail(iface_list, j-n);
 +   }
 +}
 +
return i;
  }


 -- [mdw]



-- 
Ondřej Surý ond...@sury.org


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#663280: Updated patch against 1.3.7

2013-05-06 Thread Ondrej Zajicek
On Mon, May 06, 2013 at 11:42:46AM +0100, Mark Wooding wrote:
 Now that wheezy's been released -- without the patch I submitted over a
 year ago -- I have to fix all of my machines again, so I've respun the
 patch, and here it is.  Not that I have a great deal of hope that
 submitting it here will actually cause anything to happen.

Hello

I (upstream developer) noticed your patch some time ago, but i thought
that the issue was already fixed in usptream between 1.3.6 and 1.3.7
(in commit 732a0a257d180a95a02587203555b8552b6128ac).

See following code in nl_parse_link() in sysdep/linux/netlink.c :

  ifi = if_find_by_index(i-ifi_index);
  if (!new)
{
  ...
  if_delete(ifi);
}
  else
{
  if (ifi  strncmp(ifi-name, name, sizeof(ifi-name)-1))
if_delete(ifi);

  //  This should fix your case 

  strncpy(f.name, name, sizeof(f.name)-1);
  f.index = i-ifi_index;
  f.mtu = mtu;
  ...

  if_update(f);
}


I tested interface renaming in current upstream (1.3.10 prerelease) and
it worked OK. As BIRD in Wheezy is in version 1.3.7 (which should
contain fix from the commit mentioned above) i would expect it is OK too.

Do you experience the problem even with unpatched Wheezy package?

-- 
Elen sila lumenn' omentielvo

Ondrej 'SanTiago' Zajicek (email: santi...@crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
To err is human -- to blame it on a computer is even more so.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#663280: Updated patch against 1.3.7

2013-05-06 Thread Mark Wooding
Ondrej Zajicek santi...@crfreenet.org writes:

 See following code in nl_parse_link() in sysdep/linux/netlink.c :
[...]
   if (ifi  strncmp(ifi-name, name, sizeof(ifi-name)-1))
 if_delete(ifi);

Yes, I see.  That ought to do it, if you're sure that this is a Linux-
specific problem.  (I don't know enough about how other systems handle
their routing tables to tell and erred on the side of caution.)

 I tested interface renaming in current upstream (1.3.10 prerelease)
 and it worked OK. As BIRD in Wheezy is in version 1.3.7 (which should
 contain fix from the commit mentioned above) i would expect it is OK
 too.

 Do you experience the problem even with unpatched Wheezy package?

No, everything appears to be fine, in fact.  Thanks for letting me know.

I now feel rather bad about being so harsh to Ondřej Surý when in fact
everything was fine and I hadn't actually checked.  Sorry about that.
Looks like this one's good to close.

-- [mdw]


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#663280: Updated patch against 1.3.7

2013-05-06 Thread Ondrej Zajicek
On Mon, May 06, 2013 at 01:34:50PM +0100, Mark Wooding wrote:
 Ondrej Zajicek santi...@crfreenet.org writes:
 
  See following code in nl_parse_link() in sysdep/linux/netlink.c :
 [...]
if (ifi  strncmp(ifi-name, name, sizeof(ifi-name)-1))
  if_delete(ifi);
 
 Yes, I see.  That ought to do it, if you're sure that this is a Linux-
 specific problem.  

The similar bugfix is also in BSD platform specific code.

  Do you experience the problem even with unpatched Wheezy package?
 
 No, everything appears to be fine, in fact.  Thanks for letting me know.
 
 I now feel rather bad about being so harsh to Ondřej Surý when in fact
 everything was fine and I hadn't actually checked.  Sorry about that.

Well, i should have checked the bugreport more thoroughly and closed the
bug instead of ignoring it with 'most likely fixed in upstream' thought.

-- 
Elen sila lumenn' omentielvo

Ondrej 'SanTiago' Zajicek (email: santi...@crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
To err is human -- to blame it on a computer is even more so.


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org