Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package iwd for openSUSE:Factory checked in at 2024-01-26 22:47:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/iwd (Old) and /work/SRC/openSUSE:Factory/.iwd.new.1815 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "iwd" Fri Jan 26 22:47:29 2024 rev:44 rq:1141631 version:2.13 Changes: -------- --- /work/SRC/openSUSE:Factory/iwd/iwd.changes 2024-01-04 16:00:59.596400267 +0100 +++ /work/SRC/openSUSE:Factory/.iwd.new.1815/iwd.changes 2024-01-26 22:47:42.905165676 +0100 @@ -1,0 +2,8 @@ +Fri Jan 19 00:49:04 UTC 2024 - Jan Engelhardt <jeng...@inai.de> + +- Update to release 2.13 [boo#1218410] + * Fix issue with handling netconfig and roaming conditions. + * Fix issue with logging requirement for CMD_EXTERNAL_AUTH. + * Fix issue with using OpenSSL 3.2 installations. + +------------------------------------------------------------------- Old: ---- iwd-2.12.tar.sign iwd-2.12.tar.xz New: ---- iwd-2.13.tar.sign iwd-2.13.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ iwd.spec ++++++ --- /var/tmp/diff_new_pack.s0WJji/_old 2024-01-26 22:47:43.797197800 +0100 +++ /var/tmp/diff_new_pack.s0WJji/_new 2024-01-26 22:47:43.801197944 +0100 @@ -1,7 +1,7 @@ # # spec file for package iwd # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: iwd -Version: 2.12 +Version: 2.13 Release: 0 Summary: Wireless daemon for Linux License: LGPL-2.1-or-later ++++++ iwd-2.12.tar.xz -> iwd-2.13.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iwd-2.12/ChangeLog new/iwd-2.13/ChangeLog --- old/iwd-2.12/ChangeLog 2023-12-27 13:34:15.000000000 +0100 +++ new/iwd-2.13/ChangeLog 2024-01-12 20:08:50.000000000 +0100 @@ -1,3 +1,8 @@ +ver 2.13: + Fix issue with handling netconfig and roaming conditions. + Fix issue with logging requirement for CMD_EXTERNAL_AUTH. + Fix issue with using OpenSSL 3.2 installations. + ver 2.12: Fix issue with DPP extra settings not being used. Fix issue with DPP and PRF+ handling on AARCH64. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iwd-2.12/client/ap.c new/iwd-2.13/client/ap.c --- old/iwd-2.12/client/ap.c 2022-11-18 13:31:49.000000000 +0100 +++ new/iwd-2.13/client/ap.c 2024-01-12 20:08:50.000000000 +0100 @@ -162,18 +162,27 @@ static void update_pairwise(void *data, struct l_dbus_message_iter *variant) { struct ap *ap = data; + struct l_dbus_message_iter array; char *value; + char **strv; + if (ap->pairwise) l_free(ap->pairwise); - if (!l_dbus_message_iter_get_variant(variant, "s", &value)) { + if (!l_dbus_message_iter_get_variant(variant, "as", &array)) { ap->pairwise = NULL; return; } - ap->pairwise = l_strdup(value); + strv = l_strv_new(); + + while (l_dbus_message_iter_next_entry(&array, &value)) + strv = l_strv_append(strv, value); + + ap->pairwise = l_strjoinv(strv, ' '); + l_strv_free(strv); } static const char *get_pairwise_tostr(const void *data) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iwd-2.12/configure new/iwd-2.13/configure --- old/iwd-2.12/configure 2023-12-27 13:36:03.000000000 +0100 +++ new/iwd-2.13/configure 2024-01-12 20:10:38.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for iwd 2.12. +# Generated by GNU Autoconf 2.71 for iwd 2.13. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, @@ -618,8 +618,8 @@ # Identity of this package. PACKAGE_NAME='iwd' PACKAGE_TARNAME='iwd' -PACKAGE_VERSION='2.12' -PACKAGE_STRING='iwd 2.12' +PACKAGE_VERSION='2.13' +PACKAGE_STRING='iwd 2.13' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1433,7 +1433,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures iwd 2.12 to adapt to many kinds of systems. +\`configure' configures iwd 2.13 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1504,7 +1504,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of iwd 2.12:";; + short | recursive ) echo "Configuration of iwd 2.13:";; esac cat <<\_ACEOF @@ -1661,7 +1661,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -iwd configure 2.12 +iwd configure 2.13 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1879,7 +1879,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by iwd $as_me 2.12, which was +It was created by iwd $as_me 2.13, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3154,7 +3154,7 @@ # Define the identity of the package. PACKAGE='iwd' - VERSION='2.12' + VERSION='2.13' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -13349,7 +13349,7 @@ if (test "${enable_optimization}" != "no"); then CFLAGS="$CFLAGS -O2" - CFLAGS+=" -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2" + CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2" fi # Check whether --enable-debug was given. @@ -14984,7 +14984,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by iwd $as_me 2.12, which was +This file was extended by iwd $as_me 2.13, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15052,7 +15052,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -iwd config.status 2.12 +iwd config.status 2.13 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iwd-2.12/configure.ac new/iwd-2.13/configure.ac --- old/iwd-2.12/configure.ac 2023-12-27 13:34:15.000000000 +0100 +++ new/iwd-2.13/configure.ac 2024-01-12 20:08:50.000000000 +0100 @@ -1,5 +1,5 @@ AC_PREREQ([2.69]) -AC_INIT([iwd],[2.12]) +AC_INIT([iwd],[2.13]) AC_CONFIG_HEADERS(config.h) AC_CONFIG_AUX_DIR(build-aux) @@ -44,7 +44,7 @@ if (test "${enable_optimization}" != "no"); then CFLAGS="$CFLAGS -O2" - CFLAGS+=" -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2" + CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2" fi AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iwd-2.12/monitor/main.c new/iwd-2.13/monitor/main.c --- old/iwd-2.12/monitor/main.c 2022-11-18 13:31:49.000000000 +0100 +++ new/iwd-2.13/monitor/main.c 2024-01-12 20:08:50.000000000 +0100 @@ -32,10 +32,14 @@ #include <string.h> #include <getopt.h> #include <signal.h> +#include <unistd.h> +#include <arpa/inet.h> #include <sys/socket.h> #include <linux/genetlink.h> #include <linux/rtnetlink.h> #include <linux/if_arp.h> +#include <linux/filter.h> +#include <sys/ioctl.h> #include <ell/ell.h> #ifndef ARPHRD_NETLINK @@ -68,11 +72,160 @@ #define NLMON_TYPE "nlmon" #define NLMON_LEN 5 +static bool nlmon_receive(struct l_io *io, void *user_data) +{ + struct nlmon *nlmon = user_data; + struct msghdr msg; + struct sockaddr_ll sll; + struct iovec iov; + struct cmsghdr *cmsg; + struct timeval copy_tv; + const struct timeval *tv = NULL; + uint16_t proto_type; + unsigned char buf[8192]; + unsigned char control[32]; + ssize_t bytes_read; + int fd; + + fd = l_io_get_fd(io); + if (fd < 0) + return false; + + memset(&sll, 0, sizeof(sll)); + + memset(&iov, 0, sizeof(iov)); + iov.iov_base = buf; + iov.iov_len = sizeof(buf); + + memset(&msg, 0, sizeof(msg)); + msg.msg_name = &sll; + msg.msg_namelen = sizeof(sll); + msg.msg_iov = &iov; + msg.msg_iovlen = 1; + msg.msg_control = control; + msg.msg_controllen = sizeof(control); + + bytes_read = recvmsg(fd, &msg, 0); + if (bytes_read < 0) { + if (errno != EAGAIN && errno != EINTR) + return false; + + return true; + } + + if (sll.sll_hatype != ARPHRD_NETLINK) + return true; + + proto_type = ntohs(sll.sll_protocol); + + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; + cmsg = CMSG_NXTHDR(&msg, cmsg)) { + if (cmsg->cmsg_level == SOL_SOCKET && + cmsg->cmsg_type == SCM_TIMESTAMP) { + memcpy(©_tv, CMSG_DATA(cmsg), sizeof(copy_tv)); + tv = ©_tv; + } + } + + switch (proto_type) { + case NETLINK_ROUTE: + nlmon_print_rtnl(nlmon, tv, iov.iov_base, bytes_read); + break; + case NETLINK_GENERIC: + nlmon_print_genl(nlmon, tv, iov.iov_base, bytes_read); + break; + } + + return true; +} + +/* + * BPF filter to match skb->dev->type == 824 (ARPHRD_NETLINK) and + * either match skb->protocol == 0x0000 (NETLINK_ROUTE) or match + * skb->protocol == 0x0010 (NETLINK_GENERIC). + */ +static struct sock_filter mon_filter[] = { + { 0x28, 0, 0, 0xfffff01c }, /* ldh #hatype */ + { 0x15, 0, 3, 0x00000338 }, /* jne #824, drop */ + { 0x28, 0, 0, 0xfffff000 }, /* ldh #proto */ + { 0x15, 2, 0, 0000000000 }, /* jeq #0x0000, pass */ + { 0x15, 1, 0, 0x00000010 }, /* jeq #0x0010, pass */ + { 0x06, 0, 0, 0000000000 }, /* drop: ret #0 */ + { 0x06, 0, 0, 0xffffffff }, /* pass: ret #-1 */ +}; + +static const struct sock_fprog mon_fprog = { .len = 7, .filter = mon_filter }; + +static struct l_io *open_packet(const char *name) +{ + struct l_io *io; + struct sockaddr_ll sll; + struct packet_mreq mr; + struct ifreq ifr; + int fd, opt = 1; + + fd = socket(PF_PACKET, SOCK_RAW | SOCK_CLOEXEC | SOCK_NONBLOCK, 0); + if (fd < 0) { + perror("Failed to create packet socket"); + return NULL; + } + + strncpy(ifr.ifr_name, name, IFNAMSIZ - 1); + + if (ioctl(fd, SIOCGIFINDEX, &ifr) < 0) { + perror("Failed to get monitor index"); + close(fd); + return NULL; + } + + memset(&sll, 0, sizeof(sll)); + sll.sll_family = AF_PACKET; + sll.sll_protocol = htons(ETH_P_ALL); + sll.sll_ifindex = ifr.ifr_ifindex; + + if (bind(fd, (struct sockaddr *) &sll, sizeof(sll)) < 0) { + perror("Failed to bind packet socket"); + close(fd); + return NULL; + } + + memset(&mr, 0, sizeof(mr)); + mr.mr_ifindex = ifr.ifr_ifindex; + mr.mr_type = PACKET_MR_ALLMULTI; + + if (setsockopt(fd, SOL_PACKET, PACKET_ADD_MEMBERSHIP, + &mr, sizeof(mr)) < 0) { + perror("Failed to enable all multicast"); + close(fd); + return NULL; + } + + if (setsockopt(fd, SOL_SOCKET, SO_ATTACH_FILTER, + &mon_fprog, sizeof(mon_fprog)) < 0) { + perror("Failed to enable monitor filter"); + close(fd); + return NULL; + } + + if (setsockopt(fd, SOL_SOCKET, SO_TIMESTAMP, &opt, sizeof(opt)) < 0) { + perror("Failed to enable monitor timestamps"); + close(fd); + return NULL; + } + + io = l_io_new(fd); + + l_io_set_close_on_destroy(io, true); + + return io; +} + struct iwmon_interface { char *ifname; bool exists; struct l_netlink *rtnl; struct l_netlink *genl; + struct l_io *io; }; static struct iwmon_interface monitor_interface = { }; @@ -109,11 +262,23 @@ if (id == 0) return; - if (!strcmp(name, NL80211_GENL_NAME)) { - nlmon = nlmon_open(ifname, id, writer_path, &config); - if (!nlmon) - l_main_quit(); - } + if (strcmp(name, NL80211_GENL_NAME)) + return; + + monitor_interface.io = open_packet(ifname); + if (!monitor_interface.io) + goto failed; + + nlmon = nlmon_open(id, writer_path, &config); + if (!nlmon) + goto failed; + + l_io_set_read_handler(monitor_interface.io, nlmon_receive, nlmon, NULL); + + return; + +failed: + l_main_quit(); } static void genl_notify(uint16_t type, const void *data, @@ -790,6 +955,7 @@ exit_status = l_main_run_with_signal(signal_handler, NULL); + l_io_destroy(monitor_interface.io); l_netlink_destroy(monitor_interface.rtnl); l_netlink_destroy(monitor_interface.genl); l_free(monitor_interface.ifname); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iwd-2.12/monitor/nlmon.c new/iwd-2.13/monitor/nlmon.c --- old/iwd-2.12/monitor/nlmon.c 2023-11-19 18:55:17.000000000 +0100 +++ new/iwd-2.13/monitor/nlmon.c 2024-01-12 20:08:50.000000000 +0100 @@ -96,7 +96,6 @@ struct nlmon { uint16_t id; - struct l_io *io; struct l_io *pae_io; struct l_queue *req_list; struct pcap *pcap; @@ -5128,6 +5127,16 @@ (const uint8_t *) mmpdu + len - resp->ies); } +static void print_probe_request(unsigned int level, + const struct mmpdu_header *mmpdu, size_t len) +{ + const struct mmpdu_probe_request *req = mmpdu_body(mmpdu); + + print_attr(level, "Subtype: Probe Request"); + print_ie(level + 1, "Probe Request IEs", req->ies, + (const uint8_t *) mmpdu + len - req->ies); +} + static void print_beacon(unsigned int level, const struct mmpdu_header *mmpdu, size_t len) { @@ -5165,7 +5174,10 @@ switch (subtype) { case 0x00: - str = "Association request"; + if (mpdu) + str = "Association request"; + else + str = "Association request (invalid MPDU)"; break; case 0x01: if (mpdu) @@ -5174,19 +5186,28 @@ str = "Association response"; break; case 0x02: - str = "Reassociation request"; + if (mpdu) + str = "Reassociation request"; + else + str = "Reassociation request (invalid MPDU)"; break; case 0x03: - str = "Reassociation response"; + if (mpdu) + str = "Reassociation response"; + else + str = "Reassociation response (invalid MPDU)"; break; case 0x04: - str = "Probe request"; + if (mpdu) + print_probe_request(level + 1, mpdu, size); + else + str = "Probe request (invalid MPDU)"; break; case 0x05: if (mpdu) print_probe_response(level + 1, mpdu, size); else - str = "Probe response"; + str = "Probe response (invalid MPDU)"; break; case 0x06: str = "Timing Advertisement"; @@ -5195,25 +5216,28 @@ if (mpdu) print_beacon(level + 1, mpdu, size); else - str = "Beacon"; + str = "Beacon (invalid MPDU)"; break; case 0x09: str = "ATIM"; break; case 0x0a: - str = "Disassociation"; + if (mpdu) + str = "Disassociation"; + else + str = "Disassociation (invalid MPDU)"; break; case 0x0b: if (mpdu) print_authentication_mgmt_frame(level + 1, mpdu, size); else - str = "Authentication"; + str = "Authentication (invalid MPDU)"; break; case 0x0c: if (mpdu) print_deauthentication_mgmt_frame(level + 1, mpdu); else - str = "Deauthentication"; + str = "Deauthentication (invalid MPDU)"; break; case 0x0d: case 0x0e: @@ -7240,7 +7264,6 @@ } static void nlmon_message(struct nlmon *nlmon, const struct timeval *tv, - const struct tpacket_auxdata *tp, const struct nlmsghdr *nlmsg) { struct nlmon_req *req; @@ -7281,12 +7304,6 @@ return; } - if (!nlmon->read && nlmsg->nlmsg_type != nlmon->id) { - if (nlmsg->nlmsg_type == GENL_ID_CTRL) - store_message(nlmon, tv, nlmsg); - return; - } - if (nlmsg->nlmsg_flags & NLM_F_REQUEST) { const struct genlmsghdr *genlmsg = NLMSG_DATA(nlmsg); uint32_t flags = nlmsg->nlmsg_flags & ~NLM_F_REQUEST; @@ -7359,35 +7376,6 @@ l_free(nlmon); } -static void genl_ctrl(struct nlmon *nlmon, const void *data, uint32_t len) -{ - const struct genlmsghdr *genlmsg = data; - const struct nlattr *nla; - char name[GENL_NAMSIZ]; - uint16_t id = 0; - - if (genlmsg->cmd != CTRL_CMD_NEWFAMILY) - return; - - for (nla = data + GENL_HDRLEN; NLA_OK(nla, len); - nla = NLA_NEXT(nla, len)) { - switch (nla->nla_type & NLA_TYPE_MASK) { - case CTRL_ATTR_FAMILY_ID: - id = *((uint16_t *) NLA_DATA(nla)); - break; - case CTRL_ATTR_FAMILY_NAME: - strncpy(name, NLA_DATA(nla), GENL_NAMSIZ - 1); - break; - } - } - - if (id == 0) - return; - - if (!strcmp(name, NL80211_GENL_NAME)) - nlmon->id = id; -} - static const char *scope_to_string(uint8_t scope) { switch (scope) { @@ -8167,13 +8155,15 @@ int64_t aligned_size = NLMSG_ALIGN(size); const struct nlmsghdr *nlmsg; - if (nlmon->nortnl) - return; - update_time_offset(tv); for (nlmsg = data; NLMSG_OK(nlmsg, aligned_size); nlmsg = NLMSG_NEXT(nlmsg, aligned_size)) { + store_netlink(nlmon, tv, NETLINK_ROUTE, nlmsg); + + if (nlmon->nortnl) + continue; + switch (nlmsg->nlmsg_type) { case NLMSG_NOOP: case NLMSG_OVERRUN: @@ -8207,177 +8197,16 @@ for (nlmsg = data; NLMSG_OK(nlmsg, size); nlmsg = NLMSG_NEXT(nlmsg, size)) { - if (nlmsg->nlmsg_type == GENL_ID_CTRL) - genl_ctrl(nlmon, NLMSG_DATA(nlmsg), - NLMSG_PAYLOAD(nlmsg, 0)); - else - nlmon_message(nlmon, tv, NULL, nlmsg); - } -} - -static bool nlmon_receive(struct l_io *io, void *user_data) -{ - struct nlmon *nlmon = user_data; - struct nlmsghdr *nlmsg; - struct msghdr msg; - struct sockaddr_ll sll; - struct iovec iov; - struct cmsghdr *cmsg; - struct timeval copy_tv; - struct tpacket_auxdata copy_tp; - const struct timeval *tv = NULL; - const struct tpacket_auxdata *tp = NULL; - uint16_t proto_type; - unsigned char buf[8192]; - unsigned char control[32]; - ssize_t bytes_read; - int64_t nlmsg_len; - int fd; - - fd = l_io_get_fd(io); - if (fd < 0) - return false; - - memset(&sll, 0, sizeof(sll)); - - memset(&iov, 0, sizeof(iov)); - iov.iov_base = buf; - iov.iov_len = sizeof(buf); - - memset(&msg, 0, sizeof(msg)); - msg.msg_name = &sll; - msg.msg_namelen = sizeof(sll); - msg.msg_iov = &iov; - msg.msg_iovlen = 1; - msg.msg_control = control; - msg.msg_controllen = sizeof(control); - - bytes_read = recvmsg(fd, &msg, 0); - if (bytes_read < 0) { - if (errno != EAGAIN && errno != EINTR) - return false; - - return true; - } - - if (sll.sll_hatype != ARPHRD_NETLINK) - return true; - - proto_type = ntohs(sll.sll_protocol); - - for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; - cmsg = CMSG_NXTHDR(&msg, cmsg)) { - if (cmsg->cmsg_level == SOL_SOCKET && - cmsg->cmsg_type == SCM_TIMESTAMP) { - memcpy(©_tv, CMSG_DATA(cmsg), sizeof(copy_tv)); - tv = ©_tv; - } - - if (cmsg->cmsg_level == SOL_PACKET && - cmsg->cmsg_type != PACKET_AUXDATA) { - memcpy(©_tp, CMSG_DATA(cmsg), sizeof(copy_tp)); - tp = ©_tp; - } - } - - nlmsg_len = bytes_read; - - for (nlmsg = iov.iov_base; NLMSG_OK(nlmsg, nlmsg_len); - nlmsg = NLMSG_NEXT(nlmsg, nlmsg_len)) { - switch (proto_type) { - case NETLINK_ROUTE: - store_netlink(nlmon, tv, proto_type, nlmsg); - - nlmon_print_rtnl(nlmon, tv, nlmsg, nlmsg->nlmsg_len); - break; - case NETLINK_GENERIC: - nlmon_message(nlmon, tv, tp, nlmsg); - break; + if (nlmsg->nlmsg_type == GENL_ID_CTRL) { + store_message(nlmon, tv, nlmsg); + continue; } - } - - return true; -} - -/* - * BPF filter to match skb->dev->type == 824 (ARPHRD_NETLINK) and - * either match skb->protocol == 0x0000 (NETLINK_ROUTE) or match - * skb->protocol == 0x0010 (NETLINK_GENERIC). - */ -static struct sock_filter mon_filter[] = { - { 0x28, 0, 0, 0xfffff01c }, /* ldh #hatype */ - { 0x15, 0, 3, 0x00000338 }, /* jne #824, drop */ - { 0x28, 0, 0, 0xfffff000 }, /* ldh #proto */ - { 0x15, 2, 0, 0000000000 }, /* jeq #0x0000, pass */ - { 0x15, 1, 0, 0x00000010 }, /* jeq #0x0010, pass */ - { 0x06, 0, 0, 0000000000 }, /* drop: ret #0 */ - { 0x06, 0, 0, 0xffffffff }, /* pass: ret #-1 */ -}; - -static const struct sock_fprog mon_fprog = { .len = 7, .filter = mon_filter }; - -static struct l_io *open_packet(const char *name) -{ - struct l_io *io; - struct sockaddr_ll sll; - struct packet_mreq mr; - struct ifreq ifr; - int fd, opt = 1; - - fd = socket(PF_PACKET, SOCK_RAW | SOCK_CLOEXEC | SOCK_NONBLOCK, 0); - if (fd < 0) { - perror("Failed to create packet socket"); - return NULL; - } - - strncpy(ifr.ifr_name, name, IFNAMSIZ - 1); - - if (ioctl(fd, SIOCGIFINDEX, &ifr) < 0) { - perror("Failed to get monitor index"); - close(fd); - return NULL; - } - - memset(&sll, 0, sizeof(sll)); - sll.sll_family = AF_PACKET; - sll.sll_protocol = htons(ETH_P_ALL); - sll.sll_ifindex = ifr.ifr_ifindex; - - if (bind(fd, (struct sockaddr *) &sll, sizeof(sll)) < 0) { - perror("Failed to bind packet socket"); - close(fd); - return NULL; - } - memset(&mr, 0, sizeof(mr)); - mr.mr_ifindex = ifr.ifr_ifindex; - mr.mr_type = PACKET_MR_ALLMULTI; - - if (setsockopt(fd, SOL_PACKET, PACKET_ADD_MEMBERSHIP, - &mr, sizeof(mr)) < 0) { - perror("Failed to enable all multicast"); - close(fd); - return NULL; - } - - if (setsockopt(fd, SOL_SOCKET, SO_ATTACH_FILTER, - &mon_fprog, sizeof(mon_fprog)) < 0) { - perror("Failed to enable monitor filter"); - close(fd); - return NULL; - } + if (!nlmon->read && nlmsg->nlmsg_type != nlmon->id) + continue; - if (setsockopt(fd, SOL_SOCKET, SO_TIMESTAMP, &opt, sizeof(opt)) < 0) { - perror("Failed to enable monitor timestamps"); - close(fd); - return NULL; + nlmon_message(nlmon, tv, nlmsg); } - - io = l_io_new(fd); - - l_io_set_close_on_destroy(io, true); - - return io; } void nlmon_print_pae(struct nlmon *nlmon, const struct timeval *tv, @@ -8507,28 +8336,21 @@ return io; } -struct nlmon *nlmon_open(const char *ifname, uint16_t id, const char *pathname, +struct nlmon *nlmon_open(uint16_t id, const char *pathname, const struct nlmon_config *config) { struct nlmon *nlmon; - struct l_io *io, *pae_io; + struct l_io *pae_io; struct pcap *pcap; - io = open_packet(ifname); - if (!io) - return NULL; - pae_io = open_pae(); - if (!pae_io) { - l_io_destroy(io); + if (!pae_io) return NULL; - } if (pathname) { pcap = pcap_create(pathname); if (!pcap) { l_io_destroy(pae_io); - l_io_destroy(io); return NULL; } } else @@ -8537,11 +8359,9 @@ nlmon = nlmon_create(id, config); - nlmon->io = io; nlmon->pae_io = pae_io; nlmon->pcap = pcap; - l_io_set_read_handler(nlmon->io, nlmon_receive, nlmon, NULL); l_io_set_read_handler(nlmon->pae_io, pae_receive, nlmon, NULL); wlan_iface_list = l_hashmap_new(); @@ -8554,7 +8374,6 @@ if (!nlmon) return; - l_io_destroy(nlmon->io); l_io_destroy(nlmon->pae_io); l_queue_destroy(nlmon->req_list, nlmon_req_free); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iwd-2.12/monitor/nlmon.h new/iwd-2.13/monitor/nlmon.h --- old/iwd-2.12/monitor/nlmon.h 2022-11-18 13:31:49.000000000 +0100 +++ new/iwd-2.13/monitor/nlmon.h 2024-01-12 20:08:50.000000000 +0100 @@ -33,7 +33,7 @@ bool read_only; }; -struct nlmon *nlmon_open(const char *ifname, uint16_t id, const char *pathname, +struct nlmon *nlmon_open(uint16_t id, const char *pathname, const struct nlmon_config *config); void nlmon_close(struct nlmon *nlmon); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iwd-2.12/src/dpp.c new/iwd-2.13/src/dpp.c --- old/iwd-2.12/src/dpp.c 2023-12-27 13:34:15.000000000 +0100 +++ new/iwd-2.13/src/dpp.c 2024-01-12 20:08:50.000000000 +0100 @@ -3761,6 +3761,7 @@ case STATION_STATE_CONNECTING: case STATION_STATE_CONNECTED: case STATION_STATE_CONNECTING_AUTO: + case STATION_STATE_NETCONFIG: if (L_WARN_ON(dpp->role == DPP_CAPABILITY_CONFIGURATOR)) dpp_reset(dpp); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iwd-2.12/src/station.c new/iwd-2.13/src/station.c --- old/iwd-2.12/src/station.c 2023-12-14 00:02:54.000000000 +0100 +++ new/iwd-2.13/src/station.c 2024-01-12 20:08:50.000000000 +0100 @@ -1497,6 +1497,8 @@ return "ft-roaming"; case STATION_STATE_FW_ROAMING: return "fw-roaming"; + case STATION_STATE_NETCONFIG: + return "connecting (netconfig)"; } return "invalid"; @@ -1554,6 +1556,8 @@ station_state_to_string(station->state), station_state_to_string(state)); + station_debug_event(station, station_state_to_string(state)); + disconnected = !station_is_busy(station); if ((disconnected && state > STATION_STATE_AUTOCONNECT_FULL) || @@ -1633,6 +1637,7 @@ station_set_drop_unicast_l2_multicast(station, false); break; case STATION_STATE_DISCONNECTING: + case STATION_STATE_NETCONFIG: break; case STATION_STATE_ROAMING: case STATION_STATE_FT_ROAMING: @@ -1765,6 +1770,7 @@ if (station->state == STATION_STATE_CONNECTED || station->state == STATION_STATE_CONNECTING || station->state == STATION_STATE_CONNECTING_AUTO || + station->state == STATION_STATE_NETCONFIG || station_is_roaming(station)) network_disconnected(network); } @@ -2040,8 +2046,7 @@ dbus_pending_reply(&station->connect_pending, reply); } - if (L_IN_SET(station->state, STATION_STATE_CONNECTING, - STATION_STATE_CONNECTING_AUTO)) + if (station->state == STATION_STATE_NETCONFIG) network_connect_failed(station->connected_network, false); @@ -2067,9 +2072,14 @@ network_get_settings(network))) return false; - return netconfig_configure(station->netconfig, + if (!netconfig_configure(station->netconfig, station_netconfig_event_handler, - station); + station)) + return false; + + station_enter_state(station, STATION_STATE_NETCONFIG); + + return true; } static void station_roamed(struct station *station) @@ -2212,8 +2222,6 @@ station->preparing_roam = false; station_enter_state(station, STATION_STATE_ROAMING); - station_debug_event(station, "reassoc-roam"); - return 0; } @@ -2356,8 +2364,6 @@ station->preparing_roam = false; station_enter_state(station, STATION_STATE_FT_ROAMING); - station_debug_event(station, "ft-roam"); - break; case -EINVAL: /* @@ -3252,6 +3258,8 @@ station_netconfig_event_handler, station))) return; + + station_enter_state(station, STATION_STATE_NETCONFIG); } else station_enter_state(station, STATION_STATE_CONNECTED); } @@ -3344,6 +3352,7 @@ case STATION_STATE_CONNECTED: case STATION_STATE_FT_ROAMING: case STATION_STATE_FW_ROAMING: + case STATION_STATE_NETCONFIG: station_disassociated(station); return; default: @@ -3406,6 +3415,16 @@ station_roam_timeout_rearm(station, LOSS_ROAM_RATE_LIMIT); } +static void station_event_roaming(struct station *station) +{ + if (station->netconfig && station->state != STATION_STATE_CONNECTED) { + netconfig_reset(station->netconfig); + station->netconfig_after_roam = true; + } + + station_enter_state(station, STATION_STATE_FW_ROAMING); +} + static void station_netdev_event(struct netdev *netdev, enum netdev_event event, void *event_data, void *user_data) { @@ -3433,7 +3452,7 @@ station_signal_agent_notify(station); break; case NETDEV_EVENT_ROAMING: - station_enter_state(station, STATION_STATE_FW_ROAMING); + station_event_roaming(station); break; case NETDEV_EVENT_ROAMED: station_event_roamed(station, (struct scan_bss *) event_data); @@ -4052,8 +4071,10 @@ if (station->dbus_scan_id) return dbus_error_busy(message); - if (station->state == STATION_STATE_CONNECTING || - station->state == STATION_STATE_CONNECTING_AUTO) + if (L_IN_SET(station->state, STATION_STATE_CONNECTING, + STATION_STATE_CONNECTING_AUTO, + STATION_STATE_NETCONFIG) || + station_is_roaming(station)) return dbus_error_busy(message); station->dbus_scan_subset_idx = 0; @@ -4264,6 +4285,7 @@ break; case STATION_STATE_CONNECTING: case STATION_STATE_CONNECTING_AUTO: + case STATION_STATE_NETCONFIG: statestr = "connecting"; break; case STATION_STATE_CONNECTED: @@ -4275,7 +4297,14 @@ case STATION_STATE_ROAMING: case STATION_STATE_FT_ROAMING: case STATION_STATE_FW_ROAMING: - statestr = "roaming"; + /* + * Stay in a connecting state if roaming before netconfig + * has finished + */ + if (station->netconfig_after_roam) + statestr = "connecting"; + else + statestr = "roaming"; break; } @@ -5009,8 +5038,10 @@ if (station->dbus_scan_id) return dbus_error_busy(message); - if (station->state == STATION_STATE_CONNECTING || - station->state == STATION_STATE_CONNECTING_AUTO) + if (L_IN_SET(station->state, STATION_STATE_CONNECTING, + STATION_STATE_CONNECTING_AUTO, + STATION_STATE_NETCONFIG) || + station_is_roaming(station)) return dbus_error_busy(message); if (!l_dbus_message_get_arguments(message, "aq", &iter)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iwd-2.12/src/station.h new/iwd-2.13/src/station.h --- old/iwd-2.12/src/station.h 2023-11-19 18:55:17.000000000 +0100 +++ new/iwd-2.13/src/station.h 2024-01-12 20:08:50.000000000 +0100 @@ -45,6 +45,7 @@ STATION_STATE_ROAMING, /* Reassociation */ STATION_STATE_FT_ROAMING, /* Fast transition */ STATION_STATE_FW_ROAMING, /* Firmware roamed by itself */ + STATION_STATE_NETCONFIG, }; enum station_event { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iwd-2.12/src/wiphy.c new/iwd-2.13/src/wiphy.c --- old/iwd-2.12/src/wiphy.c 2023-11-27 17:00:15.000000000 +0100 +++ new/iwd-2.13/src/wiphy.c 2024-01-12 20:08:50.000000000 +0100 @@ -248,6 +248,9 @@ * * TODO: No support for CMD_EXTERNAL_AUTH yet. */ + l_warn("SAE unsupported: %s needs CMD_EXTERNAL_AUTH for SAE", + wiphy->driver_str); + return false; } @@ -312,8 +315,10 @@ if (ie_rsne_is_wpa3_personal(info)) { l_debug("Network is WPA3-Personal..."); - if (!wiphy_can_connect_sae(wiphy)) + if (!wiphy_can_connect_sae(wiphy)) { + l_debug("Can't use SAE, trying WPA2"); goto wpa2_personal; + } if (info->akm_suites & IE_RSN_AKM_SUITE_FT_OVER_SAE_SHA256) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iwd-2.12/src/wsc.c new/iwd-2.13/src/wsc.c --- old/iwd-2.12/src/wsc.c 2023-12-14 00:02:55.000000000 +0100 +++ new/iwd-2.13/src/wsc.c 2024-01-12 20:08:50.000000000 +0100 @@ -654,6 +654,7 @@ case STATION_STATE_CONNECTING: case STATION_STATE_CONNECTING_AUTO: case STATION_STATE_CONNECTED: + case STATION_STATE_NETCONFIG: if (station_disconnect(wsc->station) < 0) goto error; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iwd-2.12/unit/gencerts.cnf new/iwd-2.13/unit/gencerts.cnf --- old/iwd-2.12/unit/gencerts.cnf 2019-08-28 21:44:16.000000000 +0200 +++ new/iwd-2.13/unit/gencerts.cnf 2024-01-12 20:08:50.000000000 +0100 @@ -16,7 +16,6 @@ [ cert_ext ] basicConstraints = CA:FALSE subjectKeyIdentifier = hash -authorityKeyIdentifier = keyid:always,issuer:always [ server_ext ] basicConstraints = CA:FALSE