aboutsummaryrefslogtreecommitdiffstats
path: root/vnet/vnet/ip/lookup.c
diff options
context:
space:
mode:
authorPierre Pfister <ppfister@cisco.com>2016-04-25 14:15:15 +0100
committerDamjan Marion <damarion@cisco.com>2016-04-26 14:09:00 +0000
commit1dabaafcebb02699cae1ebd2b58e34dfe6b0f064 (patch)
treef07da13dee800ebbbdab85233249289c38c89203 /vnet/vnet/ip/lookup.c
parent0371807f7b1213ee474f8850dc85ae5dd0a24532 (diff)
Port glean neighbor entry support to IPv6
This patch is more or less a port of I71f3ba0c8192 to IPv6. In practice it allows creating a route via a neighbor which is not resolved yet. It also adds static flag to IPv6 neighbor entries. And as Damjan suggested, it formalizes ip46_address_t by using the IPv4 embedded IPv6 address format. Change-Id: Ifa7328a03380ea4ff118b7ca4897b4ab23a3e57c Signed-off-by: Pierre Pfister <ppfister@cisco.com>
Diffstat (limited to 'vnet/vnet/ip/lookup.c')
-rw-r--r--vnet/vnet/ip/lookup.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/vnet/vnet/ip/lookup.c b/vnet/vnet/ip/lookup.c
index 9e3cdc0c12d..df14a5fefe3 100644
--- a/vnet/vnet/ip/lookup.c
+++ b/vnet/vnet/ip/lookup.c
@@ -998,8 +998,8 @@ u8 * format_ip_adjacency (u8 * s, va_list * args)
case IP_LOOKUP_NEXT_ARP:
if (adj->if_address_index != ~0)
s = format (s, " %U", format_ip_interface_address, lm, adj->if_address_index);
- if (adj->arp.next_hop.ip4.as_u32)
- s = format (s, " via %U", format_ip4_address, &adj->arp.next_hop.ip4.as_u32);
+ if (adj->arp.next_hop.ip6.as_u64[0] || adj->arp.next_hop.ip6.as_u64[1])
+ s = format (s, " via %U", format_ip46_address, &adj->arp.next_hop);
break;
case IP_LOOKUP_NEXT_LOCAL:
if (adj->if_address_index != ~0)
@@ -1091,7 +1091,7 @@ static uword unformat_ip_adjacency (unformat_input_t * input, va_list * args)
if (unformat (input, "arp %U %U",
unformat_vnet_sw_interface, vnm, &sw_if_index,
- unformat_ip46_address, &a46, is_ip6))
+ unformat_ip46_address, &a46, is_ip6?IP46_TYPE_IP6:IP46_TYPE_IP4))
{
ip_lookup_main_t * lm = is_ip6 ? &ip6_main.lookup_main : &ip4_main.lookup_main;
ip_adjacency_t * a_adj;