mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 04:23:00 +00:00
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>
This commit is contained in:
parent
a36fbef21a
commit
6bba65f29f
@ -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++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user