[Bgpd-users] Patch for BGP/PathAttribute [bgpd.pl-0.06]
Status: Alpha
Brought to you by:
stevenh
|
From: Terra <mli...@Fu...> - 2003-02-18 17:41:18
|
Greetings,
The players:
1) zebra-0.93b
2) bgpd-0.6
Upon receiving an attribute_type_code of 'BGP_UPDATE_Path_Attribute_ORIGINATOR_ID', an error is quickly hit on line: 564
Error:
Bad arg length for Socket::inet_ntoa, length is 10, should be 4 at BGP/PathAttribute.pm line 564
From a quick patch:
printf("OrigID: %d, %d\n", $originator_id, length($originator_id));
returns:
OrigID: 1117200388, 10
I went ahead and decided to reverse the prior unpack, instead of stuffing away the substr, then unpack step after...
Patch to repair:
--- bgpd.pl-0.06/BGP/PathAttribute.pm-virgin Tue Oct 1 01:03:13 2002
+++ bgpd.pl-0.06/BGP/PathAttribute.pm Tue Feb 18 12:27:56 2003
@@ -562,7 +562,7 @@
$pa->set_originatorid ($originator_id);
$bytes_read += $attribute_length;
$neighbor->log (2, 256, "Originator ID:",
- inet_ntoa($originator_id));
+ inet_ntoa(pack('N',$originator_id)));
}
if ($attribute_type_code == BGP_UPDATE_Path_Attribute_CLUSTER_LIST) {
$attribute .= substr($buff, $bytes_read, $attribute_length);
Thanks Steven for maintaining a wonderful base of perl, that can slice and dice raw BGP packets, for which has helped me to understand the BGP4 protocol in much more depth and detail... It is also proven itself to be a terrific debugging aid, especially when your eBGP peers refuse to provide looking glass services to their clients...
--
Terra
sysAdmin
FutureQuest
|