diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2021-10-22 01:17:40 +0300 |
|---|---|---|
| committer | Igor Ryzhov <iryzhov@nfware.com> | 2021-11-22 20:47:23 +0300 |
| commit | 096f7609f9168ad1a2503acad31d3afc8f00f9e5 (patch) | |
| tree | 7acf9cbf0f944b032da6a796fcf8d7f6a06fe90a /lib/if.h | |
| parent | d32c92a4c0fcee71a8a6d02cb9ff84607cfdcc07 (diff) | |
*: cleanup ifp->vrf_id
Since f60a1188 we store a pointer to the VRF in the interface structure.
There's no need anymore to store a separate vrf_id field.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'lib/if.h')
| -rw-r--r-- | lib/if.h | 37 |
1 files changed, 18 insertions, 19 deletions
@@ -295,7 +295,6 @@ struct interface { struct route_node *node; struct vrf *vrf; - vrf_id_t vrf_id; /* * Has the end users entered `interface XXXX` from the cli in some @@ -312,56 +311,56 @@ RB_HEAD(if_index_head, interface); RB_PROTOTYPE(if_index_head, interface, index_entry, if_cmp_index_func) DECLARE_QOBJ_TYPE(interface); -#define IFNAME_RB_INSERT(vrf, ifp) \ +#define IFNAME_RB_INSERT(v, ifp) \ ({ \ struct interface *_iz = \ - RB_INSERT(if_name_head, &vrf->ifaces_by_name, (ifp)); \ + RB_INSERT(if_name_head, &v->ifaces_by_name, (ifp)); \ if (_iz) \ flog_err( \ EC_LIB_INTERFACE, \ "%s(%s): corruption detected -- interface with this " \ - "name exists already in VRF %u!", \ - __func__, (ifp)->name, (ifp)->vrf_id); \ + "name exists already in VRF %s!", \ + __func__, (ifp)->name, (ifp)->vrf->name); \ _iz; \ }) -#define IFNAME_RB_REMOVE(vrf, ifp) \ +#define IFNAME_RB_REMOVE(v, ifp) \ ({ \ struct interface *_iz = \ - RB_REMOVE(if_name_head, &vrf->ifaces_by_name, (ifp)); \ + RB_REMOVE(if_name_head, &v->ifaces_by_name, (ifp)); \ if (_iz == NULL) \ flog_err( \ EC_LIB_INTERFACE, \ "%s(%s): corruption detected -- interface with this " \ - "name doesn't exist in VRF %u!", \ - __func__, (ifp)->name, (ifp)->vrf_id); \ + "name doesn't exist in VRF %s!", \ + __func__, (ifp)->name, (ifp)->vrf->name); \ _iz; \ }) -#define IFINDEX_RB_INSERT(vrf, ifp) \ +#define IFINDEX_RB_INSERT(v, ifp) \ ({ \ - struct interface *_iz = RB_INSERT( \ - if_index_head, &vrf->ifaces_by_index, (ifp)); \ + struct interface *_iz = \ + RB_INSERT(if_index_head, &v->ifaces_by_index, (ifp)); \ if (_iz) \ flog_err( \ EC_LIB_INTERFACE, \ "%s(%u): corruption detected -- interface with this " \ - "ifindex exists already in VRF %u!", \ - __func__, (ifp)->ifindex, (ifp)->vrf_id); \ + "ifindex exists already in VRF %s!", \ + __func__, (ifp)->ifindex, (ifp)->vrf->name); \ _iz; \ }) -#define IFINDEX_RB_REMOVE(vrf, ifp) \ +#define IFINDEX_RB_REMOVE(v, ifp) \ ({ \ - struct interface *_iz = RB_REMOVE( \ - if_index_head, &vrf->ifaces_by_index, (ifp)); \ + struct interface *_iz = \ + RB_REMOVE(if_index_head, &v->ifaces_by_index, (ifp)); \ if (_iz == NULL) \ flog_err( \ EC_LIB_INTERFACE, \ "%s(%u): corruption detected -- interface with this " \ - "ifindex doesn't exist in VRF %u!", \ - __func__, (ifp)->ifindex, (ifp)->vrf_id); \ + "ifindex doesn't exist in VRF %s!", \ + __func__, (ifp)->ifindex, (ifp)->vrf->name); \ _iz; \ }) |
