Skip to content

Commit

Permalink
wip helpers
Browse files Browse the repository at this point in the history
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
  • Loading branch information
cscarpitta committed Nov 14, 2022
1 parent cab3b30 commit aed277f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tests/mock_tests/fpmsyncd/ut_helpers_fpmsyncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
#include <linux/netlink.h>
#include <linux/rtnetlink.h>

#define IPV6_MAX_BYTE 16
#define IPV6_MAX_BYTE 16
#define IPV6_MAX_BITLEN 128

/*
* Mock rtnl_link_i2name() call
Expand Down Expand Up @@ -132,10 +133,8 @@ namespace ut_fpmsyncd
/* Add the destination address */
if (dst->isV4())
{
uint32_t ip = dst->getIp().getV4Addr();

if (!nl_attr_put(&nl_obj->n, sizeof(*nl_obj),
RTA_DST, &ip, sizeof(ip)))
if (!nl_attr_put32(&nl_obj->n, sizeof(*nl_obj),
RTA_DST, dst->getIp().getV4Addr()))
return NULL;
}
else
Expand Down Expand Up @@ -217,7 +216,7 @@ namespace ut_fpmsyncd
nl_obj->n.nlmsg_pid = 100;

nl_obj->r.rtm_family = AF_INET6;
nl_obj->r.rtm_dst_len = 128;
nl_obj->r.rtm_dst_len = IPV6_MAX_BITLEN;
nl_obj->r.rtm_scope = RT_SCOPE_UNIVERSE;

nl_obj->r.rtm_protocol = 11; // Protocol ZEBRA
Expand Down

0 comments on commit aed277f

Please sign in to comment.