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 /zebra/if_netlink.c | |
| 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 'zebra/if_netlink.c')
| -rw-r--r-- | zebra/if_netlink.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c index 187cd10e9c..1c6c70ae84 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c @@ -423,8 +423,7 @@ static uint32_t get_iflink_speed(struct interface *interface, int *error) /* use ioctl to get IP address of an interface */ frr_with_privs(&zserv_privs) { sd = vrf_socket(PF_INET, SOCK_DGRAM, IPPROTO_IP, - interface->vrf_id, - NULL); + interface->vrf->vrf_id, NULL); if (sd < 0) { if (IS_ZEBRA_DEBUG_KERNEL) zlog_debug("Failure to read interface %s speed: %d %s", @@ -435,7 +434,7 @@ static uint32_t get_iflink_speed(struct interface *interface, int *error) return 0; } /* Get the current link state for the interface */ - rc = vrf_ioctl(interface->vrf_id, sd, SIOCETHTOOL, + rc = vrf_ioctl(interface->vrf->vrf_id, sd, SIOCETHTOOL, (char *)&ifdata); } if (rc < 0) { @@ -1809,7 +1808,7 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup) ifp = if_get_by_name(name, vrf_id, NULL); } else { /* pre-configured interface, learnt now */ - if (ifp->vrf_id != vrf_id) + if (ifp->vrf->vrf_id != vrf_id) if_update_to_new_vrf(ifp, vrf_id); } @@ -1863,13 +1862,13 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup) netlink_proc_dplane_if_protodown(ifp->info, !!protodown); } - } else if (ifp->vrf_id != vrf_id) { + } else if (ifp->vrf->vrf_id != vrf_id) { /* VRF change for an interface. */ if (IS_ZEBRA_DEBUG_KERNEL) zlog_debug( "RTM_NEWLINK vrf-change for %s(%u) vrf_id %u -> %u flags 0x%x", - name, ifp->ifindex, ifp->vrf_id, vrf_id, - ifi->ifi_flags); + name, ifp->ifindex, ifp->vrf->vrf_id, + vrf_id, ifi->ifi_flags); if_handle_vrf_change(ifp, vrf_id); } else { |
