summaryrefslogtreecommitdiffstats
path: root/tests/bgpd/test_capability.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2018-02-02 00:04:03 +0100
committerRenato Westphal <renato@opensourcerouting.org>2018-02-02 19:31:07 +0100
commit6bba65f29f4d8801930a6a0b87bd7a2906617622 (patch)
treebe386a105cbd4964a0b57a9ca9f0f376643596e3 /tests/bgpd/test_capability.c
parenttests: fix warnings by removing dead code (diff)
downloadfrr-6bba65f29f4d8801930a6a0b87bd7a2906617622.tar.xz
frr-6bba65f29f4d8801930a6a0b87bd7a2906617622.zip
tests: fix warnings related to afi/safi constants
We were improperly mixing constants used to identify AFI/SAFI values using the IANA and internal representations. Things happened to be working because the IANA/internal values are the same in some cases (e.g. AFI_IP and IANA_AFI_IPV4). This commit fixes a few warnings when running "make check" on FreeBSD 11.1. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'tests/bgpd/test_capability.c')
-rw-r--r--tests/bgpd/test_capability.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/tests/bgpd/test_capability.c b/tests/bgpd/test_capability.c
index 3d5518f3b..69f5afb99 100644
--- a/tests/bgpd/test_capability.c
+++ b/tests/bgpd/test_capability.c
@@ -63,8 +63,8 @@ static struct test_segment {
/* AFI/SAFI validation */
int validate_afi;
- afi_t afi;
- safi_t safi;
+ iana_afi_t afi;
+ iana_safi_t safi;
#define VALID_AFI 1
#define INVALID_AFI 0
int afi_valid;
@@ -113,8 +113,8 @@ static struct test_segment mp_segments[] = {
SHOULD_PARSE,
0,
1,
- AFI_IP,
- SAFI_UNICAST,
+ IANA_AFI_IPV4,
+ IANA_SAFI_UNICAST,
VALID_AFI,
},
{
@@ -125,8 +125,8 @@ static struct test_segment mp_segments[] = {
SHOULD_PARSE,
0,
1,
- AFI_IP6,
- SAFI_UNICAST,
+ IANA_AFI_IPV6,
+ IANA_SAFI_UNICAST,
VALID_AFI,
},
/* 5 */
@@ -138,8 +138,8 @@ static struct test_segment mp_segments[] = {
SHOULD_PARSE,
0,
1,
- AFI_IP,
- SAFI_MULTICAST,
+ IANA_AFI_IPV4,
+ IANA_SAFI_MULTICAST,
VALID_AFI,
},
/* 6 */
@@ -151,7 +151,7 @@ static struct test_segment mp_segments[] = {
SHOULD_PARSE,
0,
1,
- AFI_IP6,
+ IANA_AFI_IPV6,
IANA_SAFI_MPLS_VPN,
VALID_AFI,
},
@@ -164,7 +164,7 @@ static struct test_segment mp_segments[] = {
SHOULD_PARSE,
0,
1,
- AFI_IP6,
+ IANA_AFI_IPV6,
IANA_SAFI_MPLS_VPN,
VALID_AFI,
},
@@ -177,7 +177,7 @@ static struct test_segment mp_segments[] = {
SHOULD_PARSE,
0,
1,
- AFI_IP,
+ IANA_AFI_IPV4,
IANA_SAFI_MPLS_VPN,
VALID_AFI,
},
@@ -211,8 +211,8 @@ static struct test_segment mp_segments[] = {
SHOULD_ERR,
0,
1,
- AFI_IP,
- SAFI_UNICAST,
+ IANA_AFI_IPV4,
+ IANA_SAFI_UNICAST,
VALID_AFI,
},
{NULL, NULL, {0}, 0, 0}};
@@ -844,8 +844,7 @@ static void parse_test(struct peer *peer, struct test_segment *t, int type)
safi_t safi;
/* Convert AFI, SAFI to internal values, check. */
- if (bgp_map_afi_safi_iana2int(afi_int2iana(t->afi), t->safi,
- &afi, &safi)) {
+ if (bgp_map_afi_safi_iana2int(t->afi, t->safi, &afi, &safi)) {
if (t->afi_valid == VALID_AFI)
failed++;
}