Subject: | problem on Net::BGP::Process with multiple BGP sessions |
Date: | Thu, 8 Nov 2007 18:09:57 +0100 |
To: | bug-Net-BGP [...] rt.cpan.org |
From: | Guillaume Lambert <guillaume.lambert-geek [...] laposte.net> |
Hello
Before any comments, thanks for your good work on NetBGP.
I am currently using it and it fullfills very well all my needs or
almost.
I am saying "almost" because I've found what I think to be a little problem with the package Net::BGP::Process on NetBGP 0.0.8. Here is the explanation.
As BGP sessions are identified by the addresses of the Peers, it is normally possible to set up multiple BGP sessions with a peer on the same physical interface. The only condition is that this interface has multiple IP adresses or aliases (this can be done with the command ifconfig eth2:x ...), one per BGP session.
So I tried to test this using NetBGP 0.0.8 on my linux Box:
debian GNU/LINUX testing x86_64 kernel 2.6.21.5
with
perl, v5.8.8 built for x86_64-linux-gnu-thread-multi
The second session launching failed with an error:
bind() failed at /usr/local/share/perl/5.8.8/Net/BGP/Process.pm line
217.
I decided to dig what was going wrong.
By looking at the code of this class, I found 2 lines above the error
the initialisation of the socket made by this code:
$sock_addr = sockaddr_in($this->{_listen_port}, INADDR_ANY);
The parameter INADDR_ANY allows Perl to choose the IP address to use on
the interface, this works well when there is only one IP address on the
interface. But we have to force this parameter when we want to set up
multiple BGP sessions.
I managed to correct the problem by modifying the class Process.pm.
I've just added a new parameter to the constructor of the class to set
up the IP address to use when establishing the socket. I attached a copy of
this to my email. I didn't notice any side effects but I might be wrong.
I hope this helps.
Thanks for your attention.
Best regards
Guillaume LAMBERT
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.