Bug: Multiple socket register on epoll based eloop fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If wpa_supplicant exposes its DBus interface, multiple calls to
eloop_register_sock are potentially made in dbus_common.c add_watch().
epoll_ctl(..., EPOLL_CTL_ADD, ...) returns EEXIST if called multiple
times with the same file descriptor argument. Therefore wpa_supplicant
may misses DBus events.

The corresponding source code is:
   
    eloop_register_sock(fd, EVENT_TYPE_EXCEPTION, process_watch_exception,
                priv, watch);

    if (flags & DBUS_WATCH_READABLE) {
        eloop_register_sock(fd, EVENT_TYPE_READ, process_watch_read,
                    priv, watch);
    }
    if (flags & DBUS_WATCH_WRITABLE) {
        eloop_register_sock(fd, EVENT_TYPE_WRITE, process_watch_write,
                    priv, watch);
    }

The error message I noticed is:
Feb 25 22:00:45 isengard wpa_supplicant[18388]: eloop_sock_queue:
epoll_ctl(ADD) for fd=4 failed: File exists

One possible fix would be to let the epoll code check if other events
are already registered for the same file descriptor and call
EPOLL_CTL_MOD in this case.

Markus

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux