Reset new indirect adjacdncy template before using it 67/1567/1
authorDamjan Marion <[email protected]>
Tue, 14 Jun 2016 16:11:52 +0000 (18:11 +0200)
committerDamjan Marion <[email protected]>
Wed, 15 Jun 2016 14:17:44 +0000 (16:17 +0200)
Change-Id: Ia69ba39364d4dfa1403c8fbb77b7990226bbcb85
Signed-off-by: Damjan Marion <[email protected]>
vnet/vnet/ip/ip4_forward.c
vnet/vnet/ip/ip6_forward.c

index ea7a851..218f6ba 100644 (file)
@@ -344,6 +344,8 @@ ip4_add_del_route_next_hop (ip4_main_t * im,
                {
                  /* Next hop is not known, so create indirect adj */
                  ip_adjacency_t add_adj;
+                 memset (&add_adj, 0, sizeof(add_adj));
+                 add_adj.n_adj = 1;
                  add_adj.lookup_next_index = IP_LOOKUP_NEXT_INDIRECT;
                  add_adj.indirect.next_hop.ip4.as_u32 = next_hop->as_u32;
                  add_adj.explicit_fib_index = explicit_fib_index;
index fa6f58e..ded8717 100644 (file)
@@ -378,6 +378,8 @@ ip6_add_del_route_next_hop (ip6_main_t * im,
             else
             {
              ip_adjacency_t add_adj;
+             memset (&add_adj, 0, sizeof(add_adj));
+             add_adj.n_adj = 1;
              add_adj.lookup_next_index = IP_LOOKUP_NEXT_INDIRECT;
              add_adj.indirect.next_hop.ip6.as_u64[0] = next_hop->as_u64[0];
              add_adj.indirect.next_hop.ip6.as_u64[1] = next_hop->as_u64[1];