#define WIFI_IF "wlan0"
#define WIFI_IF_1 "wlan1"
#define IP_ADDRESS_WIFI 0xC0A82B02 /* 192.168.43.2 */
-#define IP_ADDRESS_WIFI_5G 0xC0A82B04 /* 192.168.43.4 */
+#define IP_ADDRESS_WIFI_5G 0xC0A82C02 /* 192.168.44.2 */
#define SOFTAP_IF "wl0.1"
#define SOFTAP_IF_5G "wl0.2"
#define IP_ADDRESS_SOFTAP 0xC0A82B01 /* 192.168.43.1 */
-#define IP_ADDRESS_SOFTAP_5G 0xC0A82B03 /* 192.168.43.3 */
+#define IP_ADDRESS_SOFTAP_5G 0xC0A82C01 /* 192.168.44.1 */
#define USB_IF "usb0"
#define IP_ADDRESS_USB 0xC0A88103 /* 192.168.129.3 */
#define DNSMASQ_CONF_FILE "/tmp/dnsmasq.conf"
#define DNSMASQ_CONF \
"dhcp-range=%s,%s,255.255.255.0\n" \
+ "dhcp-range=192.168.44.3,192.168.44.150,255.255.255.0\n" \
"dhcp-range=192.168.130.2,192.168.130.150,255.255.255.0\n" \
"dhcp-range=192.168.131.2,192.168.131.150,255.255.255.0\n" \
"dhcp-range=192.168.132.2,192.168.132.150,255.255.255.0\n" \
"enable-ra\n" \
"dhcp-range=interface:usb0, %s::ffff:ffe0, %s::ffff:ffff, 64, 12h\n"\
"dhcp-range=interface:wlan0, %s::fffe:ffe0, %s::fffe:ffff, 64, 12h\n"\
+ "dhcp-range=interface:wlan1, %s::fffe:ffe0, %s::fffe:ffff, 64, 12h\n"\
"dhcp-range=interface:bnep0, %s::fffd:ffe0, %s::fffd:ffff, 64, 12h\n"\
"dhcp-range=interface:bnep1, %s::fffc:ffe0, %s::fffc:ffff, 64, 12h\n"\
"dhcp-range=interface:bnep2, %s::fffb:ffe0, %s::fffb:ffff, 64, 12h\n"\
Name: mobileap-agent
Summary: Mobile AP daemon for setting tethering environments
-Version: 1.0.138
+Version: 1.0.139
Release: 1
Group: System/Network
License: Apache-2.0
static gboolean is_init = FALSE;
static in_addr_t subnet_wifi;
+ static in_addr_t subnet_wifi_5g;
static in_addr_t subnet_bt_min;
static in_addr_t subnet_bt_max;
static in_addr_t subnet_usb;
addr.s_addr = htonl(IP_ADDRESS_WIFI);
subnet_wifi = inet_netof(addr);
+ addr.s_addr = htonl(IP_ADDRESS_WIFI_5G);
+ subnet_wifi_5g = inet_netof(addr);
+
addr.s_addr = htonl(IP_ADDRESS_BT_1);
subnet_bt_min = inet_netof(addr);
subnet_wifi = inet_netof(addr);
}
- if (subnet == subnet_wifi) {
+ if (subnet == subnet_wifi || subnet == subnet_wifi_5g) {
if (_mobileap_is_enabled(MOBILE_AP_STATE_WIFI))
*type = MOBILE_AP_TYPE_WIFI;
else
#define PORT_FORWARD_RULE_STR "-t %s -A %s -i %s -p %s -d %s --dport %d -j DNAT --to %s:%d"
#define CLAMP_MSS_RULE_STR "-t %s -A %s -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu"
#define DEFAULT_RULE_STR "-t %s -A %s -j %s"
+#define DEL_DEFAULT_RULE_STR "-t %s -D %s -j %s"
#define FILTERING_MULTIPORT_RULE_STR "-t %s -A %s -p %s -m multiport --dport %d,%d -j %s"
#define FILTERING_RULE_STR "-t %s -A %s -p %s --dport %d -j %s"
break;
}
#endif
+ case DEFAULT_RULE: {
+ char *action;
+
+ action = va_arg(ap, char *);
+
+ if (action == NULL) {
+ ERR("invalid parameters\n"); //LCOV_EXCL_LINE
+ goto ERROR_EXIT;
+ }
+
+ snprintf(cmd, sizeof(cmd), "%s "DEL_DEFAULT_RULE_STR, IPTABLES,
+ table, chain, action);
+ break;
+ }
+
default:
ERR("case not supported\n"); //LCOV_EXCL_LINE
goto ERROR_EXIT;
_iptables_create_chain(TABLE_FILTER, TETH_FILTER_FW);
+ _iptables_delete_rule(DEFAULT_RULE, TABLE_FILTER, TETH_FILTER_FW,
+ ACTION_DROP);
+
_iptables_add_rule(PKT_REDIRECTION_RULE, TABLE_FILTER, CHAIN_FW,
TETH_FILTER_FW);
prefix, prefix, prefix, prefix,
prefix, prefix, prefix, prefix,
prefix, prefix, prefix, prefix,
- prefix, prefix, dns_addr);
+ prefix, prefix, prefix, prefix,
+ dns_addr);
} else {
prefix = g_strndup(network_addr, 10);
snprintf(buf, DNSMASQ_CONF_LEN,
prefix, prefix, prefix, prefix,
prefix, prefix, prefix, prefix,
prefix, prefix, prefix, prefix,
- prefix, prefix, DNS64_SERVER_ADDR);
+ prefix, prefix, prefix, prefix,
+ DNS64_SERVER_ADDR);
}
fputs(buf, fp);