Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/confd/src/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ static confd_dependency_t dep_radio_components(struct lyd_node **diff, struct ly
class = lyd_get_value(class_node);
}

if (strcmp(class, "infix-hardware:wifi"))
if (!class || strcmp(class, "infix-hardware:wifi"))
continue;

/* Find all interfaces that reference this radio */
Expand Down
6 changes: 3 additions & 3 deletions src/confd/src/hardware.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ static const char *wifi_find_higher_band_twin(struct lyd_node *config,
{
struct lyd_node *cifs, *cif;

if (strcmp(current_band, "2.4GHz"))
if (!current_band || !current_ssid || strcmp(current_band, "2.4GHz"))
return NULL;

cifs = lydx_get_descendant(config, "interfaces", "interface", NULL);
Expand All @@ -252,13 +252,13 @@ static const char *wifi_find_higher_band_twin(struct lyd_node *config,
if (!ap)
continue;
ssid = lydx_get_cattr(ap, "ssid");
if (strcmp(ssid, current_ssid))
if (!ssid || strcmp(ssid, current_ssid))
continue;
radio = lydx_get_cattr(wifi, "radio");
radio_node = lydx_get_xpathf(config,
"/hardware/component[name='%s']/wifi-radio", radio);
band = lydx_get_cattr(radio_node, "band");
if (!strcmp(band, "5GHz") || !strcmp(band, "6GHz"))
if (band && (!strcmp(band, "5GHz") || !strcmp(band, "6GHz")))
return lydx_get_cattr(cif, "name");
}

Expand Down
2 changes: 1 addition & 1 deletion src/confd/src/ieee802-ethernet-interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ static int netdag_gen_ethtool_autoneg(struct dagger *net, struct lyd_node *cif)
err = -EINVAL;
goto out;
}
if (n != 1) {
if (n != 1 || !forced) {
sr_session_set_error_message(net->session,
"%s: auto-negotiation/enable=false requires exactly one "
"advertised-pmd-types entry (have %d)", ifname, n);
Expand Down
6 changes: 3 additions & 3 deletions src/confd/src/if-wifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ static int wifi_center_chan_160(int ch)
*/
static int wifi_chan_to_freq(int channel, const char *band)
{
if (!strcmp(band, "6GHz"))
if (band && !strcmp(band, "6GHz"))
return 5950 + channel * 5;

if (channel >= 1 && channel <= 13)
Expand Down Expand Up @@ -392,7 +392,7 @@ int wifi_gen_mesh(struct lyd_node *cif)
int center = wifi_center_chan_80(channel);

fprintf(wpa_supplicant, " ht40=1\n");
if (!strcmp(band, "6GHz"))
if (band && !strcmp(band, "6GHz"))
fprintf(wpa_supplicant, " he=1\n");
else
fprintf(wpa_supplicant, " vht=1\n");
Expand All @@ -403,7 +403,7 @@ int wifi_gen_mesh(struct lyd_node *cif)
int center = wifi_center_chan_160(channel);

fprintf(wpa_supplicant, " ht40=1\n");
if (!strcmp(band, "6GHz"))
if (band && !strcmp(band, "6GHz"))
fprintf(wpa_supplicant, " he=1\n");
else
fprintf(wpa_supplicant, " vht=1\n");
Expand Down
Loading