[PATCH v2] doc: add section about regulatory.db missing
by James Prestwood
It was found that some distros do not ship with a regulatory.db file.
This is required to run some of the autotests, and if not found on the
system the kernel build will fail due to some of the IWD config
options which require regulatory.db.
The fix is to manually download regulatory.db from git.kernel.org and
place it in /lib/firmware.
---
doc/test-runner.txt | 10 ++++++++++
1 file changed, 10 insertions(+)
-v2:
* Fixed missing 'this' in sentence
diff --git a/doc/test-runner.txt b/doc/test-runner.txt
index 3660381a..ccc17f7b 100644
--- a/doc/test-runner.txt
+++ b/doc/test-runner.txt
@@ -69,6 +69,16 @@ After that a default kernel with the required options can be built:
$ make -j$(nproc)
+Note: If your host distribution does not contain a regulatory.db you may get an
+error similar to this when building the kernel:
+
+No rule to make target '/lib/firmware/regulatory.db'...
+
+To fix this you must download the regulatory.db manually and place it in
+/lib/firmware. This can be found here:
+
+https://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git
+
Note: To catch locking related issues the following set of kernel config
options may be useful:
--
2.17.1
1 year, 4 months
[PATCH] doc: add section about regulatory.db missing
by James Prestwood
It was found that some distros do not ship with a regulatory.db file.
This is required to run some of the autotests, and if not found on the
system the kernel build will fail due to some of the IWD config
options which require regulatory.db.
The fix is to manually download regulatory.db from git.kernel.org and
place it in /lib/firmware.
---
doc/test-runner.txt | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/doc/test-runner.txt b/doc/test-runner.txt
index 3660381a..2f1b4fd0 100644
--- a/doc/test-runner.txt
+++ b/doc/test-runner.txt
@@ -69,6 +69,16 @@ After that a default kernel with the required options can be built:
$ make -j$(nproc)
+Note: If your host distribution does not contain a regulatory.db you may get an
+error similar to when building the kernel:
+
+No rule to make target '/lib/firmware/regulatory.db'...
+
+To fix this you must download the regulatory.db manually and place it in
+/lib/firmware. This can be found here:
+
+https://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git
+
Note: To catch locking related issues the following set of kernel config
options may be useful:
--
2.17.1
1 year, 4 months
[PATCH] build: add pem-private.h to Makefile.am
by James Prestwood
---
Makefile.am | 1 +
1 file changed, 1 insertion(+)
diff --git a/Makefile.am b/Makefile.am
index 1e489bb3..00dc899c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -103,6 +103,7 @@ ell_sources = ell/private.h \
ell/base64.c \
ell/asn1-private.h \
ell/pem.c \
+ ell/pem-private.h \
ell/tls-private.h \
ell/tls.c \
ell/tls-record.c \
--
2.17.1
1 year, 4 months
[PATCH 1/2] netconfig: Allow to override IPv4 DHCP DNSs with static addresses
by Tim Kourt
---
src/netconfig.c | 37 +++++++++++++++++++++++++++++--------
1 file changed, 29 insertions(+), 8 deletions(-)
diff --git a/src/netconfig.c b/src/netconfig.c
index 285d5fef..51d06ce1 100644
--- a/src/netconfig.c
+++ b/src/netconfig.c
@@ -207,14 +207,37 @@ static char *netconfig_ipv4_get_gateway(struct netconfig *netconfig)
static char **netconfig_ipv4_get_dns(struct netconfig *netconfig, uint8_t proto)
{
const struct l_dhcp_lease *lease;
+ struct in_addr in_addr;
+ char **dns_list;
+ char **p;
- switch (proto) {
- case RTPROT_STATIC:
-
- return l_settings_get_string_list(netconfig->active_settings,
+ p = dns_list = l_settings_get_string_list(netconfig->active_settings,
"IPv4", "dns", ' ');
+ if (dns_list && *dns_list) {
+ for (; *p; p++) {
+ if (inet_pton(AF_INET, *p, &in_addr) == 1)
+ continue;
- case RTPROT_DHCP:
+ l_error("netconfig: Invalid IPv4 DNS address '%s' is "
+ "provided in network configuration file.", *p);
+
+ l_strv_free(dns_list);
+
+ return NULL;
+ }
+
+ /* Allow to override the DHCP DNSs with static addressing. */
+ return dns_list;
+ } else if (dns_list) {
+ l_error("netconfig: No IPv4 DNS address is provided in network "
+ "configuration file.");
+
+ l_strv_free(dns_list);
+
+ return NULL;
+ }
+
+ if (proto == RTPROT_DHCP) {
lease = l_dhcp_client_get_lease(netconfig->dhcp_client);
if (!lease)
return NULL;
@@ -662,9 +685,7 @@ static void netconfig_ipv4_ifaddr_add_cmd_cb(int error, uint16_t type,
dns = netconfig_ipv4_get_dns(netconfig, netconfig->rtm_protocol);
if (!dns) {
- l_error("netconfig: Failed to obtain DNS addresses from %s.",
- netconfig->rtm_protocol == RTPROT_STATIC ?
- "setting file" : "DHCPv4 lease");
+ l_error("netconfig: Failed to obtain DNS addresses.");
goto done;
}
--
2.13.6
1 year, 4 months
[PATCH] station: don't reset/(re)configure/destroy NULL netconfig's
by Will Dietz
Fixes crashes when `enable_network_config` is false (default).
---
src/station.c | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/src/station.c b/src/station.c
index eed3a7f..9b3e087 100644
--- a/src/station.c
+++ b/src/station.c
@@ -1165,16 +1165,18 @@ static void station_enter_state(struct station *station,
periodic_scan_stop(station);
if (station->state == STATION_STATE_ROAMING) {
- netconfig_reconfigure(station->netconfig);
+ if (station->netconfig)
+ netconfig_reconfigure(station->netconfig);
break;
}
- netconfig_configure(station->netconfig,
- network_get_settings(
- station->connected_network),
- netdev_get_address(
- station->netdev));
+ if (station->netconfig)
+ netconfig_configure(station->netconfig,
+ network_get_settings(
+ station->connected_network),
+ netdev_get_address(
+ station->netdev));
break;
case STATION_STATE_DISCONNECTING:
case STATION_STATE_ROAMING:
@@ -1262,7 +1264,8 @@ static void station_disassociated(struct station *station)
{
l_debug("%u", netdev_get_ifindex(station->netdev));
- netconfig_reset(station->netconfig);
+ if (station->netconfig)
+ netconfig_reset(station->netconfig);
station_reset_connection_state(station);
@@ -2344,7 +2347,8 @@ static void station_disconnect_onconnect(struct station *station,
return;
}
- netconfig_reset(station->netconfig);
+ if (station->netconfig)
+ netconfig_reset(station->netconfig);
station_reset_connection_state(station);
@@ -2581,7 +2585,8 @@ int station_disconnect(struct station *station)
station_disconnect_cb, station) < 0)
return -EIO;
- netconfig_reset(station->netconfig);
+ if (station->netconfig)
+ netconfig_reset(station->netconfig);
/*
* If the disconnect somehow fails we won't know if we're still
@@ -3061,7 +3066,8 @@ static void station_free(struct station *station)
if (station->connected_bss)
netdev_disconnect(station->netdev, NULL, NULL);
- netconfig_destroy(station->netconfig);
+ if (station->netconfig)
+ netconfig_destroy(station->netconfig);
station->netconfig = NULL;
periodic_scan_stop(station);
--
2.23.0
1 year, 4 months
[PATCH] station: record dependency on netconfig module
by Will Dietz
The netconfig module must be initialized (netconfig_list, for example)
before station module can be used, record this to ensure that happens.
---
src/station.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/station.c b/src/station.c
index 0666287..eed3a7f 100644
--- a/src/station.c
+++ b/src/station.c
@@ -3190,3 +3190,4 @@ static void station_exit(void)
}
IWD_MODULE(station, station_init, station_exit)
+IWD_MODULE_DEPENDS(station, netconfig)
--
2.23.0
1 year, 4 months
[PATCH] crypto: fix copy size causing overruns/crashing
by Will Dietz
num_ad is already accounted for in `sizeof(iov)`
as iov has size `sizeof(struct iovec) * (num_ad+1)`.
---
src/crypto.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/crypto.c b/src/crypto.c
index 632117d..62edd44 100644
--- a/src/crypto.c
+++ b/src/crypto.c
@@ -311,7 +311,7 @@ bool aes_siv_encrypt(const uint8_t *key, size_t key_len, const uint8_t *in,
struct iovec iov[num_ad + 1];
uint8_t v[16];
- memcpy(iov, ad, sizeof(iov) * num_ad);
+ memcpy(iov, ad, sizeof(struct iovec) * num_ad);
iov[num_ad].iov_base = (void *)in;
iov[num_ad].iov_len = in_len;
num_ad++;
@@ -368,7 +368,7 @@ bool aes_siv_decrypt(const uint8_t *key, size_t key_len, const uint8_t *in,
if (in_len < 16)
return false;
- memcpy(iov, ad, sizeof(iov) * num_ad);
+ memcpy(iov, ad, sizeof(struct iovec) * num_ad);
iov[num_ad].iov_base = (void *)out;
iov[num_ad].iov_len = in_len - 16;
num_ad++;
--
2.23.0
1 year, 4 months
[PATCH] crypto: fix copy size causing overruns/crashing
by Will Dietz
num_ad is already accounted for in `sizeof(iov)`
as iov has size `sizeof(struct iovec) * (num_ad+1)`.
---
src/crypto.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/crypto.c b/src/crypto.c
index 632117d..62edd44 100644
--- a/src/crypto.c
+++ b/src/crypto.c
@@ -311,7 +311,7 @@ bool aes_siv_encrypt(const uint8_t *key, size_t key_len, const uint8_t *in,
struct iovec iov[num_ad + 1];
uint8_t v[16];
- memcpy(iov, ad, sizeof(iov) * num_ad);
+ memcpy(iov, ad, sizeof(struct iovec) * num_ad);
iov[num_ad].iov_base = (void *)in;
iov[num_ad].iov_len = in_len;
num_ad++;
@@ -368,7 +368,7 @@ bool aes_siv_decrypt(const uint8_t *key, size_t key_len, const uint8_t *in,
if (in_len < 16)
return false;
- memcpy(iov, ad, sizeof(iov) * num_ad);
+ memcpy(iov, ad, sizeof(struct iovec) * num_ad);
iov[num_ad].iov_base = (void *)out;
iov[num_ad].iov_len = in_len - 16;
num_ad++;
--
2.23.GIT
1 year, 4 months
[PATCH] station: record dependency on netconfig module
by Will Dietz
The netconfig module must be initialized (netconfig_list, for example)
before station module can be used, record this to ensure that happens.
---
src/station.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/station.c b/src/station.c
index 0666287..eed3a7f 100644
--- a/src/station.c
+++ b/src/station.c
@@ -3190,3 +3190,4 @@ static void station_exit(void)
}
IWD_MODULE(station, station_init, station_exit)
+IWD_MODULE_DEPENDS(station, netconfig)
--
2.23.GIT
1 year, 4 months
[PATCH] station: don't reset/(re)configure/destroy NULL netconfig's
by Will Dietz
Fixes crashes when `enable_network_config` is false (default).
---
src/station.c | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/src/station.c b/src/station.c
index eed3a7f..9b3e087 100644
--- a/src/station.c
+++ b/src/station.c
@@ -1165,16 +1165,18 @@ static void station_enter_state(struct station *station,
periodic_scan_stop(station);
if (station->state == STATION_STATE_ROAMING) {
- netconfig_reconfigure(station->netconfig);
+ if (station->netconfig)
+ netconfig_reconfigure(station->netconfig);
break;
}
- netconfig_configure(station->netconfig,
- network_get_settings(
- station->connected_network),
- netdev_get_address(
- station->netdev));
+ if (station->netconfig)
+ netconfig_configure(station->netconfig,
+ network_get_settings(
+ station->connected_network),
+ netdev_get_address(
+ station->netdev));
break;
case STATION_STATE_DISCONNECTING:
case STATION_STATE_ROAMING:
@@ -1262,7 +1264,8 @@ static void station_disassociated(struct station *station)
{
l_debug("%u", netdev_get_ifindex(station->netdev));
- netconfig_reset(station->netconfig);
+ if (station->netconfig)
+ netconfig_reset(station->netconfig);
station_reset_connection_state(station);
@@ -2344,7 +2347,8 @@ static void station_disconnect_onconnect(struct station *station,
return;
}
- netconfig_reset(station->netconfig);
+ if (station->netconfig)
+ netconfig_reset(station->netconfig);
station_reset_connection_state(station);
@@ -2581,7 +2585,8 @@ int station_disconnect(struct station *station)
station_disconnect_cb, station) < 0)
return -EIO;
- netconfig_reset(station->netconfig);
+ if (station->netconfig)
+ netconfig_reset(station->netconfig);
/*
* If the disconnect somehow fails we won't know if we're still
@@ -3061,7 +3066,8 @@ static void station_free(struct station *station)
if (station->connected_bss)
netdev_disconnect(station->netdev, NULL, NULL);
- netconfig_destroy(station->netconfig);
+ if (station->netconfig)
+ netconfig_destroy(station->netconfig);
station->netconfig = NULL;
periodic_scan_stop(station);
--
2.23.GIT
1 year, 4 months