Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
{
nexthop.s_addr = 0;
nexthop_type = stream_getc (s);
- if (nexthop_type == ZEBRA_NEXTHOP_IPV4)
+ switch (nexthop_type)
{
+ case ZEBRA_NEXTHOP_IPV4:
nexthop.s_addr = stream_get_ipv4 (s);
- if (igpnexthop)
- *igpnexthop = nexthop;
+ break;
+ case ZEBRA_NEXTHOP_IPV4_IFINDEX:
+ nexthop.s_addr = stream_get_ipv4 (s);
+ /* ifindex */ (void)stream_getl (s);
+ break;
+ default:
+ /* do nothing */
+ break;
}
- else
- *igpnexthop = nexthop;
+ *igpnexthop = nexthop;
return 1;
}
case ZEBRA_NEXTHOP_IPV4:
stream_put_in_addr (s, &nexthop->gate.ipv4);
break;
+ case ZEBRA_NEXTHOP_IPV4_IFINDEX:
+ stream_put_in_addr (s, &nexthop->gate.ipv4);
+ stream_putl (s, nexthop->ifindex);
+ break;
case ZEBRA_NEXTHOP_IFINDEX:
case ZEBRA_NEXTHOP_IFNAME:
stream_putl (s, nexthop->ifindex);