diff options
author | Pavel Kotucek <pkotucek@cisco.com> | 2016-10-07 08:38:45 +0200 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2016-10-07 11:39:47 +0000 |
commit | 02c826c6abf8dc5ca95b05b219532d9bb0f10312 (patch) | |
tree | e8d70523f9f4f335f294008e90b7ecca9548933c | |
parent | 025943b9d0629e69343e28a478b3fa2e6d23fa16 (diff) |
VPP-466: PG pg_create_interface API returns wrong interface index
Change-Id: Ife7b2907012a79e6893cfa7f2cf61c7a54865248
Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
-rw-r--r-- | vpp/vpp-api/api.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/vpp/vpp-api/api.c b/vpp/vpp-api/api.c index 0eb7573df23..028e67bc245 100644 --- a/vpp/vpp-api/api.c +++ b/vpp/vpp-api/api.c @@ -8144,12 +8144,13 @@ vl_api_pg_create_interface_t_handler (vl_api_pg_create_interface_t * mp) int rv = 0; pg_main_t *pg = &pg_main; - u32 sw_if_index = pg_interface_add_or_get (pg, ntohl (mp->interface_id)); + u32 pg_if_id = pg_interface_add_or_get (pg, ntohl (mp->interface_id)); + pg_interface_t *pi = pool_elt_at_index (pg->interfaces, pg_if_id); /* *INDENT-OFF* */ REPLY_MACRO2(VL_API_PG_CREATE_INTERFACE_REPLY, ({ - rmp->sw_if_index = ntohl(sw_if_index); + rmp->sw_if_index = ntohl(pi->sw_if_index); })); /* *INDENT-ON* */ } |