]> git.proxmox.com Git - mirror_frr.git/blobdiff - babeld/kernel.c
Merge pull request #5793 from ton31337/fix/formatting_show_bgp_summary_failed
[mirror_frr.git] / babeld / kernel.c
index 3343ca2e9538a3acba11a10a72d6be72df0ad0f7..d4c962af3b4390d38ce78ab57e1f742defe09003 100644 (file)
@@ -21,6 +21,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
 */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <sys/time.h>
 #include <sys/param.h>
 #include <time.h>
@@ -73,9 +77,9 @@ kernel_interface_wireless(struct interface *interface)
 }
 
 int
-kernel_route(int operation, const unsigned char *pref, unsigned short plen,
-             const unsigned char *gate, int ifindex, unsigned int metric,
-             const unsigned char *newgate, int newifindex,
+kernel_route(enum babel_kernel_routes operation, const unsigned char *pref,
+            unsigned short plen, const unsigned char *gate, int ifindex,
+            unsigned int metric, const unsigned char *newgate, int newifindex,
              unsigned int newmetric)
 {
     int rc;
@@ -116,12 +120,9 @@ kernel_route(int operation, const unsigned char *pref, unsigned short plen,
                              newmetric);
             return rc;
             break;
-        default:
-            zlog_err("this should never happen (false value - kernel_route)");
-            assert(0);
-            exit(1);
-            break;
     }
+
+    return 0;
 }
 
 static int
@@ -174,8 +175,8 @@ zebra_route(int add, int family, const unsigned char *pref, unsigned short plen,
         SET_FLAG(api.message, ZAPI_MESSAGE_NEXTHOP);
         api.nexthop_num = 1;
         api_nh->ifindex = ifindex;
-
-        switch (family) {
+       api_nh->vrf_id = VRF_DEFAULT;
+       switch (family) {
         case AF_INET:
             uchar_to_inaddr(&api_nh->gate.ipv4, gate);
             if (IPV4_ADDR_SAME (&api_nh->gate.ipv4, &quagga_prefix.u.prefix4) &&
@@ -203,14 +204,14 @@ zebra_route(int add, int family, const unsigned char *pref, unsigned short plen,
 }
 
 int
-if_eui64(char *ifname, int ifindex, unsigned char *eui)
+if_eui64(int ifindex, unsigned char *eui)
 {
     struct interface *ifp = if_lookup_by_index(ifindex, VRF_DEFAULT);
     if (ifp == NULL) {
         return -1;
     }
 
-    u_char len = (u_char) ifp->hw_addr_len;
+    uint8_t len = (uint8_t)ifp->hw_addr_len;
     char *tmp = (void*) ifp->hw_addr;
 
     if (len == 8) {