We have too much settings. I doubt that all 8
authorSven-Ola Tuecke <sven-ola@gmx.de>
Sat, 20 Mar 2010 12:13:38 +0000 (13:13 +0100)
committerSven-Ola Tuecke <sven-ola@gmx.de>
Sat, 20 Mar 2010 12:13:38 +0000 (13:13 +0100)
combinations of policy|niit|smartgw have a use
case. Anyhow, repaired niit for which I accidentially
disabled iproute2-rule-fiddeling in my last commit

src/main.c

index a4f361a..73f372c 100644 (file)
@@ -518,7 +518,7 @@ int main(int argc, char *argv[]) {
 
 #ifdef LINUX_NETLINK_ROUTING
   /* create policy routing priorities if necessary */
-  if (olsr_cnf->rt_policy && olsr_cnf->smart_gw_active) {
+  if (olsr_cnf->rt_policy && (olsr_cnf->smart_gw_active || olsr_cnf->use_niit)) {
     struct interface *ifn;
     if (olsr_cnf->rt_table_pri) {
       olsr_os_policy_rule(olsr_cnf->ip_version,
@@ -732,7 +732,7 @@ static void olsr_shutdown(int signo __attribute__ ((unused)))
     close(ifn->send_socket);
 
 #ifdef LINUX_NETLINK_ROUTING
-    if (olsr_cnf->rt_policy && olsr_cnf->smart_gw_active && olsr_cnf->rt_table_defaultolsr_pri) {
+    if (olsr_cnf->rt_policy && (olsr_cnf->smart_gw_active || olsr_cnf->use_niit) && olsr_cnf->rt_table_defaultolsr_pri) {
       olsr_os_policy_rule(olsr_cnf->ip_version,
           olsr_cnf->rt_table_default ? olsr_cnf->rt_table_default : olsr_cnf->rt_table,
           olsr_cnf->rt_table_defaultolsr_pri, ifn->int_name, false);
@@ -750,7 +750,7 @@ static void olsr_shutdown(int signo __attribute__ ((unused)))
   close(olsr_cnf->ioctl_s);
 
 #ifdef LINUX_NETLINK_ROUTING
-  if (olsr_cnf->rt_policy && olsr_cnf->smart_gw_active) {
+  if (olsr_cnf->rt_policy && (olsr_cnf->smart_gw_active || olsr_cnf->use_niit)) {
     if (olsr_cnf->rt_table_pri) {
       olsr_os_policy_rule(olsr_cnf->ip_version,
           olsr_cnf->rt_table, olsr_cnf->rt_table_pri, NULL, false);