bsnmpd: Only refresh devtree if devd event is a new or removed device.
It makes sense to refresh the tree only when a device is inserted or removed, otherwise bsnmpd wastes lot of CPU. PR: 209368 MFC after: 1 week
This commit is contained in:
parent
0f23ab8aac
commit
7e7315b542
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=325067
@ -479,7 +479,9 @@ devd_socket_callback(int fd, void *arg __unused)
|
|||||||
} else {
|
} else {
|
||||||
if (read_len == sizeof(buf))
|
if (read_len == sizeof(buf))
|
||||||
goto again;
|
goto again;
|
||||||
refresh_device_tbl(1);
|
/* Only refresh device table on a device add or remove event. */
|
||||||
|
if (buf[0] == '+' || buf[0] == '-')
|
||||||
|
refresh_device_tbl(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user