radiusplugin-devel
[Top][All Lists]
Advanced

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

[Radiusplugin-devel] [PATCH] bird support


From: Samuel Thibault
Subject: [Radiusplugin-devel] [PATCH] bird support
Date: Sat, 9 Feb 2013 16:31:00 +0100
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

This migrates to the use of the "ip" command instead of "route", in order to
be able to append "proto static", since this is really a static route entry
that routing daemons should follow; it's neither an ICMP redirection, nor an
autoconfed kernel route, nor a bootup route, nor an RA route.

--- a/UserAcct.cpp
+++ b/UserAcct.cpp
@@ -705,13 +705,13 @@ void UserAcct::delSystemRoutes(PluginCon
                                }
                                                                                
                                        
                                //create system call
-                               strncat(routestring, "route del -net ",15);
+                               strncat(routestring, "ip route del ",13);
                                strncat(routestring, framedip ,16);
                                strncat(routestring, "/" ,1);
                                strncat(routestring, framednetmask_cidr, 2);
                                if (framedgw[0]!='\0')
                                {
-                                       strncat(routestring, " gw ", 4);
+                                       strncat(routestring, " via ", 5);
                                        strncat(routestring, framedgw, 16);
                                }
                                if (framedmetric[0]!='\0')
@@ -721,6 +721,7 @@ void UserAcct::delSystemRoutes(PluginCon
                                }
                                strncat(routestring," dev ",5);
                                strcat(routestring,this->getDev().c_str());
+                               strncat(routestring," proto static",13);
                                //redirect the output stderr to /dev/null
                                strncat(routestring," 2> /dev/null",13);
                                
@@ -846,13 +847,13 @@ void UserAcct::delSystemRoutes(PluginCon
                                }
                                                                                
                                        
                                //create system call
-                               strncat(routestring, "route -6 del ",13);
+                               strncat(routestring, "ip -6 route del ",16);
                                strncat(routestring, framedip ,40);
                                strncat(routestring, "/" ,1);
                                strncat(routestring, framednetmask_cidr, 3);
                                if (framedgw[0]!='\0')
                                {
-                                       strncat(routestring, " gw ", 4);
+                                       strncat(routestring, " via ", 5);
                                        strncat(routestring, framedgw, 40);
                                }
                                if (framedmetric[0]!='\0')
@@ -862,6 +863,7 @@ void UserAcct::delSystemRoutes(PluginCon
                                }
                                strncat(routestring," dev ",5);
                                strcat(routestring,this->getDev().c_str());
+                               strncat(routestring," proto static",13);
                                //redirect the output stderr to /dev/null
                                strncat(routestring," 2> /dev/null",13);
                                
@@ -1010,13 +1012,13 @@ void UserAcct::addSystemRoutes(PluginCon
                                                                                
                                        
                                                                                
                                
                                //create system call
-                               strncat(routestring, "route add -net ",15);
+                               strncat(routestring, "ip route add ",13);
                                strncat(routestring, framedip ,16);
                                strncat(routestring, "/" ,1);
                                strncat(routestring, framednetmask_cidr, 2);
                                if (framedgw[0]!='\0')
                                {
-                                       strncat(routestring, " gw ", 4);
+                                       strncat(routestring, " via ", 5);
                                        strncat(routestring, framedgw, 16);
                                }
                                if (framedmetric[0]!='\0')
@@ -1026,6 +1028,7 @@ void UserAcct::addSystemRoutes(PluginCon
                                }
                                strncat(routestring," dev ",5);
                                strcat(routestring,this->getDev().c_str());
+                               strncat(routestring," proto static",13);
                                //redirect the output stderr to /dev/null
                                strncat(routestring," 2> /dev/null",13);
                                
@@ -1150,13 +1153,13 @@ void UserAcct::addSystemRoutes(PluginCon
                                                                                
                                        
                                                                                
                                
                                //create system call
-                               strncat(routestring, "route -6 add ",13);
+                               strncat(routestring, "ip -6 route add ",21);
                                strncat(routestring, framedip ,40);
                                strncat(routestring, "/" ,1);
                                strncat(routestring, framednetmask_cidr, 3);
                                if (framedgw[0]!='\0')
                                {
-                                       strncat(routestring, " gw ", 4);
+                                       strncat(routestring, " via ", 5);
                                        strncat(routestring, framedgw, 40);
                                }
                                if (framedmetric[0]!='\0')
@@ -1166,6 +1169,7 @@ void UserAcct::addSystemRoutes(PluginCon
                                }
                                strncat(routestring," dev ",5);
                                strcat(routestring,this->getDev().c_str());
+                               strncat(routestring," proto static",13);
                                //redirect the output stderr to /dev/null
                                strncat(routestring," 2> /dev/null",13);
                                



reply via email to

[Prev in Thread] Current Thread [Next in Thread]