diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2020-04-13 13:24:51 -0400 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2020-04-13 17:03:48 -0400 |
| commit | cff0de128d10f1f78144c8c0ca2d2251099d0241 (patch) | |
| tree | 81983a6a370ba2b9ce275d72bfe94a6828d9d4d9 /lib/zclient.c | |
| parent | 41ce53847be14de5e040b02cf2ecb3fe34327b9b (diff) | |
lib: fix SA warning in vrf creation zapi handler
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/zclient.c')
| -rw-r--r-- | lib/zclient.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/zclient.c b/lib/zclient.c index c79e2120b4..5402e9c3c5 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -1724,11 +1724,11 @@ static int zclient_vrf_add(struct zclient *zclient, vrf_id_t vrf_id) if (strlen(vrfname_tmp) == 0) goto stream_failure; - /* Lookup/create vrf by vrf_id. */ + /* Lookup/create vrf by name, then vrf_id. */ vrf = vrf_get(vrf_id, vrfname_tmp); - /* Maybe it already exists? */ - if (!vrf && vrf_get(vrf_id, NULL) != NULL) + /* If there's already a VRF with this name, don't create vrf */ + if (!vrf) return 0; vrf->data.l.table_id = data.l.table_id; |
