From 2fc97f6335dd5d7df2c285b363c6ef56bb98dcf8 Mon Sep 17 00:00:00 2001 From: Feng Lu Date: Fri, 22 May 2015 11:39:57 +0200 Subject: 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 Reviewed-by: Alain Ritoux Signed-off-by: Nicolas Dichtel Acked-by: Vincent JARDIN Signed-off-by: David Lamparter --- lib/if.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/if.c') diff --git a/lib/if.c b/lib/if.c index 3a1f9b41..f17e5086 100644 --- a/lib/if.c +++ b/lib/if.c @@ -454,12 +454,12 @@ if_dump (const struct interface *ifp) struct connected *c __attribute__((unused)); for (ALL_LIST_ELEMENTS_RO (ifp->connected, node, c)) - 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 */ @@ -675,8 +675,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); -- cgit v1.2.3