summaryrefslogtreecommitdiff
path: root/lib/if.c
diff options
context:
space:
mode:
authorFeng Lu <lu.feng@6wind.com>2015-05-22 11:39:57 +0200
committerVipin Kumar <vipin@cumulusnetworks.com>2015-10-29 16:49:39 -0700
commit3968dbf8ef4966fb3f9d38640ea9c5a9f13419cf (patch)
tree1f5e7a550b554690e679eeb00657b21a4d513cde /lib/if.c
parentb72ede27fd39c2e97dbf31715464573c30de557f (diff)
lib, zebra: add "vrf_id" into the "struct interface"
Later, an interface will belong to a specific VRF. Now we add a property "vrf_id" to the "struct interface", and keep it as the default value 0. This property is shown when displaying interfaces information. It is also added in some logs. This is just the preparation to move the interace list into the "struct vrf". The main logic is not changed. Signed-off-by: Feng Lu <lu.feng@6wind.com> Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Acked-by: Vincent JARDIN <vincent.jardin@6wind.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Conflicts: lib/if.c zebra/interface.c
Diffstat (limited to 'lib/if.c')
-rw-r--r--lib/if.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/if.c b/lib/if.c
index 3003e4c2f4..a9ab680296 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -521,12 +521,12 @@ if_flag_dump (unsigned long flag)
static void
if_dump (const struct interface *ifp)
{
- zlog_info ("Interface %s index %d metric %d mtu %d "
+ zlog_info ("Interface %s vrf %u index %d metric %d mtu %d "
#ifdef HAVE_IPV6
"mtu6 %d "
#endif /* HAVE_IPV6 */
"%s",
- ifp->name, ifp->ifindex, ifp->metric, ifp->mtu,
+ ifp->name, ifp->vrf_id, ifp->ifindex, ifp->metric, ifp->mtu,
#ifdef HAVE_IPV6
ifp->mtu6,
#endif /* HAVE_IPV6 */
@@ -773,8 +773,8 @@ connected_log (struct connected *connected, char *str)
ifp = connected->ifp;
p = connected->address;
- snprintf (logbuf, BUFSIZ, "%s interface %s %s %s/%d ",
- str, ifp->name, prefix_family_str (p),
+ snprintf (logbuf, BUFSIZ, "%s interface %s vrf %u %s %s/%d ",
+ str, ifp->name, ifp->vrf_id, prefix_family_str (p),
inet_ntop (p->family, &p->u.prefix, buf, BUFSIZ),
p->prefixlen);