pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/irrtoolset-nox11 fix the asplain patch: since the ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/8f34982bf36c
branches:  trunk
changeset: 555999:8f34982bf36c
user:      spz <spz%pkgsrc.org@localhost>
date:      Sun Mar 15 20:10:35 2009 +0000

description:
fix the asplain patch: since the routing registries currently won't find
asplained autnums, make asdot the default, but prepare for them switching
by asking the asplained format before giving up, independently of any
command line settings. Bump pkgrev, too.

diffstat:

 net/irrtoolset-nox11/Makefile         |   4 +-
 net/irrtoolset-nox11/distinfo         |   8 ++--
 net/irrtoolset-nox11/patches/patch-cx |  60 ++++++++++++++++++++++++++++------
 net/irrtoolset-nox11/patches/patch-cz |  19 +++++++++-
 net/irrtoolset-nox11/patches/patch-di |   4 +-
 5 files changed, 73 insertions(+), 22 deletions(-)

diffs (193 lines):

diff -r d2d462b8dd8d -r 8f34982bf36c net/irrtoolset-nox11/Makefile
--- a/net/irrtoolset-nox11/Makefile     Sun Mar 15 19:57:12 2009 +0000
+++ b/net/irrtoolset-nox11/Makefile     Sun Mar 15 20:10:35 2009 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.24 2009/02/15 10:45:02 spz Exp $
+# $NetBSD: Makefile,v 1.25 2009/03/15 20:10:35 spz Exp $
 #
 
 DISTNAME=              IRRToolSet-4.8.5
-PKGREVISION=   14
+PKGREVISION=   15
 CATEGORIES=            net
 MASTER_SITES=  ftp://ftp.isc.org/isc/IRRToolSet/IRRToolSet-4.8.5/
 
diff -r d2d462b8dd8d -r 8f34982bf36c net/irrtoolset-nox11/distinfo
--- a/net/irrtoolset-nox11/distinfo     Sun Mar 15 19:57:12 2009 +0000
+++ b/net/irrtoolset-nox11/distinfo     Sun Mar 15 20:10:35 2009 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.22 2009/02/15 10:45:02 spz Exp $
+$NetBSD: distinfo,v 1.23 2009/03/15 20:10:35 spz Exp $
 
 SHA1 (IRRToolSet-4.8.5.tar.gz) = 0a22daef3c5c04b5bce929e420233885c44662ec
 RMD160 (IRRToolSet-4.8.5.tar.gz) = 3f6a291a1c33c2725325ebc51ab8306e7a1e743b
@@ -36,9 +36,9 @@
 SHA1 (patch-cu) = 712496a2856bf03f7e60d3867e30d3f738829861
 SHA1 (patch-cv) = 678a36afcd35d1a24242157a23127ff5ad6dd8c4
 SHA1 (patch-cw) = 82116da916ae1c364b0188d7991cfb343305c0d7
-SHA1 (patch-cx) = 102a37b057b9a86bb509578d8c46601f068cd760
+SHA1 (patch-cx) = 4146c1a39953e7143e085bbc3d9bfd35221562d4
 SHA1 (patch-cy) = d5761e8fec3c4c591082361ad99ba2c37178de0a
-SHA1 (patch-cz) = acb4b231c1369b9986460949d2caff8cce1a3015
+SHA1 (patch-cz) = 780811a0f962142475edff1364e20835a6c114ba
 SHA1 (patch-da) = d6dbf1a503eaf8e2737bc2dfec79590ff5433930
 SHA1 (patch-db) = 8d82cc3825185c19441266f8d4a6860965a250ce
 SHA1 (patch-dc) = b44f42f61e2c81813a0aa4b773ee1bbb6919c2a8
@@ -47,7 +47,7 @@
 SHA1 (patch-df) = 44de4b706d9259e6479c23029088f899cd091d35
 SHA1 (patch-dg) = 5f3fe95a69cdf1d3eb13b4e2a3a3fce1f4c53168
 SHA1 (patch-dh) = ce1218fe7d82e3bb5c470cd74b334400aebd1928
-SHA1 (patch-di) = 294cb20c8327f35a73a8501f9cc24e7acf850a15
+SHA1 (patch-di) = 309e30d1046b1d9d20f1669441caeef5ea9078e7
 SHA1 (patch-dj) = 25258cbb8e544f0eda9ed6ac4f9f61825266bfdd
 SHA1 (patch-dk) = a1632fa3030ee483c99af5ef039e494295af0b7f
 SHA1 (patch-dl) = 85ab29170a0ce1f82f3058bd58b00c779684fbca
diff -r d2d462b8dd8d -r 8f34982bf36c net/irrtoolset-nox11/patches/patch-cx
--- a/net/irrtoolset-nox11/patches/patch-cx     Sun Mar 15 19:57:12 2009 +0000
+++ b/net/irrtoolset-nox11/patches/patch-cx     Sun Mar 15 20:10:35 2009 +0000
@@ -1,4 +1,4 @@
-$NetBSD: patch-cx,v 1.2 2007/12/31 09:15:15 spz Exp $
+$NetBSD: patch-cx,v 1.3 2009/03/15 20:10:36 spz Exp $
 
 --- src/irr/irr.cc.orig        2006-10-01 13:23:32.000000000 +0200
 +++ src/irr/irr.cc
@@ -13,39 +13,77 @@
  void IRR::initCache(char *objectText, int objectLength, char *clss) {
     Buffer b(objectText, objectLength);
     Set *o = new Set(b);
-@@ -312,7 +316,7 @@ const AutNum *IRR::getAutNum(ASt as) {
+@@ -312,13 +316,20 @@ const AutNum *IRR::getAutNum(ASt as) {
     AutNum *result = NULL;
  
     if (! AutNumCache.query(as, result)) {
 -      sprintf(buffer, "AS%d", as);
-+      asnum_string(buffer, as);
++      asnum_string_dot(buffer, as); // try asdotted
        if (getAutNum(buffer, text, len)) {
         Buffer b(text, len);
         result = new AutNum(b);
-@@ -365,7 +369,7 @@ void IRR::getRoute(Route *&route, Prefix
+        AutNumCache.add(as, result);
+-      } else
+-       AutNumCache.add(as, NULL); // a negative object
++      } else {
++         asnum_string_plain(buffer, as); // try asplain before giving up
++         if (getAutNum(buffer, text, len)) {
++          Buffer b(text, len);
++          result = new AutNum(b);
++          AutNumCache.add(as, result);
++         } else
++          AutNumCache.add(as, NULL); // a negative object
++      }
+    }
+ 
+    return result;
+@@ -365,7 +376,7 @@ void IRR::getRoute(Route *&route, Prefix
     char *text;
     int  len;
  
 -   sprintf(buffer, "AS%d", as);
-+   asnum_string(buffer, as);
++   asnum_string_dot(buffer, as);
     if (getRoute(rt->get_text(), buffer, text, len)) {
        Buffer b(text, len);
        route = new Route(b);
-@@ -379,7 +383,7 @@ void IRR::getRoute(Route *&route, char *
+@@ -379,12 +390,18 @@ void IRR::getRoute(Route *&route, char *
    char *text;
    int  len;
  
 -  sprintf(buffer, "AS%d", as);
-+  asnum_string(buffer, as);
++  asnum_string_dot(buffer, as);
    if (getRoute(rt, buffer, text, len)) {
       Buffer b(text, len);
       route = new Route(b);
-@@ -419,7 +423,7 @@ const MPPrefixRanges *IRR::expandAS(ASt 
+-  } else
+-     route = NULL;
++  } else {
++     asnum_string_plain(buffer, as);
++     if (getRoute(rt, buffer, text, len)) {
++        Buffer b(text, len);
++        route = new Route(b);
++     } else
++        route = NULL;
++  }
+ }
+ 
+ const InetRtr *IRR::getInetRtr(SymID inetRtr)
+@@ -419,11 +436,14 @@ const MPPrefixRanges *IRR::expandAS(ASt 
        // we insert the set to the cache before expanding
        // this is needed to avoid recursion if sets are recursively defined
        expandASCache.add(as, result);
 -      sprintf(buffer, "AS%d", as);
-+      asnum_string(buffer, as);
++      asnum_string_dot(buffer, as); // try asdotted
        if (!expandAS(buffer, result)) {
-    expandASCache.nullify(as);
-   delete result;
+-   expandASCache.nullify(as);
+-  delete result;
+-  result = NULL; // A negative cache
++         asnum_string_plain(buffer, as); // that failed, try asplained
++         if (!expandAS(buffer, result)) {
++            expandASCache.nullify(as);
++            delete result;
++            result = NULL; // A negative cache
++         }
+       }
+    }
+ 
diff -r d2d462b8dd8d -r 8f34982bf36c net/irrtoolset-nox11/patches/patch-cz
--- a/net/irrtoolset-nox11/patches/patch-cz     Sun Mar 15 19:57:12 2009 +0000
+++ b/net/irrtoolset-nox11/patches/patch-cz     Sun Mar 15 20:10:35 2009 +0000
@@ -1,8 +1,8 @@
-$NetBSD: patch-cz,v 1.2 2009/02/14 16:17:06 spz Exp $
+$NetBSD: patch-cz,v 1.3 2009/03/15 20:10:36 spz Exp $
 
---- src/rpsl/rpsl/rpsl_asnum.hh.orig   2009-02-13 22:35:13.000000000 +0100
+--- src/rpsl/rpsl/rpsl_asnum.hh.orig   2009-03-15 16:45:45.000000000 +0100
 +++ src/rpsl/rpsl/rpsl_asnum.hh
-@@ -0,0 +1,15 @@
+@@ -0,0 +1,28 @@
 +#ifndef ASNUM_HH
 +#define ASNUM_HH 1
 +
@@ -16,5 +16,18 @@
 +      return sprintf(buf, "AS%d", asno);
 +}
 +
++inline int asnum_string_dot(char *buf, unsigned int asno)
++{
++   if (asno > 65535)
++      return sprintf(buf, "AS%d.%d", asno>>16, asno&0xffff);
++   else
++      return sprintf(buf, "AS%d", asno);
++}
++
++inline int asnum_string_plain(char *buf, unsigned int asno)
++{
++   return sprintf(buf, "AS%d", asno);
++}
++
 +#endif
 +
diff -r d2d462b8dd8d -r 8f34982bf36c net/irrtoolset-nox11/patches/patch-di
--- a/net/irrtoolset-nox11/patches/patch-di     Sun Mar 15 19:57:12 2009 +0000
+++ b/net/irrtoolset-nox11/patches/patch-di     Sun Mar 15 20:10:35 2009 +0000
@@ -1,4 +1,4 @@
-$NetBSD: patch-di,v 1.2 2009/02/14 16:17:06 spz Exp $
+$NetBSD: patch-di,v 1.3 2009/03/15 20:10:36 spz Exp $
 
 --- src/irr/birdwhoisc.cc.orig 2006-10-09 18:05:14.000000000 +0200
 +++ src/irr/birdwhoisc.cc
@@ -9,7 +9,7 @@
 -        cBuffer.append("%s AS%d\n", itrSource()->word, itrOrigin()->asno);
 +        {
 +        char buf[64];
-+        asnum_string(buf, itrOrigin()->asno);
++        asnum_string_dot(buf, itrOrigin()->asno);
 +        cBuffer.append("%s %s\n", itrSource()->word, buf);
 +        }
        }



Home | Main Index | Thread Index | Old Index