summaryrefslogtreecommitdiff
path: root/zebra/rtread_getmsg.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/rtread_getmsg.c')
-rw-r--r--zebra/rtread_getmsg.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/zebra/rtread_getmsg.c b/zebra/rtread_getmsg.c
index 1bba003a0a..62f3224b6e 100644
--- a/zebra/rtread_getmsg.c
+++ b/zebra/rtread_getmsg.c
@@ -75,8 +75,8 @@
static void handle_route_entry(mib2_ipRouteEntry_t *routeEntry)
{
struct prefix prefix;
- struct in_addr tmpaddr, gateway;
- union g_addr *ggateway;
+ struct in_addr tmpaddr;
+ struct nexthop nh;
u_char zebra_flags = 0;
if (routeEntry->ipRouteInfo.re_ire_type & IRE_CACHETABLE)
@@ -93,11 +93,12 @@ static void handle_route_entry(mib2_ipRouteEntry_t *routeEntry)
tmpaddr.s_addr = routeEntry->ipRouteMask;
prefix.prefixlen = ip_masklen(tmpaddr);
- gateway.s_addr = routeEntry->ipRouteNextHop;
- ggateway = (union g_addr *)&gateway;
+ memset(&nh, 0, sizeof(nh));
+ nh.type = NEXTHOP_TYPE_IPV4;
+ nh.gate.ipv4.s_addr = routeEntry->ipRouteNextHop;
rib_add(AFI_IP, SAFI_UNICAST, VRF_DEFAULT, ZEBRA_ROUTE_KERNEL, 0,
- zebra_flags, &prefix, NULL, ggateway, NULL, 0, 0, 0, 0, 0);
+ zebra_flags, &prefix, NULL, &nh, 0, 0, 0, 0);
}
void route_read(struct zebra_ns *zns)