]> git.puffer.fish Git - matthieu/frr.git/commitdiff
Some more missing changes
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 22 Jul 2015 20:21:25 +0000 (13:21 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 22 Jul 2015 20:21:25 +0000 (13:21 -0700)
debian/quagga.install
ripd/ripd.h
tools/quagga-reload.py

index 5587c72c8f6a458c833d37cee3457a7e9e0eab6b..5fd9e5c0fa684e1304135ddfd3d4ff2638900f43 100644 (file)
@@ -1,3 +1,4 @@
+etc/quagga/
 usr/bin/vtysh
 usr/include/quagga/
 usr/lib/
index 0fc2fd37562ff33ce2ffdd73374e40ef6ae80533..45b07b9cb6b486c0603eb90f893d3416b415b55e 100644 (file)
@@ -49,7 +49,7 @@
 #define RIP_RTE_SIZE                    20
 
 /* Max count of routing table entry in one rip packet. */
-#define RIP_MAX_RTE   ((RIP_PACKET_MAXSIZ - RIP_HEADER_SIZE) / RIP_RTE_SIZE)
+#define RIP_MAX_RTE                     25
 
 /* RIP version 2 multicast address. */
 #ifndef INADDR_RIP_GROUP
index a07f1423fba1598a8c7b98bb3fd72b8d202515ba..e05d3382f6f006270a9563053cfca61e542996e7 100755 (executable)
@@ -388,6 +388,7 @@ def compare_context_objects(newconf, running):
     # Compare the two Config objects to find the lines that we need to add/del
     lines_to_add = []
     lines_to_del = []
+    restart_bgpd = False
 
     # Find contexts that are in newconf but not in running
     # Find contexts that are in running but not in newconf
@@ -395,8 +396,13 @@ def compare_context_objects(newconf, running):
 
         if running_ctx_keys not in newconf.contexts:
 
+           # Check if bgp's local ASN has changed. If yes, just restart it
+           if "router bgp" in running_ctx_keys[0]:
+               restart_bgpd = True
+               continue
+
             # Non-global context
-            if running_ctx_keys and not ("address-family" in key for key in running_ctx_keys):
+            if running_ctx_keys and not any("address-family" in key for key in running_ctx_keys):
                 lines_to_del.append((running_ctx_keys, None))
 
             # Global context
@@ -422,12 +428,17 @@ def compare_context_objects(newconf, running):
     for (newconf_ctx_keys, newconf_ctx) in newconf.contexts.iteritems():
 
         if newconf_ctx_keys not in running.contexts:
+
+           # If its "router bgp" and we're restarting bgp, skip doing 
+           # anything specific for bgp
+           if "router bgp" in newconf_ctx_keys[0] and restart_bgpd:
+               continue        
             lines_to_add.append((newconf_ctx_keys, None))
 
             for line in newconf_ctx.lines:
                 lines_to_add.append((newconf_ctx_keys, line))
 
-    return (lines_to_add, lines_to_del)
+    return (lines_to_add, lines_to_del, restart_bgpd)
 
 if __name__ == '__main__':
     # Command line options
@@ -478,7 +489,7 @@ if __name__ == '__main__':
 
         #print "Running config context"
         #print running.get_contexts()
-        (lines_to_add, lines_to_del) = compare_context_objects(newconf, running)
+        (lines_to_add, lines_to_del, restart_bgp) = compare_context_objects(newconf, running)
 
         if lines_to_del:
             print "\nLines To Delete"
@@ -504,6 +515,9 @@ if __name__ == '__main__':
                 cmd = line_to_vtysh_conft(ctx_keys, line, False)
                 print cmd
 
+       if restart_bgp:
+            print "BGP local AS changed, restarting bgpd"      
+
         print ''
 
     elif args.reload:
@@ -538,7 +552,7 @@ if __name__ == '__main__':
             running.load_from_show_running()
             logger.info('Running Quagga Config (Pass #%d)\n%s', x, running.get_lines())
 
-            (lines_to_add, lines_to_del) = compare_context_objects(newconf, running)
+            (lines_to_add, lines_to_del, restart_bgp) = compare_context_objects(newconf, running)
 
             if lines_to_del:
                 for (ctx_keys, line) in lines_to_del:
@@ -602,3 +616,7 @@ if __name__ == '__main__':
 
                     subprocess.call(cmd)
 
+           if restart_bgp:
+                   cmd = ['sudo', 'service', 'quagga', 'restart', 'bgpd']
+                   subprocess.call(cmd)
+