RE: maybe it is a bug in nexthop__same function

2019-03-11 Thread Derek Pan
Got it. Thanks.

-Original Message-
From: Maria Jan Matějka  
Sent: Monday, March 11, 2019 6:19 PM
To: bird-users@network.cz; Derek Pan ; 
bird-users@network.cz
Subject: Re: maybe it is a bug in nexthop__same function

On March 11, 2019 10:57:06 AM GMT+01:00, Derek Pan  wrote:
> Hi
> 
> I think below function should be used by comparing two netxhop object 
> with different pointer.
> If this function is called, the X and Y always have different pointer 
> values, but if their values are same, they also can be treated as the 
> same.
> I think the "return x== y;" should be replaced by "return 1;".
> Please have a look. Thank.
> 
> int
> nexthop__same(struct nexthop *x, struct nexthop *y) {
>   for (; x && y; x = x->next, y = y->next)
>   {
> if (!ipa_equal(x->gw, y->gw) || (x->iface != y->iface) ||
>  (x->flags != y->flags) || (x->weight != y->weight) ||
>(x->labels_orig != y->labels_orig) || (x->labels != y->labels))
>   return 0;
> 
> for (int i = 0; i < x->labels; i++)
>   if (x->label[i] != y->label[i])
>  return 0;
>   }
> 
>   return x == y;
> }

The next hop object is a linked list. This function compares it nodewise. The 
loop condition is x && y, meaning that both are not null, and the third 
expression in the for-header retrieves the next nodes.

When the loop ends without returning 0, it is sure that x or y is null. If the 
other is also null, the lists are same, if not, there are some more next hop in 
one of the lists and they are obviously not same.

The return x == y is precisely what we want there. Or do I miss something 
looking into this only on my phone in the underground?

Maria



Re: bird version 2.0.4 - peering with cisco version ios xe 16.3.5 - invalid open message

2019-03-11 Thread Marco van Tol
Op 11 mrt. 2019, om 14:11 heeft Marco van Tol  het volgende 
geschreven:
> Op 11 mrt. 2019, om 12:38 heeft Ondrej Zajicek  het 
> volgende geschreven:
>> On Mon, Mar 11, 2019 at 09:44:16AM +0100, Marco van Tol wrote:
 What version of Cisco is that?
>>> 
>>> What I wrote in the subject and the first message, ios xe 16.3.5 :-)
>>> If you need more info in this area let me know.  I have close to no 
>>> experience with Cisco, but I have someone around who does.
>>> 
 Could you try if you get the same result with 1.6.6?
>>> 
>>> The sessions come up with version 1.6.4.  Is that good enough or do you 
>>> need me to try with 1.6.6?
>> 
>> Yes, i would like 1.6.6, because 1.6.4 is in this matter matching 2.0.2 
>> (which worked).
> 
> Ah right, okay.  I will try this and let you know.
> 
 Could you save the failed session initiation attempt by tcpdump?
 (e.g. tcpdump -s 0 -w file.pcap ...)
>>> 
>>> I can but I would like to exchange the file personally rather than on this 
>>> list.
>>> Do you have a proposal on how to exchange the file?
>> 
>> Send it directly to my personal e-mail instead of mailing list?
> 
> That's okay, will do.

Unfortunately I didn't get around to it today and tomorrow have a day off.

I'll try to answer Wednesday.

Sorry,

-- 
Marco van Tol




Re: all protocol state debug

2019-03-11 Thread Eugene M. Zheganin

Hello,

11.03.2019 21:02, Ondrej Zajicek пишет:

On Mon, Mar 11, 2019 at 08:41:19PM +0500, Eugene M. Zheganin wrote:

Hello,


I want to log all protocols state changes, and I have a question:

debug all { states }

is valid in birdc, but why

debug all {
     states
};


is invalid in bird.conf ?

Hello

I cannot say *why* it is that, but you can use:

   debug protocols all { states };

in bird.conf file to do that.



Well, in theory - yeah, but practically I get this:

===Cut===

[root@gw0:local/etc]# head /usr/local/etc/bird.conf
router id 192.168.0.248;

debug protocols all { states };


log syslog {
    debug, trace, info, remote, warning, error, auth, fatal, bug
};

filter importibgpv4 {
[root@gw0:local/etc]# birdc
BIRD 1.6.3 ready.
bird> conf
Reading configuration from /usr/local/etc/bird.conf
/usr/local/etc/bird.conf, line 3: syntax error
[root@gw0:local/etc]#

===Cut===


and I don't understand why. Is my 1.6.3 too old for this ?


Thanks.

Eugene.



Re: all protocol state debug

2019-03-11 Thread Ondrej Zajicek
On Mon, Mar 11, 2019 at 08:41:19PM +0500, Eugene M. Zheganin wrote:
> Hello,
> 
> 
> I want to log all protocols state changes, and I have a question:
> 
> debug all { states }
> 
> is valid in birdc, but why
> 
> debug all {
>     states
> };
> 
> 
> is invalid in bird.conf ?

Hello

I cannot say *why* it is that, but you can use:

  debug protocols all { states };

in bird.conf file to do that.

-- 
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."



all protocol state debug

2019-03-11 Thread Eugene M. Zheganin

Hello,


I want to log all protocols state changes, and I have a question:

debug all { states }

is valid in birdc, but why

debug all {
    states
};


is invalid in bird.conf ?


Thanks.

Eugene.



Re: bird version 2.0.4 - peering with cisco version ios xe 16.3.5 - invalid open message

2019-03-11 Thread Marco van Tol
Op 11 mrt. 2019, om 12:38 heeft Ondrej Zajicek  het 
volgende geschreven:
> On Mon, Mar 11, 2019 at 09:44:16AM +0100, Marco van Tol wrote:
>>> What version of Cisco is that?
>> 
>> What I wrote in the subject and the first message, ios xe 16.3.5 :-)
>> If you need more info in this area let me know.  I have close to no 
>> experience with Cisco, but I have someone around who does.
>> 
>>> Could you try if you get the same result with 1.6.6?
>> 
>> The sessions come up with version 1.6.4.  Is that good enough or do you need 
>> me to try with 1.6.6?
> 
> Yes, i would like 1.6.6, because 1.6.4 is in this matter matching 2.0.2 
> (which worked).

Ah right, okay.  I will try this and let you know.

>>> Could you save the failed session initiation attempt by tcpdump?
>>> (e.g. tcpdump -s 0 -w file.pcap ...)
>> 
>> I can but I would like to exchange the file personally rather than on this 
>> list.
>> Do you have a proposal on how to exchange the file?
> 
> Send it directly to my personal e-mail instead of mailing list?

That's okay, will do.

Many thanks!

-- 
Marco van Tol




Backportability of bird2 debian package

2019-03-11 Thread Eugene Crosser
Hi,

I have a request to Ondřej Surý: debian-packaged version of bird2 that
is currently on https://salsa.debian.org/debian/bird2.git is unbuildable
on older distros because of required version of debhelper (cosmic and
stretch have version 11) and init-system-helpers (cosmic has 1.54,
stretch - 1.48).

Could these dependencies be relaxed to ease backporting of the package?

Thanks,

Eugene



signature.asc
Description: OpenPGP digital signature


Re: bird version 2.0.4 - peering with cisco version ios xe 16.3.5 - invalid open message

2019-03-11 Thread Ondrej Zajicek
On Mon, Mar 11, 2019 at 09:44:16AM +0100, Marco van Tol wrote:
> > What version of Cisco is that?
> 
> What I wrote in the subject and the first message, ios xe 16.3.5 :-)
> If you need more info in this area let me know.  I have close to no 
> experience with Cisco, but I have someone around who does.
> 
> > Could you try if you get the same result with 1.6.6?
> 
> The sessions come up with version 1.6.4.  Is that good enough or do you need 
> me to try with 1.6.6?

Yes, i would like 1.6.6, because 1.6.4 is in this matter matching 2.0.2 (which 
worked).

> > Could you save the failed session initiation attempt by tcpdump?
> > (e.g. tcpdump -s 0 -w file.pcap ...)
> 
> I can but I would like to exchange the file personally rather than on this 
> list.
> Do you have a proposal on how to exchange the file?

Send it directly to my personal e-mail instead of mailing list?

-- 
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."


Re: How to update from v1.6 to v2.0

2019-03-11 Thread Maria Jan Matejka
Hello!

> Would I need to uninstall v1.6 or could update the version by simply steps?
Generally, you don't need to uninstall v1.6. These are anyway conflicting
in all distributions I'm aware of.

> For v1.6 un-installation, would you mind providing me the steps? or
> would you please providing me the upgrading steps?

If you have BIRD from package manager, use it.

Otherwise, you may want to remove the old binaries and maybe some PID file
or socket file, which depends on how you run BIRD.

The most difficult step is upgrading the config file as these are not 
compatible, yet quite similar. The most notable change is the channel concept,
see section 2.3 of docs:
https://bird.network.cz/?get_doc&v=20&f=bird-2.html#ss2.3

Maria


Re: maybe it is a bug in nexthop__same function

2019-03-11 Thread Maria Jan Matějka
On March 11, 2019 10:57:06 AM GMT+01:00, Derek Pan  wrote:
> Hi
> 
> I think below function should be used by comparing two netxhop object
> with different pointer.
> If this function is called, the X and Y always have different pointer
> values, but if their values are same, they also can be treated as the
> same.
> I think the "return x== y;" should be replaced by "return 1;".
> Please have a look. Thank.
> 
> int
> nexthop__same(struct nexthop *x, struct nexthop *y)
> {
>   for (; x && y; x = x->next, y = y->next)
>   {
> if (!ipa_equal(x->gw, y->gw) || (x->iface != y->iface) ||
>  (x->flags != y->flags) || (x->weight != y->weight) ||
>(x->labels_orig != y->labels_orig) || (x->labels != y->labels))
>   return 0;
> 
> for (int i = 0; i < x->labels; i++)
>   if (x->label[i] != y->label[i])
>  return 0;
>   }
> 
>   return x == y;
> }

The next hop object is a linked list. This function compares it nodewise. The 
loop condition is x && y, meaning that both are not null, and the third 
expression in the for-header retrieves the next nodes.

When the loop ends without returning 0, it is sure that x or y is null. If the 
other is also null, the lists are same, if not, there are some more next hop in 
one of the lists and they are obviously not same.

The return x == y is precisely what we want there. Or do I miss something 
looking into this only on my phone in the underground?

Maria



Re: maybe it is a bug in nexthop__same function

2019-03-11 Thread Alexander Zubkov
Hi,

For me, code looks valid. Loop ends when one of the pointers is null:

> x && y

So this comparison (x == y) verifies that both pointers are null, i.e.
both lists are of the same size.

On Mon, Mar 11, 2019 at 11:03 AM Derek Pan  wrote:
>
> Hi
>
>
>
> I think below function should be used by comparing two netxhop object with 
> different pointer.
>
> If this function is called, the X and Y always have different pointer values, 
> but if their values are same, they also can be treated as the same.
>
> I think the “return x== y;” should be replaced by “return 1;”.
>
> Please have a look. Thank.
>
>
>
> int
>
> nexthop__same(struct nexthop *x, struct nexthop *y)
>
> {
>
>   for (; x && y; x = x->next, y = y->next)
>
>   {
>
> if (!ipa_equal(x->gw, y->gw) || (x->iface != y->iface) ||
>
>  (x->flags != y->flags) || (x->weight != y->weight) ||
>
>  (x->labels_orig != y->labels_orig) || (x->labels != y->labels))
>
>   return 0;
>
>
>
> for (int i = 0; i < x->labels; i++)
>
>   if (x->label[i] != y->label[i])
>
>  return 0;
>
>   }
>
>
>
>   return x == y;
>
> }



maybe it is a bug in nexthop__same function

2019-03-11 Thread Derek Pan
Hi

I think below function should be used by comparing two netxhop object with 
different pointer.
If this function is called, the X and Y always have different pointer values, 
but if their values are same, they also can be treated as the same.
I think the "return x== y;" should be replaced by "return 1;".
Please have a look. Thank.

int
nexthop__same(struct nexthop *x, struct nexthop *y)
{
  for (; x && y; x = x->next, y = y->next)
  {
if (!ipa_equal(x->gw, y->gw) || (x->iface != y->iface) ||
 (x->flags != y->flags) || (x->weight != y->weight) ||
 (x->labels_orig != y->labels_orig) || (x->labels != y->labels))
  return 0;

for (int i = 0; i < x->labels; i++)
  if (x->label[i] != y->label[i])
 return 0;
  }

  return x == y;
}


How to update from v1.6 to v2.0

2019-03-11 Thread Isaac HO
Dear All,
Would I need to uninstall v1.6 or could update the version by simply steps?

For v1.6 un-installation, would you mind providing me the steps? or
would you please providing me the upgrading steps?

Thanks,
Isaac


Re: bird version 2.0.4 - peering with cisco version ios xe 16.3.5 - invalid open message

2019-03-11 Thread Marco van Tol
Op 11 mrt. 2019, om 02:55 heeft Ondrej Zajicek  het 
volgende geschreven:
> On Fri, Mar 08, 2019 at 04:09:58PM +0100, Marco van Tol wrote:
>> Op 8 mrt. 2019, om 14:45 heeft Ondrej Zajicek  het 
>> volgende geschreven:
>>> On Fri, Mar 08, 2019 at 01:51:31PM +0100, Marco van Tol wrote:
 Hi,
 
 So I replaced bird 2.0.4 for which I downloaded the rpm from your site 
 with bird 2.0.2 which I installed using yum on a centos 7 system.
 
 I noticed 2 things:
 - The Centos 7 2.0.2 rpm makes the bird daemon drop privileges and resumes 
 as user bird
 - The 2.0.4 package from your site, when started with the supplied 
 .service file, remains as root, with the exact same bird.conf
>>> 
>>> Hi
>>> 
>>> That is defined by cmdline options, so they are probably missing in the 
>>> .service file.
>> 
>> Ah right, okay thanks.
>> 
 - Version 2.0.2 has no issues to peer with the cisco router, it peers fine.
 
 So now I'm curious how worried I should be about the "import bgp fixes" in 
 the 2.0.4 release notes. :-)
>>> 
>>> That is unlikely as that does not change OPEN message.
>>> 
>>> Could you try 2.0.4 with 'long lived graceful restart off;' option?
>> 
>> Hi,
>> 
>> This fixed it.  I added this option only to the cisco neighbors which made 
>> them accept peering.
>> 
>> Much appreciated, and let me know when you need more information from me.
> 
> Hi

Hi

> What version of Cisco is that?

What I wrote in the subject and the first message, ios xe 16.3.5 :-)
If you need more info in this area let me know.  I have close to no experience 
with Cisco, but I have someone around who does.

> Could you try if you get the same result with 1.6.6?

The sessions come up with version 1.6.4.  Is that good enough or do you need me 
to try with 1.6.6?

> Could you save the failed session initiation attempt by tcpdump?
> (e.g. tcpdump -s 0 -w file.pcap ...)

I can but I would like to exchange the file personally rather than on this list.
Do you have a proposal on how to exchange the file?

Thanks!

Marco van Tol

P.S. About my other message about the "protocol rpki" on centos 7, the exact 
same config file works fine on a "BIRD on FreeBSD" system, so I assume that 
means I have the syntax okay :-)

-- 
Marco van Tol