zebra: check afi validity in vrf label message

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
Quentin Young 2020-01-03 17:49:01 -05:00
parent d35e556c84
commit 663d3a9115

View File

@ -2272,6 +2272,12 @@ static void zread_vrf_label(ZAPI_HANDLER_ARGS)
s = msg; s = msg;
STREAM_GETL(s, nlabel); STREAM_GETL(s, nlabel);
STREAM_GETC(s, afi); STREAM_GETC(s, afi);
if (!(IS_VALID_AFI(afi))) {
zlog_warn("Invalid AFI for VRF label: %u", afi);
return;
}
if (nlabel == zvrf->label[afi]) { if (nlabel == zvrf->label[afi]) {
/* /*
* Nothing to do here move along * Nothing to do here move along