#include "udev.h"
#include "udev-util.h"
+#include "rtnl-util.h"
#include "sd-daemon.h"
#include "cgroup-util.h"
#include "dev-setup.h"
static int children;
static int children_max;
static int exec_delay;
-static usec_t event_timeout_usec = 30 * USEC_PER_SEC;
+static usec_t event_timeout_usec = 60 * USEC_PER_SEC;
static sigset_t sigmask_orig;
static UDEV_LIST(event_list);
static UDEV_LIST(worker_list);
dev_t devnum;
int ifindex;
bool is_block;
-#ifdef HAVE_FIRMWARE
- bool nodelay;
-#endif
};
static inline struct event *node_to_event(struct udev_list_node *node) {
case 0: {
struct udev_device *dev = NULL;
int fd_monitor;
+ _cleanup_rtnl_unref_ sd_rtnl *rtnl = NULL;
struct epoll_event ep_signal, ep_monitor;
sigset_t mask;
int rc = EXIT_SUCCESS;
}
}
+ /* needed for renaming netifs */
+ udev_event->rtnl = rtnl;
+
/* apply rules, create node, symlinks */
udev_event_execute_rules(udev_event, event_timeout_usec, rules, &sigmask_orig);
udev_event_execute_run(udev_event, event_timeout_usec, &sigmask_orig);
+ /* in case rtnl was initialized */
+ rtnl = sd_rtnl_ref(udev_event->rtnl);
+
/* apply/restore inotify watch */
if (udev_event->inotify_watch) {
udev_watch_begin(udev, dev);
event->devnum = udev_device_get_devnum(dev);
event->is_block = streq("block", udev_device_get_subsystem(dev));
event->ifindex = udev_device_get_ifindex(dev);
-#ifdef HAVE_FIRMWARE
- if (streq(udev_device_get_subsystem(dev), "firmware"))
- event->nodelay = true;
-#endif
log_debug("seq %llu queued, '%s' '%s'", udev_device_get_seqnum(dev),
udev_device_get_action(dev), udev_device_get_subsystem(dev));
return true;
}
-#ifdef HAVE_FIRMWARE
- /* allow to bypass the dependency tracking */
- if (event->nodelay)
- continue;
-#endif
-
/* parent device event found */
if (event->devpath[common] == '/') {
event->delaying_seqnum = loop_event->seqnum;
*/
static void kernel_cmdline_options(struct udev *udev) {
_cleanup_free_ char *line = NULL;
- char *w, *state;
+ const char *word, *state;
size_t l;
int r;
if (r <= 0)
return;
- FOREACH_WORD_QUOTED(w, l, line, state) {
+ FOREACH_WORD_QUOTED(word, l, line, state) {
char *s, *opt;
- s = strndup(w, l);
+ s = strndup(word, l);
if (!s)
break;