aboutsummaryrefslogtreecommitdiffstats
path: root/extras/strongswan/vpp_sswan/kernel_vpp_net.c
diff options
context:
space:
mode:
authorTimur Celik <mail@timurcelik.de>2022-11-22 17:03:14 +0100
committerFan Zhang <fanzhang.oss@gmail.com>2022-11-23 14:46:32 +0000
commit20721177ecff92edd7b0d0739ca5dc3121791f6f (patch)
tree78cc05f27303008191ef84eed2f9bba719187771 /extras/strongswan/vpp_sswan/kernel_vpp_net.c
parentf0781829d5145f288a2e42978d91bc8df9c50ca4 (diff)
vpp-swan: Fix segfault for multiple addresses
In order to loop over the list of `vl_api_ip_address_details_t`, increment the pointer by one instead of `i`. Type: fix Change-Id: I8554d1388d67bb95e029eddf444d383fb85ecac7 Signed-off-by: Timur Celik <mail@timurcelik.de>
Diffstat (limited to 'extras/strongswan/vpp_sswan/kernel_vpp_net.c')
-rw-r--r--extras/strongswan/vpp_sswan/kernel_vpp_net.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/extras/strongswan/vpp_sswan/kernel_vpp_net.c b/extras/strongswan/vpp_sswan/kernel_vpp_net.c
index 02f002a3183..a29a7c6a4da 100644
--- a/extras/strongswan/vpp_sswan/kernel_vpp_net.c
+++ b/extras/strongswan/vpp_sswan/kernel_vpp_net.c
@@ -563,8 +563,8 @@ update_addrs (private_kernel_vpp_net_t *this, iface_t *entry)
tmp = (vl_api_ip_address_details_t *) out;
for (i = 0; i < num; i++)
{
- tmp += i;
rmp = tmp;
+ tmp += 1;
host = host_create_from_chunk (
AF_INET, chunk_create (rmp->prefix.address.un.ip4, 4), 0);
addrs->insert_last (addrs, host);
@@ -582,8 +582,8 @@ update_addrs (private_kernel_vpp_net_t *this, iface_t *entry)
tmp = (vl_api_ip_address_details_t *) out;
for (i = 0; i < num; i++)
{
- tmp += i;
rmp = tmp;
+ tmp += 1;
host = host_create_from_chunk (
AF_INET6, chunk_create (rmp->prefix.address.un.ip6, 16), 0);
addrs->insert_last (addrs, host);