summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_evpn_mh.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@nvidia.com>2020-09-23 21:40:28 +0200
committerQuentin Young <qlyoung@nvidia.com>2021-04-28 17:43:50 +0200
commit693fc882d71a97a07c840f1b3c5e29ff02f9d880 (patch)
treec2640d8b4adf23ce4fb7622c183894b6aca7fc27 /zebra/zebra_evpn_mh.c
parentpimd, zebra: explicit cast int netlink val to uint (diff)
downloadfrr-693fc882d71a97a07c840f1b3c5e29ff02f9d880.tar.xz
frr-693fc882d71a97a07c840f1b3c5e29ff02f9d880.zip
zebra: use safe stream decodes for evpn zapi msg
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
Diffstat (limited to 'zebra/zebra_evpn_mh.c')
-rw-r--r--zebra/zebra_evpn_mh.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/zebra/zebra_evpn_mh.c b/zebra/zebra_evpn_mh.c
index cabba707a..0038689e8 100644
--- a/zebra/zebra_evpn_mh.c
+++ b/zebra/zebra_evpn_mh.c
@@ -2484,8 +2484,8 @@ void zebra_evpn_proc_remote_es(ZAPI_HANDLER_ARGS)
memset(&esi, 0, sizeof(esi_t));
s = msg;
- stream_get(&esi, s, sizeof(esi_t));
- vtep_ip.s_addr = stream_get_ipv4(s);
+ STREAM_GET(&esi, s, sizeof(esi_t));
+ STREAM_GET(&vtep_ip.s_addr, s, sizeof(vtep_ip.s_addr));
if (hdr->command == ZEBRA_REMOTE_ES_VTEP_ADD) {
uint32_t zapi_flags;
@@ -2493,16 +2493,19 @@ void zebra_evpn_proc_remote_es(ZAPI_HANDLER_ARGS)
uint16_t df_pref;
bool esr_rxed;
- zapi_flags = stream_getl(s);
+ STREAM_GETL(s, zapi_flags);
esr_rxed = (zapi_flags & ZAPI_ES_VTEP_FLAG_ESR_RXED) ? true
: false;
- df_alg = stream_getc(s);
- df_pref = stream_getw(s);
+ STREAM_GETC(s, df_alg);
+ STREAM_GETW(s, df_pref);
zebra_evpn_remote_es_add(&esi, vtep_ip, esr_rxed, df_alg,
df_pref);
} else {
zebra_evpn_remote_es_del(&esi, vtep_ip);
}
+
+stream_failure:
+ return;
}
void zebra_evpn_es_mac_deref_entry(zebra_mac_t *mac)