summaryrefslogtreecommitdiff
path: root/lib/if.c
diff options
context:
space:
mode:
authorThibaut Collet <thibaut.collet@6wind.com>2018-08-30 16:06:03 +0200
committerThibaut Collet <thibaut.collet@6wind.com>2018-08-30 16:29:06 +0200
commit379eb245f649f04e2ceed0c577bed919dfebd5f6 (patch)
tree7a09a940229c1096cbb3a1d80a84a05612b2f978 /lib/if.c
parentee2f2c23ca2778feafa398e773d24da07d6f174e (diff)
lib/if.c: fix CLANG warning
Fix CLANG warning: Report for if.c | 2 issues =============================================== < WARNING: else is not generally useful after a break or return < #390: FILE: /tmp/f1-28557/if.c:390: Signed-off-by: Thibaut Collet <thibaut.collet@6wind.com>
Diffstat (limited to 'lib/if.c')
-rw-r--r--lib/if.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/lib/if.c b/lib/if.c
index c630dd140a..25da7a8188 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -387,31 +387,31 @@ struct interface *if_get_by_name(const char *name, vrf_id_t vrf_id, int vty)
return NULL;
}
return if_create(name, vrf_id);
- } else {
- ifp = if_lookup_by_name_all_vrf(name);
- if (ifp) {
- if (ifp->vrf_id == vrf_id)
- return ifp;
- /* Found a match on a different VRF. If the interface
- * command was entered in vty without a VRF (passed as
- * VRF_DEFAULT), accept the ifp we found. If a vrf was
- * entered and there is a mismatch, reject it if from
- * vty. If it came from the kernel or by way of zclient,
- * believe it and update the ifp accordingly.
- */
- if (vty) {
- if (vrf_id == VRF_DEFAULT)
- return ifp;
- return NULL;
- }
- /* If it came from the kernel or by way of zclient,
- * believe it and update the ifp accordingly.
- */
- if_update_to_new_vrf(ifp, vrf_id);
+ }
+ /* vrf is based on vrf-lite */
+ ifp = if_lookup_by_name_all_vrf(name);
+ if (ifp) {
+ if (ifp->vrf_id == vrf_id)
return ifp;
+ /* Found a match on a different VRF. If the interface command
+ * was entered in vty without a VRF (passed as VRF_DEFAULT),
+ * accept the ifp we found. If a vrf was entered and there is a
+ * mismatch, reject it if from vty. If it came from the kernel
+ * or by way of zclient, believe it and update the ifp
+ * accordingly.
+ */
+ if (vty) {
+ if (vrf_id == VRF_DEFAULT)
+ return ifp;
+ return NULL;
}
- return if_create(name, vrf_id);
+ /* If it came from the kernel or by way of zclient, believe it
+ * and update the ifp accordingly.
+ */
+ if_update_to_new_vrf(ifp, vrf_id);
+ return ifp;
}
+ return if_create(name, vrf_id);
}
void if_set_index(struct interface *ifp, ifindex_t ifindex)