From 3607ee0c7ee78b889f59312262466db5d38b03ef Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Tue, 17 Dec 2019 16:10:46 -0600 Subject: [PATCH] netdev: Allow both -EOPNOTSUPP and -ENOTSUPP It seems that the kernel uses -EOPNOTSUPP if the change_station operation is not implemented by the driver. However, some drivers do implement change_station and choose to report -ENOTSUPP instead of -EOPNOTSUPP. To add to the confusion, EOPNOTSUPP and -ENOTSUPP are the same on some systems (e.g. Gentoo). Be paranoid and allow both errors to be ignored when sending CMD_SET_STATION. Fixes: 0238ffb8d999 ("netdev: Use -EOPNOTSUPP instead of -ENOTSUPP") --- src/netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/netdev.c b/src/netdev.c index 9ba60766..d16be0d8 100644 --- a/src/netdev.c +++ b/src/netdev.c @@ -1082,7 +1082,7 @@ static void netdev_set_station_cb(struct l_genl_msg *msg, void *user_data) return; err = l_genl_msg_get_error(msg); - if (err == -EOPNOTSUPP) + if (err == -EOPNOTSUPP || err == -ENOTSUPP) goto done; if (err < 0) {