Rename main-ip into routerid in manpage, configfile and olsr_cnf.
authorHenning Rogge <rogge@fgan.de>
Wed, 14 Jan 2009 08:07:40 +0000 (09:07 +0100)
committerHenning Rogge <rogge@fgan.de>
Wed, 14 Jan 2009 08:07:40 +0000 (09:07 +0100)
20 files changed:
files/olsrd-manpages.xml
files/olsrd.8.gz
files/olsrd.conf.5.gz
lib/dot_draw/src/olsrd_dot_draw.c
lib/httpinfo/src/olsrd_httpinfo.c
lib/nameservice/src/mapwrite.c
lib/nameservice/src/nameservice.c
lib/secure/src/olsrd_secure.c
lib/txtinfo/src/olsrd_txtinfo.c
src/build_msg.c
src/interfaces.c
src/ipc_frontend.c
src/lq_packet.c
src/main.c
src/olsr_cfg.c
src/olsr_cfg.h
src/parser.c
src/tc_set.c
src/unix/ifnet.c
src/win32/ifnet.c

index 9e9f0fd..489bf01 100644 (file)
             <replaceable>4</replaceable>.</para>
           </listitem>
         </varlistentry>
+
+        <varlistentry>
+          <term><option>RouterId</option>
+          <replaceable>ipaddress</replaceable></term>
+
+          <listitem>
+            <para>This value controls sets the main ip address (called originator
+            address in OLSR) to a fixed value. This prevents route loss when the
+            first interface of a router vanishes.</para>
+          </listitem>
+        </varlistentry>
       </variablelist>
     </refsect1>
 
index 9033dfb..48dead9 100644 (file)
Binary files a/files/olsrd.8.gz and b/files/olsrd.8.gz differ
index dda455c..ed8b886 100644 (file)
Binary files a/files/olsrd.conf.5.gz and b/files/olsrd.conf.5.gz differ
index ffc33ff..d0c91e3 100644 (file)
@@ -141,7 +141,7 @@ ipc_print_neigh_link(int ipc_connection, const struct neighbor_entry *neighbor)
   struct ipaddr_str mainaddrstrbuf, strbuf;
   olsr_linkcost etx = 0.0;
   const char *style;
-  const char *adr = olsr_ip_to_string(&mainaddrstrbuf, &olsr_cnf->main_addr);
+  const char *adr = olsr_ip_to_string(&mainaddrstrbuf, &olsr_cnf->router_id);
   struct lqtextbuffer lqbuffer;
 
   if (neighbor->status == 0) { /* non SYM */
@@ -302,7 +302,7 @@ pcf_event(int ipc_connection,
     /* Local HNA entries */
     OLSR_FOR_ALL_IPPREFIX_ENTRIES(&olsr_cnf->hna_entries, hna) {
       ipc_print_net(ipc_connection,
-                   &olsr_cnf->main_addr,
+                   &olsr_cnf->router_id,
                     &hna->net);
     } OLSR_FOR_ALL_IPPREFIX_ENTRIES_END()
     ipc_send_str(ipc_connection, "}\n\n");
index 7c757b5..391af31 100644 (file)
@@ -867,7 +867,7 @@ static void build_config_body(struct autobuf *abuf)
 
   abuf_puts(abuf, "<table width=\"100%%\" border=\"0\">\n<tr>");
 
-  abuf_appendf(abuf, "<td>Main address: <strong>%s</strong></td>\n", olsr_ip_to_string(&mainaddrbuf, &olsr_cnf->main_addr));
+  abuf_appendf(abuf, "<td>Main address: <strong>%s</strong></td>\n", olsr_ip_to_string(&mainaddrbuf, &olsr_cnf->router_id));
   abuf_appendf(abuf, "<td>IP version: %d</td>\n", olsr_cnf->ip_version == AF_INET ? 4 : 6);
   abuf_appendf(abuf, "<td>Debug level: %d</td>\n", olsr_cnf->debug_level);
   abuf_appendf(abuf, "<td>FIB Metrics: %s</td>\n", FIBM_FLAT == olsr_cnf->fib_metric ? CFG_FIBM_FLAT : FIBM_CORRECT == olsr_cnf->fib_metric ? CFG_FIBM_CORRECT : CFG_FIBM_APPROX);
index 3258fbd..7618655 100644 (file)
@@ -58,7 +58,7 @@ static char* lookup_position_latlon(union olsr_ip_addr *ip)
   struct db_entry *entry;
   struct list_node *list_head, *list_node;
 
-  if (ipequal(ip, &olsr_cnf->main_addr)) {
+  if (ipequal(ip, &olsr_cnf->router_id)) {
     return my_latlon_str;
   }
 
@@ -97,20 +97,20 @@ void mapwrite_work(FILE* fmap)
     {
       if (olsr_cnf->ip_version == AF_INET)
       {
-        if (!(ip4equal((struct in_addr *)&olsr_cnf->main_addr, &ifs->interf->int_addr.sin_addr)))
+        if (!(ip4equal((struct in_addr *)&olsr_cnf->router_id, &ifs->interf->int_addr.sin_addr)))
         {
           if (0 > fprintf(fmap, "Mid('%s','%s');\n",
-            olsr_ip_to_string(&strbuf1, &olsr_cnf->main_addr),
+            olsr_ip_to_string(&strbuf1, &olsr_cnf->router_id),
             olsr_ip_to_string(&strbuf2, (union olsr_ip_addr *)&ifs->interf->int_addr.sin_addr)))
           {
             return;
           }
         }
       }
-      else if (!(ip6equal((struct in6_addr *)&olsr_cnf->main_addr, &ifs->interf->int6_addr.sin6_addr)))
+      else if (!(ip6equal((struct in6_addr *)&olsr_cnf->router_id, &ifs->interf->int6_addr.sin6_addr)))
       {
         if (0 > fprintf(fmap, "Mid('%s','%s');\n",
-          olsr_ip_to_string(&strbuf1, &olsr_cnf->main_addr),
+          olsr_ip_to_string(&strbuf1, &olsr_cnf->router_id),
           olsr_ip_to_string(&strbuf2, (union olsr_ip_addr *)&ifs->interf->int6_addr.sin6_addr)))
         {
           return;
@@ -133,7 +133,7 @@ void mapwrite_work(FILE* fmap)
   lookup_defhna_latlon(&ip);
   sprintf(my_latlon_str, "%f,%f,%d", my_lat, my_lon, get_isdefhna_latlon());
   if (0 > fprintf(fmap, "Self('%s',%s,'%s','%s');\n",
-    olsr_ip_to_string(&strbuf1, &olsr_cnf->main_addr), my_latlon_str,
+    olsr_ip_to_string(&strbuf1, &olsr_cnf->router_id), my_latlon_str,
     olsr_ip_to_string(&strbuf2, &ip), my_names->name))
   {
     return;
index ec8af59..6acf86a 100644 (file)
@@ -404,13 +404,13 @@ name_init(void)
        for (name = my_names; name != NULL; name = name->next) {
                if (ipequal(&name->ip, &ipz)) {
                        OLSR_PRINTF(2, "NAME PLUGIN: insert main addr for name %s \n", name->name);
-                       name->ip = olsr_cnf->main_addr;
+                       name->ip = olsr_cnf->router_id;
                }
        }
        for (name = my_forwarders; name != NULL; name = name->next) {
                if (name->ip.v4.s_addr == 0) {
                        OLSR_PRINTF(2, "NAME PLUGIN: insert main addr for name %s \n", name->name);
-                       name->ip = olsr_cnf->main_addr;
+                       name->ip = olsr_cnf->router_id;
                }
        }
 
@@ -624,7 +624,7 @@ olsr_namesvc_gen(void *foo __attribute__((unused)))
                /* IPv4 */
                message->v4.olsr_msgtype = MESSAGE_TYPE;
                message->v4.olsr_vtime = reltime_to_me(my_timeout * MSEC_PER_SEC);
-               memcpy(&message->v4.originator, &olsr_cnf->main_addr, olsr_cnf->ipsize);
+               memcpy(&message->v4.originator, &olsr_cnf->router_id, olsr_cnf->ipsize);
                message->v4.ttl = MAX_TTL;
                message->v4.hopcnt = 0;
                message->v4.seqno = htons(get_msg_seqno());
@@ -639,7 +639,7 @@ olsr_namesvc_gen(void *foo __attribute__((unused)))
                /* IPv6 */
                message->v6.olsr_msgtype = MESSAGE_TYPE;
                message->v6.olsr_vtime = reltime_to_me(my_timeout * MSEC_PER_SEC);
-               memcpy(&message->v6.originator, &olsr_cnf->main_addr, olsr_cnf->ipsize);
+               memcpy(&message->v6.originator, &olsr_cnf->router_id, olsr_cnf->ipsize);
                message->v6.ttl = MAX_TTL;
                message->v6.hopcnt = 0;
                message->v6.seqno = htons(get_msg_seqno());
@@ -699,7 +699,7 @@ olsr_parser(union olsr_message *m,
 
        /* Check if message originated from this node.
        If so - back off */
-       if(ipequal(&originator, &olsr_cnf->main_addr))
+       if(ipequal(&originator, &olsr_cnf->router_id))
                return false;
 
        /* Check that the neighbor this message was received from is symmetric.
index bad5cce..1608f85 100644 (file)
@@ -338,7 +338,7 @@ add_signature(uint8_t *pck, int *size)
   msg->olsr_msgtype = MESSAGE_TYPE;
   msg->olsr_vtime = 0;
   msg->olsr_msgsize = htons(sizeof(struct s_olsrmsg));
-  memcpy(&msg->originator, &olsr_cnf->main_addr, olsr_cnf->ipsize);
+  memcpy(&msg->originator, &olsr_cnf->router_id, olsr_cnf->ipsize);
   msg->ttl = 1;
   msg->hopcnt = 0;
   msg->seqno = htons(get_msg_seqno());
@@ -600,7 +600,7 @@ send_challenge(struct interface *olsr_if_config, const union olsr_ip_addr *new_h
   cmsg.olsr_msgtype = TYPE_CHALLENGE;
   cmsg.olsr_vtime = 0;
   cmsg.olsr_msgsize = htons(sizeof(struct challengemsg));
-  memcpy(&cmsg.originator, &olsr_cnf->main_addr, olsr_cnf->ipsize);
+  memcpy(&cmsg.originator, &olsr_cnf->router_id, olsr_cnf->ipsize);
   cmsg.ttl = 1;
   cmsg.hopcnt = 0;
   cmsg.seqno = htons(get_msg_seqno());
@@ -978,7 +978,7 @@ send_cres(struct interface *olsr_if_config, union olsr_ip_addr *to, union olsr_i
   crmsg.olsr_msgtype = TYPE_CRESPONSE;
   crmsg.olsr_vtime = 0;
   crmsg.olsr_msgsize = htons(sizeof(struct c_respmsg));
-  memcpy(&crmsg.originator, &olsr_cnf->main_addr, olsr_cnf->ipsize);
+  memcpy(&crmsg.originator, &olsr_cnf->router_id, olsr_cnf->ipsize);
   crmsg.ttl = 1;
   crmsg.hopcnt = 0;
   crmsg.seqno = htons(get_msg_seqno());
@@ -1058,7 +1058,7 @@ send_rres(struct interface *olsr_if_config, union olsr_ip_addr *to, union olsr_i
   rrmsg.olsr_msgtype = TYPE_RRESPONSE;
   rrmsg.olsr_vtime = 0;
   rrmsg.olsr_msgsize = htons(sizeof(struct r_respmsg));
-  memcpy(&rrmsg.originator, &olsr_cnf->main_addr, olsr_cnf->ipsize);
+  memcpy(&rrmsg.originator, &olsr_cnf->router_id, olsr_cnf->ipsize);
   rrmsg.ttl = 1;
   rrmsg.hopcnt = 0;
   rrmsg.seqno = htons(get_msg_seqno());
index 9414ee8..91e32fc 100644 (file)
@@ -547,7 +547,7 @@ static int ipc_print_hna(struct ipc_conn *conn)
 
     /* Announced HNA entries */
     OLSR_FOR_ALL_IPPREFIX_ENTRIES(&olsr_cnf->hna_entries, hna) {
-        if (ipc_print_hna_entry(&conn->resp, &hna->net, &olsr_cnf->main_addr) < 0) {
+        if (ipc_print_hna_entry(&conn->resp, &hna->net, &olsr_cnf->router_id) < 0) {
             return -1;
         }
     } OLSR_FOR_ALL_IPPREFIX_ENTRIES_END()
index cfc0dc5..e8d1a8e 100644 (file)
@@ -193,7 +193,7 @@ serialize_mid4(struct interface *ifp)
   m->v4.hopcnt = 0;
   m->v4.ttl = MAX_TTL;
   /* Set main(first) address */
-  m->v4.originator = olsr_cnf->main_addr.v4.s_addr;
+  m->v4.originator = olsr_cnf->router_id.v4.s_addr;
   m->v4.olsr_msgtype = MID_MESSAGE;
   m->v4.olsr_vtime = ifp->valtimes.mid;
 
@@ -201,7 +201,7 @@ serialize_mid4(struct interface *ifp)
 
   /* Don't add the main address... it's already there */
   OLSR_FOR_ALL_INTERFACES(ifs) {
-      if(!ipequal(&olsr_cnf->main_addr, &ifs->ip_addr))
+      if(!ipequal(&olsr_cnf->router_id, &ifs->ip_addr))
        {
 #ifdef DEBUG
           struct ipaddr_str buf;
@@ -298,13 +298,13 @@ serialize_mid6(struct interface *ifp)
   m->v6.olsr_msgtype = MID_MESSAGE;
   m->v6.olsr_vtime = ifp->valtimes.mid;
   /* Set main(first) address */
-  m->v6.originator = olsr_cnf->main_addr.v6;
+  m->v6.originator = olsr_cnf->router_id.v6;
 
   addrs6 = m->v6.message.mid.mid_addr;
 
   /* Don't add the main address... it's already there */
   OLSR_FOR_ALL_INTERFACES(ifs) {
-      if(!ipequal(&olsr_cnf->main_addr, &ifs->ip_addr))
+      if(!ipequal(&olsr_cnf->router_id, &ifs->ip_addr))
        {
 #ifdef DEBUG
           struct ipaddr_str buf;
@@ -396,7 +396,7 @@ serialize_hna4(struct interface *ifp)
 
 
   /* Fill header */
-  m->v4.originator = olsr_cnf->main_addr.v4.s_addr;
+  m->v4.originator = olsr_cnf->router_id.v4.s_addr;
   m->v4.hopcnt = 0;
   m->v4.ttl = MAX_TTL;
   m->v4.olsr_msgtype = HNA_MESSAGE;
@@ -484,7 +484,7 @@ serialize_hna6(struct interface *ifp)
   m = (union olsr_message *)msg_buffer;
 
   /* Fill header */
-  m->v6.originator = olsr_cnf->main_addr.v6;
+  m->v6.originator = olsr_cnf->router_id.v6;
   m->v6.hopcnt = 0;
   m->v6.ttl = MAX_TTL;
   m->v6.olsr_msgtype = HNA_MESSAGE;
index c1dfebc..3da6bda 100644 (file)
@@ -187,16 +187,16 @@ remove_interface(struct interface **pinterf)
   net_remove_buffer(ifp);
 
   /* Check main addr */
-  if (!olsr_cnf->fixed_origaddr && ipequal(&olsr_cnf->main_addr, &ifp->ip_addr)) {
+  if (!olsr_cnf->fixed_origaddr && ipequal(&olsr_cnf->router_id, &ifp->ip_addr)) {
     if (list_is_empty(&interface_head)) {
       /* No more interfaces */
-      memset(&olsr_cnf->main_addr, 0, olsr_cnf->ipsize);
+      memset(&olsr_cnf->router_id, 0, olsr_cnf->ipsize);
       OLSR_PRINTF(1, "Removed last interface. Cleared main address.\n");
     } else {
 
       /* Grab the first interface in the list. */
-      olsr_cnf->main_addr = list2interface(interface_head.next)->ip_addr;
-      olsr_ip_to_string(&buf, &olsr_cnf->main_addr);
+      olsr_cnf->router_id = list2interface(interface_head.next)->ip_addr;
+      olsr_ip_to_string(&buf, &olsr_cnf->router_id);
       OLSR_PRINTF(1, "New main address: %s\n", buf.buf);
       olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", buf.buf);
     }
index f4e61e9..35e5fcb 100644 (file)
@@ -413,7 +413,7 @@ ipc_send_net_info(int fd)
   net_msg.ipv6 = olsr_cnf->ip_version == AF_INET ? 0 : 1;
 
   /* Main addr */
-  net_msg.main_addr = olsr_cnf->main_addr;
+  net_msg.main_addr = olsr_cnf->router_id;
 
   /*
   printf("\t");
index 93539e3..deb08e8 100644 (file)
@@ -74,7 +74,7 @@ create_lq_hello(struct lq_hello_message *lq_hello, struct interface *outif)
   lq_hello->comm.vtime = me_to_reltime(outif->valtimes.hello);
   lq_hello->comm.size = 0;
 
-  lq_hello->comm.orig = olsr_cnf->main_addr;
+  lq_hello->comm.orig = olsr_cnf->router_id;
 
   lq_hello->comm.ttl = 1;
   lq_hello->comm.hops = 0;
@@ -165,7 +165,7 @@ create_lq_tc(struct lq_tc_message *lq_tc, struct interface *outif)
   lq_tc->comm.vtime = me_to_reltime(outif->valtimes.tc);
   lq_tc->comm.size = 0;
 
-  lq_tc->comm.orig = olsr_cnf->main_addr;
+  lq_tc->comm.orig = olsr_cnf->router_id;
 
   if (olsr_cnf->lq_fish > 0)
   {
@@ -183,7 +183,7 @@ create_lq_tc(struct lq_tc_message *lq_tc, struct interface *outif)
 
   lq_tc->comm.hops = 0;
 
-  lq_tc->from = olsr_cnf->main_addr;
+  lq_tc->from = olsr_cnf->router_id;
 
   lq_tc->ansn = get_local_ansn();
 
index 2eb3f0b..bae01ad 100644 (file)
@@ -343,7 +343,7 @@ main(int argc, char *argv[])
   /* activate LQ algorithm */
   init_lq_handler();
 
-  OLSR_PRINTF(1, "Main address: %s\n\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
+  OLSR_PRINTF(1, "Main address: %s\n\n", olsr_ip_to_string(&buf, &olsr_cnf->router_id));
 
   /* Start syslog entry */
   olsr_syslog(OLSR_LOG_INFO, "%s successfully started", olsrd_version);
index a34ba2c..9c0e53b 100644 (file)
@@ -1023,7 +1023,7 @@ parse_cfg_option(const int optint, char *argstr, const int line, struct olsr_con
     return parse_cfg_log(argstr, rcfg, rmsg);
     break;
   case 'o':                    /* Originator Address (ip) */
-    if (inet_pton(AF_INET, argstr, &rcfg->main_addr) <= 0) {
+    if (inet_pton(AF_INET, argstr, &rcfg->router_id) <= 0) {
       sprintf(rmsg, "Failed converting IP address %s for originator address\n", argstr);
       return CFG_ERROR;
     }
@@ -1126,7 +1126,7 @@ olsr_parse_cfg(int argc, char *argv[], const char *file, char *rmsg, struct olsr
     {"TcRedundancy",             required_argument, 0, 't'}, /* (i) */
     {"TosValue",                 required_argument, 0, 'Z'}, /* (i) */
     {"Willingness",              required_argument, 0, 'w'}, /* (i) */
-    {"OriginatorAddress",        required_argument, 0, 'o'}, /* (ip) */
+    {"RouterId",                 required_argument, 0, 'o'}, /* (ip) */
     {"UseHysteresis",            required_argument, 0,  0 }, /* ignored */
     {"HystScaling",              required_argument, 0,  0 }, /* ignored */
     {"HystThrHigh",              required_argument, 0,  0 }, /* ignored */
@@ -1514,7 +1514,7 @@ olsr_get_default_cfg(void)
   assert(cfg->willingness == 0);
 
   assert(cfg->system_tick_divider == 0);
-  assert(0 == memcmp(&all_zero, &cfg->main_addr, sizeof(cfg->main_addr)));
+  assert(0 == memcmp(&all_zero, &cfg->router_id, sizeof(cfg->router_id)));
   cfg->will_int = 10 * HELLO_INTERVAL;
   cfg->exit_value = EXIT_SUCCESS;
 
index 56adaca..b8fb7ac 100644 (file)
@@ -216,7 +216,7 @@ struct olsr_config {
    */
 
   uint16_t system_tick_divider;        /* Tick resolution */
-  union olsr_ip_addr main_addr;        /* Main address of this node */
+  union olsr_ip_addr router_id;        /* Main address of this node */
   float will_int;                      /* Willingness update interval if willingness_auto */
   int exit_value;                      /* Global return value for process termination */
 
index 0ee757d..5cf8712 100644 (file)
@@ -313,7 +313,7 @@ static void parse_packet(struct olsr *olsr, int size, struct interface *in_if, u
      */
 
     /* Should be the same for IPv4 and IPv6 */
-    if (ipequal((union olsr_ip_addr *)&m->v4.originator, &olsr_cnf->main_addr)
+    if (ipequal((union olsr_ip_addr *)&m->v4.originator, &olsr_cnf->router_id)
         || !olsr_validate_address((union olsr_ip_addr *)&m->v4.originator)) {
 #ifdef DEBUG
       struct ipaddr_str buf;
index cb870e7..6cbf552 100644 (file)
@@ -132,7 +132,7 @@ olsr_add_tc_entry(const union olsr_ip_addr *adr)
   /*
    * Safety net against loss of the last main IP address.
    */
-  if (ipequal(&olsr_cnf->main_addr, &all_zero)) {
+  if (ipequal(&olsr_cnf->router_id, &all_zero)) {
     return NULL;
   }
 
@@ -208,7 +208,7 @@ olsr_change_myself_tc(void)
     /*
      * Check if there was a change.
      */
-    if (ipequal(&tc_myself->addr, &olsr_cnf->main_addr)) {
+    if (ipequal(&tc_myself->addr, &olsr_cnf->router_id)) {
       return;
     }
 
@@ -221,7 +221,7 @@ olsr_change_myself_tc(void)
   /*
    * The old entry for ourselves is gone, generate a new one and trigger SPF.
    */
-  tc_myself = olsr_add_tc_entry(&olsr_cnf->main_addr);
+  tc_myself = olsr_add_tc_entry(&olsr_cnf->router_id);
   changes_topology = true;
 }
 
index bfe91a4..c6ca5e7 100644 (file)
@@ -220,9 +220,9 @@ chk_if_changed(struct olsr_if_config *iface)
       OLSR_PRINTF(1, "\tNew: %s\n", ip6_to_string(&buf, &tmp_saddr6.sin6_addr));
 
       /* Check main addr */
-      if (!olsr_cnf->fixed_origaddr && ip6equal(&olsr_cnf->main_addr.v6, &tmp_saddr6.sin6_addr)) {
+      if (!olsr_cnf->fixed_origaddr && ip6equal(&olsr_cnf->router_id.v6, &tmp_saddr6.sin6_addr)) {
         /* Update main addr */
-        olsr_cnf->main_addr.v6 = tmp_saddr6.sin6_addr;
+        olsr_cnf->router_id.v6 = tmp_saddr6.sin6_addr;
       }
 
       /* Update address */
@@ -253,10 +253,10 @@ chk_if_changed(struct olsr_if_config *iface)
       OLSR_PRINTF(1, "\tNew:%s\n", ip4_to_string(&buf, tmp_saddr4->sin_addr));
 
       ifp->int_addr = *(struct sockaddr_in *)&ifr.ifr_addr;
-      if (!olsr_cnf->fixed_origaddr && ip4equal(&olsr_cnf->main_addr.v4, &ifp->ip_addr.v4)) {
+      if (!olsr_cnf->fixed_origaddr && ip4equal(&olsr_cnf->router_id.v4, &ifp->ip_addr.v4)) {
         OLSR_PRINTF(1, "New main address: %s\n", ip4_to_string(&buf, tmp_saddr4->sin_addr));
         olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", ip4_to_string(&buf, tmp_saddr4->sin_addr));
-        olsr_cnf->main_addr.v4 = tmp_saddr4->sin_addr;
+        olsr_cnf->router_id.v4 = tmp_saddr4->sin_addr;
       }
 
       ifp->ip_addr.v4 = tmp_saddr4->sin_addr;
@@ -345,10 +345,10 @@ int add_hemu_if (struct olsr_if_config *iface)
   /* Queue */
   list_add_before(&interface_head, &ifp->int_node);
 
-  if (!olsr_cnf->fixed_origaddr && ipequal(&all_zero, &olsr_cnf->main_addr)) {
-    olsr_cnf->main_addr = iface->hemu_ip;
-    OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
-    olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
+  if (!olsr_cnf->fixed_origaddr && ipequal(&all_zero, &olsr_cnf->router_id)) {
+    olsr_cnf->router_id = iface->hemu_ip;
+    OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->router_id));
+    olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->router_id));
   }
 
   ifp->int_mtu = OLSR_DEFAULT_MTU - (olsr_cnf->ip_version == AF_INET6 ? UDP_IPV6_HDRSIZE : UDP_IPV4_HDRSIZE);
@@ -741,11 +741,11 @@ chk_if_up(struct olsr_if_config *iface, int debuglvl __attribute__((unused)))
   /*
    * Set main address if this is the only interface
    */
-  if (!olsr_cnf->fixed_origaddr && ipequal(&all_zero, &olsr_cnf->main_addr)) {
+  if (!olsr_cnf->fixed_origaddr && ipequal(&all_zero, &olsr_cnf->router_id)) {
     struct ipaddr_str buf;
-    olsr_cnf->main_addr = ifp->ip_addr;
-    OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
-    olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
+    olsr_cnf->router_id = ifp->ip_addr;
+    OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->router_id));
+    olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->router_id));
   }
 
   /*
index af0653b..b37c7a8 100644 (file)
@@ -551,10 +551,10 @@ int add_hemu_if(struct olsr_if_config *iface)
   /* Queue */
   list_add_before(&interface_head, &ifp->int_node);
 
-  if(!olsr_cnf->fixed_origaddr && ipequal(&all_zero, &olsr_cnf->main_addr))
+  if(!olsr_cnf->fixed_origaddr && ipequal(&all_zero, &olsr_cnf->router_id))
     {
-      olsr_cnf->main_addr = iface->hemu_ip;
-      OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
+      olsr_cnf->router_id = iface->hemu_ip;
+      OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->router_id));
     }
 
   ifp->int_mtu = OLSR_DEFAULT_MTU;
@@ -752,11 +752,11 @@ int chk_if_changed(struct olsr_if_config *IntConf)
     AddrIn->sin_port = 0;
     AddrIn->sin_addr = NewVal.v4;
 
-    if (!olsr_cnf->fixed_origaddr && olsr_cnf->main_addr.v4.s_addr == OldVal.v4.s_addr)
+    if (!olsr_cnf->fixed_origaddr && olsr_cnf->router_id.v4.s_addr == OldVal.v4.s_addr)
     {
       OLSR_PRINTF(1, "\tMain address change.\n");
 
-      olsr_cnf->main_addr.v4 = NewVal.v4;
+      olsr_cnf->router_id.v4 = NewVal.v4;
     }
 
     Res = 1;
@@ -927,10 +927,10 @@ int chk_if_up(struct olsr_if_config *IntConf, int DebugLevel __attribute__((unus
 
   memset(&NullAddr, 0, olsr_cnf->ipsize);
 
-  if(!olsr_cnf->fixed_origaddr && ipequal(&NullAddr, &olsr_cnf->main_addr))
+  if(!olsr_cnf->fixed_origaddr && ipequal(&NullAddr, &olsr_cnf->router_id))
   {
-    olsr_cnf->main_addr = New->ip_addr;
-    OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
+    olsr_cnf->router_id = New->ip_addr;
+    OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->router_id));
   }
 
   net_add_buffer(New);