Hi,

In LTE_fdd_enodeb/src/LTE_fdd_enb_gw.cc, I saw a lot of inessential/unwanted assignment statements:

started   = false;

I'm not sure, the optimizer can/will remove these, hence I'm submitting a patch for your kind review and adaption, if seems apropriate to you.

diff -Nur openlte_v00-20-04.orig/LTE_fdd_enodeb/src/LTE_fdd_enb_gw.cc openlte_v00-20-04/LTE_fdd_enodeb/src/LTE_fdd_enb_gw.cc
--- openlte_v00-20-04.orig/LTE_fdd_enodeb/src/LTE_fdd_enb_gw.cc 2016-07-04 22:01:38.000000000 +0000
+++ openlte_v00-20-04/LTE_fdd_enodeb/src/LTE_fdd_enb_gw.cc  2017-03-10 12:19:03.144404524 +0000
@@ -140,7 +140,6 @@
     if(!started)
     {
         interface = iface;
-        started   = true;

         cnfg_db->get_param(LTE_FDD_ENB_PARAM_IP_ADDR_START, ip_addr);

@@ -149,7 +148,6 @@
         if(0 > tun_fd)
         {
             err_str = strerror(errno);
-            started = false;
             return(LTE_FDD_ENB_ERROR_CANT_START);
         }
         memset(&ifr, 0, sizeof(ifr));
@@ -158,7 +156,6 @@
         if(0 > ioctl(tun_fd, TUNSETIFF, &ifr))
         {
             err_str = strerror(errno);
-            started = false;
             close(tun_fd);
             return(LTE_FDD_ENB_ERROR_CANT_START);
         }
@@ -170,7 +167,6 @@
         if(0 > ioctl(sock, SIOCSIFADDR, &ifr))
         {
             err_str = strerror(errno);
-            started = false;
             close(tun_fd);
             return(LTE_FDD_ENB_ERROR_CANT_START);
         }
@@ -179,7 +175,6 @@
         if(0 > ioctl(sock, SIOCSIFNETMASK, &ifr))
         {
             err_str = strerror(errno);
-            started = false;
             close(tun_fd);
             return(LTE_FDD_ENB_ERROR_CANT_START);
         }
@@ -188,7 +183,6 @@
         if(0 > ioctl(sock, SIOCGIFFLAGS, &ifr))
         {
             err_str = strerror(errno);
-            started = false;
             close(tun_fd);
             return(LTE_FDD_ENB_ERROR_CANT_START);
         }
@@ -196,7 +190,6 @@
         if(0 > ioctl(sock, SIOCSIFFLAGS, &ifr))
         {
             err_str = strerror(errno);
-            started = false;
             close(tun_fd);
             return(LTE_FDD_ENB_ERROR_CANT_START);
         }
@@ -208,6 +201,7 @@

         // Setup a thread to receive packets from the TUN device
         pthread_create(&rx_thread, NULL, &receive_thread, this);
+        started = true;
     }

     return(LTE_FDD_ENB_ERROR_NONE);
 

Last edit: Balwinder S Dheeman 2017-04-05