Fix for communities starting with 0:

Daryl Collins daryl at htb.com.au
Tue Sep 30 02:24:24 UTC 2014


Hi,

I'm still developing the odd patch for RtConfig as we encounter issues in
our environment.  In general I'd be keen to work with the community to get
as many of our patches as possible (specifically XR support) into a new
release of IRRToolSet.

Latest issue we've found is that if you do something like:
community= {0:20000}

The output for Cisco IOS & Cisco XR drops the 0:

Patch to fix is below.

Regards,
Daryl

patch-17-fix-0:-communities

--- src/rtconfig/f_cisco.cc.orig        2014-09-29 16:48:39.000000000 +0930
+++ src/rtconfig/f_cisco.cc     2014-09-29 16:48:59.000000000 +0930
@@ -809,7 +809,7 @@
    else {
       int high = i >> 16;
       int low  = i & 0xFFFF;
-      if (high == 0 || high == 0xFFFF)
+      if (high < 0 || high == 0xFFFF)
         os << i;
       else
         os << high << ":" << low;

--- src/rtconfig/f_ciscoxr.cc.orig      2014-09-29 16:51:18.000000000 +0930
+++ src/rtconfig/f_ciscoxr.cc   2014-09-29 16:46:52.000000000 +0930
@@ -854,7 +854,7 @@
    else {
       int high = i >> 16;
       int low  = i & 0xFFFF;
-      if (high == 0 || high == 0xFFFF)
+      if (high < 0 || high == 0xFFFF)
         os << i;
       else
         os << high << ":" << low;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/irrtoolset/attachments/20140930/00e0dd5e/attachment.html>


More information about the irrtoolset mailing list