summaryrefslogtreecommitdiff
path: root/lib/if.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@users.noreply.github.com>2017-09-17 19:23:16 -0400
committerGitHub <noreply@github.com>2017-09-17 19:23:16 -0400
commita7dd519b58c9f68d0b74bd6fb5daaf88e84ece63 (patch)
treef92c696d8b17e153953d0c3123d03bc7e41c09f3 /lib/if.c
parentaf34a65a62efc13310facf054ac388d45e9c2e01 (diff)
parenta2addae8fe172f04f4d8ac99aa123a7d2dd64604 (diff)
Merge pull request #1188 from opensourcerouting/foreach_indentation
*: use clang's 'ForEachMacros' format style option
Diffstat (limited to 'lib/if.c')
-rw-r--r--lib/if.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/if.c b/lib/if.c
index 43c382beaa..7d27229656 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -249,8 +249,7 @@ struct interface *if_lookup_by_name_all_vrf(const char *name)
struct vrf *vrf;
struct interface *ifp;
- RB_FOREACH(vrf, vrf_id_head, &vrfs_by_id)
- {
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) {
ifp = if_lookup_by_name(name, vrf->vrf_id);
if (ifp)
return ifp;
@@ -386,8 +385,7 @@ struct interface *if_get_by_name_len(const char *name, size_t namelen,
return ifp;
/* Didn't find the interface on that vrf. Defined on a different one? */
- RB_FOREACH(vrf, vrf_id_head, &vrfs_by_id)
- {
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) {
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(vrf->vrf_id), node, ifp)) {
if (!memcmp(name, ifp->name, namelen)
&& (ifp->name[namelen] == '\0')) {
@@ -541,10 +539,10 @@ void if_dump_all(void)
struct listnode *node;
void *p;
- RB_FOREACH(vrf, vrf_id_head, &vrfs_by_id)
- if (vrf->iflist != NULL)
- for (ALL_LIST_ELEMENTS_RO(vrf->iflist, node, p))
- if_dump(p);
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id)
+ if (vrf->iflist != NULL)
+ for (ALL_LIST_ELEMENTS_RO(vrf->iflist, node, p))
+ if_dump(p);
}
DEFUN (interface_desc,
@@ -1053,8 +1051,7 @@ static void if_autocomplete(vector comps, struct cmd_token *token)
struct listnode *ln;
struct vrf *vrf = NULL;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
for (ALL_LIST_ELEMENTS_RO(vrf->iflist, ln, ifp))
vector_set(comps, XSTRDUP(MTYPE_COMPLETION, ifp->name));
}