Commit 485ee64e authored by Jussi Laakkonen's avatar Jussi Laakkonen

[wifi] Report no error in tethering if GSupplicant is missing. JB#42927

If there is no GSupplicantInterface set for any of the WiFi devices do
not report tethering enabling as EOPNOTSUPP which causes a disabling
notification for tethering. It will tear down the firewall set for the
tethering. Instead, do nothing and return 0. Tethering will be
intitiated by src/tethering.c: __connman_tethering_set_enabled().

Also fix iptables test. -m udp -m multiport passes checks now but is
wrong and iptables calls exit().
parent c1d8cf91
......@@ -3801,17 +3801,31 @@ static int wifi_plugin_set_tethering(struct wifi_plugin *plugin,
if (enabled) {
struct wifi_device *ap_dev = NULL;
bool interface_found = false;
for (l = plugin->devices; l && !ap_dev; l = l->next) {
struct wifi_device *dev = l->data;
GSupplicantInterface* iface = dev->iface;
if (iface)
interface_found = true;
if (iface && iface->valid && (iface->caps.modes &
ap_dev = dev;
* When there is no interfaces set do not report an error.
* Instead, report plain ok value and do nothing. Tethering will
* be initiated otherwise.
if (!interface_found) {
DBG("no GSupplicantInterface set for any device.");
return 0;
if (!ap_dev) {
DBG("tethering not supported");
return (-EOPNOTSUPP);
......@@ -1184,7 +1184,7 @@ static const char *invalid_general_output[] = {
static const char *invalid_general_forward[] = {
"-j ACCEPT -j DROP",
"-p udp -m udp -m multiport --dport 654 -j DROP",
"-p udp -m udp -m multiport -m udp --dport 654 -j DROP",
static const char *invalid_eth_input[] = {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment