babeld: remove unnecessray blob_buf_init calls
For some reason the buffer is initialized twice before filling it.
This does not break anything but is useless. Reduce the initialization
to only one.
Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 2cf253b3df
)
This commit is contained in:
parent
c524118d29
commit
9e7698f20d
|
@ -105,6 +105,8 @@ static int babeld_ubus_get_xroutes(struct ubus_context *ctx_local,
|
||||||
LIST_HEAD(xroute_ipv4_list);
|
LIST_HEAD(xroute_ipv4_list);
|
||||||
LIST_HEAD(xroute_ipv6_list);
|
LIST_HEAD(xroute_ipv6_list);
|
||||||
|
|
||||||
|
blob_buf_init(&b, 0);
|
||||||
|
|
||||||
xroutes = xroute_stream();
|
xroutes = xroute_stream();
|
||||||
if (xroutes) {
|
if (xroutes) {
|
||||||
while (1) {
|
while (1) {
|
||||||
|
@ -125,7 +127,6 @@ static int babeld_ubus_get_xroutes(struct ubus_context *ctx_local,
|
||||||
xroute_stream_done(xroutes);
|
xroute_stream_done(xroutes);
|
||||||
}
|
}
|
||||||
|
|
||||||
blob_buf_init(&b, 0);
|
|
||||||
ipv4 = blobmsg_open_table(&b, "IPv4");
|
ipv4 = blobmsg_open_table(&b, "IPv4");
|
||||||
list_for_each_entry_safe(cur, tmp, &xroute_ipv4_list, list) {
|
list_for_each_entry_safe(cur, tmp, &xroute_ipv4_list, list) {
|
||||||
babeld_add_xroute_buf(cur->xroute, &b);
|
babeld_add_xroute_buf(cur->xroute, &b);
|
||||||
|
@ -230,7 +231,6 @@ static int babeld_ubus_get_routes(struct ubus_context *ctx_local,
|
||||||
route_stream_done(routes);
|
route_stream_done(routes);
|
||||||
}
|
}
|
||||||
|
|
||||||
blob_buf_init(&b, 0);
|
|
||||||
ipv4 = blobmsg_open_table(&b, "IPv4");
|
ipv4 = blobmsg_open_table(&b, "IPv4");
|
||||||
list_for_each_entry_safe(cur, tmp, &route_ipv4_list, list) {
|
list_for_each_entry_safe(cur, tmp, &route_ipv4_list, list) {
|
||||||
babeld_add_route_buf(cur->route, &b);
|
babeld_add_route_buf(cur->route, &b);
|
||||||
|
@ -301,8 +301,6 @@ static int babeld_ubus_get_neighbours(struct ubus_context *ctx_local,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
blob_buf_init(&b, 0);
|
|
||||||
|
|
||||||
ipv4 = blobmsg_open_table(&b, "IPv4");
|
ipv4 = blobmsg_open_table(&b, "IPv4");
|
||||||
list_for_each_entry_safe(cur, tmp, &neighbour_ipv4_list, list) {
|
list_for_each_entry_safe(cur, tmp, &neighbour_ipv4_list, list) {
|
||||||
babeld_add_neighbour_buf(cur->neighbour, &b);
|
babeld_add_neighbour_buf(cur->neighbour, &b);
|
||||||
|
|
Loading…
Reference in New Issue