Commit f0124b0f authored by Stephen Hemminger's avatar Stephen Hemminger

ip: remove unnecessary ll_init_map

Don't call ll_init_map on modify operations
Saves significant overhead with 1000's of devices.
parent 0025e5d6
......@@ -1365,8 +1365,6 @@ static int ipaddr_modify(int cmd, int flags, int argc, char **argv)
if (!scoped && cmd != RTM_DELADDR)
req.ifa.ifa_scope = default_scope(&lcl);
ll_init_map(&rth);
if ((req.ifa.ifa_index = ll_name_to_index(d)) == 0) {
fprintf(stderr, "Cannot find device \"%s\"\n", d);
return -1;
......
......@@ -246,8 +246,6 @@ static int ipaddrlabel_flush(int argc, char **argv)
int do_ipaddrlabel(int argc, char **argv)
{
ll_init_map(&rth);
if (argc < 1) {
return ipaddrlabel_list(0, NULL);
} else if (matches(argv[0], "list") == 0 ||
......
......@@ -533,8 +533,6 @@ static int iplink_modify(int cmd, unsigned int flags, int argc, char **argv)
}
}
ll_init_map(&rth);
if (!(flags & NLM_F_CREATE)) {
if (!dev) {
fprintf(stderr, "Not enough information: \"dev\" "
......
......@@ -970,8 +970,6 @@ static int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
if (d || nhs_ok) {
int idx;
ll_init_map(&rth);
if (d) {
if ((idx = ll_name_to_index(d)) == 0) {
fprintf(stderr, "Cannot find device \"%s\"\n", d);
......@@ -1265,8 +1263,6 @@ static int iproute_list_flush_or_save(int argc, char **argv, int action)
if (do_ipv6 == AF_UNSPEC && filter.tb)
do_ipv6 = AF_INET;
ll_init_map(&rth);
if (id || od) {
int idx;
......@@ -1452,8 +1448,6 @@ static int iproute_get(int argc, char **argv)
exit(1);
}
ll_init_map(&rth);
if (idev || odev) {
int idx;
......
......@@ -408,8 +408,6 @@ int do_xfrm_monitor(int argc, char **argv)
return rtnl_from_file(fp, xfrm_accept_msg, (void*)stdout);
}
//ll_init_map(&rth);
if (rtnl_open_byproto(&rth, groups, NETLINK_XFRM) < 0)
exit(1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment