]> git.puffer.fish Git - matthieu/frr.git/commit
lib: Route-map failed for OSPF routes even for matching prefixes
authorMobashshera Rasool <mrasool@vmware.com>
Fri, 4 Mar 2022 09:21:48 +0000 (01:21 -0800)
committerMobashshera Rasool <mrasool@vmware.com>
Fri, 4 Mar 2022 11:57:09 +0000 (03:57 -0800)
commita34ce5c5e426044fa2490b1278c2e17d08a67b2d
tree587141fb3bc9fa7c838f1b1cc0643ef310caa238
parent7469f084f3b82e47f72a173570e0d9045f1ac171
lib: Route-map failed for OSPF routes even for matching prefixes

This issue is applicable to other protocols as well.
When user has used route-map, even though the prefixes are falling
under the permit rule, the prefixes were denied and were shown
as inactive route in zebra.

Reason being the parameter which is of type enum was passed to the api
route_map_get_index and was typecasted to uint8_t *.
This problem is visible in case of Big Endian systems because we are
accessing the most significant byte.

'match_ret' field is an enum in the caller and so it is of 4 bytes,
the typecasting it to 1 byte and passing it to the api made
the api to put the value in the most significant byte
which was already zero previously. Therefore the actual value
RMAP_NOMATCH which was 1 never gets reset in this case.
Therefore the api always returns 'RMAP_NOMATCH' and hence
the prefixes are always denied.

Fixes: #9782
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
lib/routemap.c