diff options
| author | Donald Sharp <donaldsharp72@gmail.com> | 2023-11-21 07:39:18 -0500 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-21 07:39:18 -0500 | 
| commit | e4687579d58868bacc07cb63ee2b8e0d46c6d654 (patch) | |
| tree | 6cf015a955059eb19780429750ff1f89fc21c47d | |
| parent | b06ce4ec8e1266c529100d90806c3aa9b85f40da (diff) | |
| parent | 8318d7ef30481c23b14f08d9250415f59d5c719d (diff) | |
Merge pull request #14842 from FRRouting/mergify/bp/stable/9.1/pr-14835
zebra: Fix fpm multipath encap addition (backport #14835)
| -rw-r--r-- | zebra/rt_netlink.c | 27 | 
1 files changed, 10 insertions, 17 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 7c7c41c4fa..b8362bbba5 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -2473,6 +2473,16 @@ ssize_t netlink_route_multipath_msg_encode(int cmd, struct zebra_dplane_ctx *ctx  					    tag))  					return 0; +				/* +				 * Add encapsulation information when installing via +				 * FPM. +				 */ +				if (fpm) { +					if (!netlink_route_nexthop_encap( +						    &req->n, datalen, nexthop)) +						return 0; +				} +  				if (!setsrc && src1) {  					if (p->family == AF_INET)  						src.ipv4 = src1->ipv4; @@ -2486,23 +2496,6 @@ ssize_t netlink_route_multipath_msg_encode(int cmd, struct zebra_dplane_ctx *ctx  		nl_attr_nest_end(&req->n, nest); -		/* -		 * Add encapsulation information when installing via -		 * FPM. -		 */ -		if (fpm) { -			for (ALL_NEXTHOPS_PTR(dplane_ctx_get_ng(ctx), -					      nexthop)) { -				if (CHECK_FLAG(nexthop->flags, -					       NEXTHOP_FLAG_RECURSIVE)) -					continue; -				if (!netlink_route_nexthop_encap( -					    &req->n, datalen, nexthop)) -					return 0; -			} -		} - -  		if (setsrc) {  			if (p->family == AF_INET) {  				if (!nl_attr_put(&req->n, datalen, RTA_PREFSRC,  | 
