Fix Compile errors from clang in FIB2.0 code 52/3752/2
authorNeale Ranns <nranns@cisco.com>
Wed, 9 Nov 2016 17:49:42 +0000 (17:49 +0000)
committerDamjan Marion <dmarion.lists@gmail.com>
Wed, 9 Nov 2016 23:17:54 +0000 (23:17 +0000)
Change-Id: Ief769c966888094944b7a6b7f26527e7eff6103f
Signed-off-by: Neale Ranns <nranns@cisco.com>
15 files changed:
vnet/vnet/adj/adj_internal.h
vnet/vnet/adj/adj_midchain.c
vnet/vnet/dpo/dpo.h
vnet/vnet/dpo/lookup_dpo.c
vnet/vnet/fib/fib_entry_src_default_route.c
vnet/vnet/fib/fib_entry_src_mpls.c
vnet/vnet/fib/fib_entry_src_special.c
vnet/vnet/fib/fib_path.c
vnet/vnet/fib/fib_test.c
vnet/vnet/fib/fib_types.c
vnet/vnet/fib/fib_walk.c
vnet/vnet/fib/fib_walk.h
vnet/vnet/lisp-gpe/interface.c
vnet/vnet/lisp-gpe/lisp_gpe_fwd_entry.c
vnet/vnet/mpls/mpls_output.c

index 8c96659..e3e0e04 100644 (file)
@@ -86,7 +86,7 @@ adj_get_index (ip_adjacency_t *adj)
 }
 
 extern void adj_nbr_update_rewrite_internal (ip_adjacency_t *adj,
-                                            adj_nbr_rewrite_flag_t flags,
+                                            ip_lookup_next_t adj_next_index,
                                             u32 complete_next_index,
                                             u32 next_index,
                                             u8 *rewrite);
index 8786657..d40ea79 100644 (file)
@@ -456,7 +456,7 @@ adj_nbr_midchain_update_rewrite (adj_index_t adj_index,
      * time for walkies fido.
      */
     fib_node_back_walk_ctx_t bw_ctx = {
-       .fnbw_reason = FIB_NODE_BW_REASON_ADJ_UPDATE,
+       .fnbw_reason = FIB_NODE_BW_REASON_FLAG_ADJ_UPDATE,
     };
 
     fib_walk_sync(FIB_NODE_TYPE_ADJ, adj_get_index(adj), &bw_ctx);
index 9065f88..78b657d 100644 (file)
@@ -69,8 +69,8 @@ typedef enum dpo_proto_t_
     DPO_PROTO_MPLS,
 } __attribute__((packed)) dpo_proto_t;
 
-#define DPO_PROTO_NUM (DPO_PROTO_MPLS+1)
-#define DPO_PROTO_NONE (DPO_PROTO_NUM+1)
+#define DPO_PROTO_NUM ((dpo_proto_t)(DPO_PROTO_MPLS+1))
+#define DPO_PROTO_NONE ((dpo_proto_t)(DPO_PROTO_NUM+1))
 
 #define DPO_PROTOS {           \
     [DPO_PROTO_IP4]  = "ip4",  \
index b13000d..e504366 100644 (file)
@@ -379,8 +379,9 @@ lookup_dpo_ip4_inline (vlib_main_t * vm,
            }
 
            /* do lookup */
-           ip4_src_fib_lookup_one (fib_index0, input_addr0, &lbi0);
-           ip4_src_fib_lookup_one (fib_index1, input_addr1, &lbi1);
+           ip4_src_fib_lookup_two (fib_index0, fib_index1,
+                                    input_addr0, input_addr1,
+                                    &lbi0, &lbi1);
            lb0 = load_balance_get(lbi0);
            lb1 = load_balance_get(lbi1);
 
index 8615f72..9f4e7c3 100644 (file)
@@ -22,7 +22,7 @@
 static void
 fib_entry_src_default_route_init (fib_entry_src_t *src)
 {
-    src->fes_flags = FIB_ENTRY_FLAG_NONE;
+    src->fes_flags = FIB_ENTRY_SRC_FLAG_NONE;
 }
 
 static void
index 4c316f7..14c7310 100644 (file)
@@ -29,7 +29,7 @@ fib_entry_src_mpls_init (fib_entry_src_t *src)
 {
     mpls_eos_bit_t eos;
 
-    src->fes_flags = FIB_ENTRY_FLAG_NONE;
+    src->fes_flags = FIB_ENTRY_SRC_FLAG_NONE;
     src->mpls.fesm_label = MPLS_LABEL_INVALID;
 
     FOR_EACH_MPLS_EOS_BIT(eos)
index f73e280..52a6134 100644 (file)
@@ -22,7 +22,7 @@
 static void
 fib_entry_src_special_init (fib_entry_src_t *src)
 {
-    src->fes_flags = FIB_ENTRY_FLAG_NONE;
+    src->fes_flags = FIB_ENTRY_SRC_FLAG_NONE;
 }
 
 /**
index e92e233..7f5aac7 100644 (file)
@@ -885,7 +885,7 @@ static const fib_node_vft_t fib_path_vft = {
 static fib_path_cfg_flags_t
 fib_path_route_flags_to_cfg_flags (const fib_route_path_t *rpath)
 {
-    fib_path_cfg_flags_t cfg_flags = FIB_PATH_CFG_ATTRIBUTE_FIRST;
+    fib_path_cfg_flags_t cfg_flags = FIB_PATH_CFG_FLAG_NONE;
 
     if (rpath->frp_flags & FIB_ROUTE_PATH_RESOLVE_VIA_HOST)
        cfg_flags |= FIB_PATH_CFG_FLAG_RESOLVE_HOST;
index 78b9ec4..358e912 100644 (file)
@@ -962,7 +962,7 @@ fib_test_v4 (void)
     /*
      * update the exclusive to use a different DPO
      */
-    ip_null_dpo_add_and_lock(FIB_PROTOCOL_IP4,
+    ip_null_dpo_add_and_lock(DPO_PROTO_IP4,
                             IP_NULL_ACTION_SEND_ICMP_UNREACH,
                             &ex_dpo);
     fib_table_entry_special_dpo_update(fib_index,
@@ -6115,7 +6115,7 @@ fib_test_walk (void)
     /*
      * enqueue a walk across the parents children.
      */
-    high_ctx.fnbw_reason = FIB_NODE_BW_REASON_RESOLVE;
+    high_ctx.fnbw_reason = FIB_NODE_BW_REASON_FLAG_RESOLVE;
 
     fib_walk_async(FIB_NODE_TYPE_TEST, PARENT_INDEX,
                    FIB_WALK_PRIORITY_HIGH, &high_ctx);
@@ -6245,7 +6245,7 @@ fib_test_walk (void)
      * we do this by giving the queue draining process zero
      * time quanta. it's a do..while loop, so it does something.
      */
-    high_ctx.fnbw_reason = FIB_NODE_BW_REASON_RESOLVE;
+    high_ctx.fnbw_reason = FIB_NODE_BW_REASON_FLAG_RESOLVE;
 
     fib_walk_async(FIB_NODE_TYPE_TEST, PARENT_INDEX,
                    FIB_WALK_PRIORITY_HIGH, &high_ctx);
@@ -6332,7 +6332,7 @@ fib_test_walk (void)
      * park a async walk in the middle of the list, then have an sync walk catch
      * it. same expectations as async catches async.
      */
-    high_ctx.fnbw_reason = FIB_NODE_BW_REASON_RESOLVE;
+    high_ctx.fnbw_reason = FIB_NODE_BW_REASON_FLAG_RESOLVE;
 
     fib_walk_async(FIB_NODE_TYPE_TEST, PARENT_INDEX,
                    FIB_WALK_PRIORITY_HIGH, &high_ctx);
index f559ee5..383d48e 100644 (file)
@@ -329,5 +329,5 @@ fib_forw_chain_type_to_dpo_proto (fib_forward_chain_type_t fct)
     case FIB_FORW_CHAIN_TYPE_MPLS_NON_EOS:
        return (DPO_PROTO_MPLS);
     }
-    return (VNET_LINK_IP4);
+    return (DPO_PROTO_IP4);
 }
index 078a651..83f09e3 100644 (file)
@@ -108,7 +108,7 @@ typedef enum fib_walk_queue_stats_t_
     FIB_WALK_SCHEDULED,
     FIB_WALK_COMPLETED,
 } fib_walk_queue_stats_t;
-#define FIB_WALK_QUEUE_STATS_NUM (FIB_WALK_COMPLETED+1)
+#define FIB_WALK_QUEUE_STATS_NUM ((fib_walk_queue_stats_t)(FIB_WALK_COMPLETED+1))
 
 #define FIB_WALK_QUEUE_STATS {           \
     [FIB_WALK_SCHEDULED] = "scheduled",  \
index 7ae99d0..7413d8a 100644 (file)
@@ -29,7 +29,7 @@ typedef enum fib_walk_priority_t_
     FIB_WALK_PRIORITY_LOW  = 1,
 } fib_walk_priority_t;
 
-#define FIB_WALK_PRIORITY_NUM (FIB_WALK_PRIORITY_LOW+1)
+#define FIB_WALK_PRIORITY_NUM ((fib_walk_priority_t)(FIB_WALK_PRIORITY_LOW+1))
 
 #define FIB_WALK_PRIORITIES {           \
     [FIB_WALK_PRIORITY_HIGH] = "high",  \
index 15d203c..b293e2d 100644 (file)
@@ -194,7 +194,6 @@ format_lisp_gpe_header_with_length (u8 * s, va_list * args)
 VNET_HW_INTERFACE_CLASS (lisp_gpe_hw_class) = {
   .name = "LISP_GPE",
   .format_header = format_lisp_gpe_header_with_length,
-  .build_rewrite = default_build_rewrite,
   .build_rewrite = lisp_gpe_build_rewrite,
   .update_adjacency = lisp_gpe_update_adjacency,
 };
index 54ee86d..c7aafc6 100644 (file)
@@ -267,7 +267,7 @@ create_fib_entries (lisp_gpe_fwd_entry_t * lfe)
   dpo_proto_t dproto;
 
   dproto = (ip_prefix_version (&lfe->key->rmt.ippref) == IP4 ?
-           FIB_PROTOCOL_IP4 : FIB_PROTOCOL_IP6);
+           DPO_PROTO_IP4 : DPO_PROTO_IP6);
 
   lfe->src_fib_index = ip_dst_fib_add_route (lfe->eid_fib_index,
                                             &lfe->key->rmt.ippref);
index 739e85d..91514d6 100644 (file)
@@ -342,8 +342,6 @@ VLIB_REGISTER_NODE (mpls_adj_incomplete_node) = {
     foreach_mpls_adj_incomplete_next
 #undef _
   },
-
-  .format_trace = format_mpls_output_trace,
 };
 
 VLIB_NODE_FUNCTION_MULTIARCH (mpls_adj_incomplete_node,