diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-10-16 12:00:38 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-10-16 12:00:38 -0400 |
| commit | 5b8d8894f8ecb401acc9b3986bbb6ce95b3263e9 (patch) | |
| tree | 077628692cdbae750e26d1b8f237c422bae6519d /lib/zclient.c | |
| parent | 4c6ed05e4e2276c463f16c1dbf8d9f04bc1130fe (diff) | |
| parent | 451fda4f9a2fadc24328e640077780a00ffcdac2 (diff) | |
Merge pull request #1298 from opensourcerouting/iface-rb-tree
Use rb-trees to store interfaces instead of linked-lists
Diffstat (limited to 'lib/zclient.c')
| -rw-r--r-- | lib/zclient.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/zclient.c b/lib/zclient.c index 43d46a1801..ad5c30584c 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -1230,8 +1230,7 @@ struct interface *zebra_interface_add_read(struct stream *s, vrf_id_t vrf_id) stream_get(ifname_tmp, s, INTERFACE_NAMSIZ); /* Lookup/create interface by name. */ - ifp = if_get_by_name_len( - ifname_tmp, strnlen(ifname_tmp, INTERFACE_NAMSIZ), vrf_id, 0); + ifp = if_get_by_name(ifname_tmp, vrf_id, 0); zebra_interface_if_set_value(s, ifp); @@ -1254,8 +1253,7 @@ struct interface *zebra_interface_state_read(struct stream *s, vrf_id_t vrf_id) stream_get(ifname_tmp, s, INTERFACE_NAMSIZ); /* Lookup this by interface index. */ - ifp = if_lookup_by_name_len( - ifname_tmp, strnlen(ifname_tmp, INTERFACE_NAMSIZ), vrf_id); + ifp = if_lookup_by_name(ifname_tmp, vrf_id); if (ifp == NULL) { zlog_warn("INTERFACE_STATE: Cannot find IF %s in VRF %d", ifname_tmp, vrf_id); @@ -1333,7 +1331,7 @@ void zebra_interface_if_set_value(struct stream *s, struct interface *ifp) u_char link_params_status = 0; /* Read interface's index. */ - ifp->ifindex = stream_getl(s); + if_set_index(ifp, stream_getl(s)); ifp->status = stream_getc(s); /* Read interface's value. */ |
