diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index de01ced411ef..a540687691fd 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -2328,19 +2328,21 @@ ssize_t netlink_route_multipath_msg_encode(int cmd, p, routedesc, bytelen, nexthop, &req->n, &req->r, datalen, cmd)) return 0; + + /* + * Add encapsulation information when + * installing via FPM. + */ + if (fpm) { + if (!netlink_route_nexthop_encap(&req->n, + datalen, + nexthop)) + return 0; + } + nexthop_num++; break; } - - /* - * Add encapsulation information when installing via - * FPM. - */ - if (fpm) { - if (!netlink_route_nexthop_encap( - &req->n, datalen, nexthop)) - return 0; - } } if (setsrc) {