Author: poeml
Date: Tue Apr 17 00:46:30 2012
New Revision: 92

URL: http://svn.mirrorbrain.org/viewvc/mod_asn?rev=92&view=rev
Log:
asn_get_routeviews script: 
- don't fail when the BGP routing data snapshot contains bogus AS numbers. 
(issue #93)
  Patch courtesy of agy.

Modified:
    trunk/asn_import.py

Modified: trunk/asn_import.py
URL: 
http://svn.mirrorbrain.org/viewvc/mod_asn/trunk/asn_import.py?rev=92&r1=91&r2=92&view=diff
==============================================================================
--- trunk/asn_import.py (original)
+++ trunk/asn_import.py Tue Apr 17 00:46:30 2012
@@ -10,6 +10,8 @@
 tablename = 'pfx2asn'
 # not needed when a MirrorBrain setup exists
 conffile = '/etc/asn_import.conf'
+
+MAX_ASN_INT = 65535
 
 # is there a MirrorBrain config file? If yes, use that.
 try:
@@ -61,6 +63,8 @@
     inserted = 0
     for line in fileinput.input():
         pfx, asnb, asn = line.split()
+        if int(asn) > MAX_ASN_INT:
+            continue
         try:
             cursor.execute("INSERT INTO %s VALUES ( %%s, %%s )" % tablename, 
[pfx, asn])
             inserted += 1




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
        unsubscribe
to the address [email protected]

Reply via email to