aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2016-06-14 18:11:52 +0200
committerDamjan Marion <damarion@cisco.com>2016-06-15 16:17:44 +0200
commita55cf2c1e5ee791e7bc1d657c75eb65255ce050f (patch)
tree76b35417ee570bafe02a9868c5607c0943b588a6
parent584b99a0120778108bd019b697639fbf3c1505d1 (diff)
Reset new indirect adjacdncy template before using it
Change-Id: Ia69ba39364d4dfa1403c8fbb77b7990226bbcb85 Signed-off-by: Damjan Marion <damarion@cisco.com>
-rw-r--r--vnet/vnet/ip/ip4_forward.c2
-rw-r--r--vnet/vnet/ip/ip6_forward.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/vnet/vnet/ip/ip4_forward.c b/vnet/vnet/ip/ip4_forward.c
index ea7a8516dcb..218f6ba3eab 100644
--- a/vnet/vnet/ip/ip4_forward.c
+++ b/vnet/vnet/ip/ip4_forward.c
@@ -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;
diff --git a/vnet/vnet/ip/ip6_forward.c b/vnet/vnet/ip/ip6_forward.c
index fa6f58e85f6..ded8717357f 100644
--- a/vnet/vnet/ip/ip6_forward.c
+++ b/vnet/vnet/ip/ip6_forward.c
@@ -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];