wpa_supplicant:禁用 IPv6

wpa_supplicant:禁用 IPv6

我的系统不支持IPv6,我只使用IPv4.我的wpa_supplicant日志中充斥着以下错误消息:

wpa_supplicant[3370]:  nl80211: Failed to open /proc/sys/net/ipv6/conf/wlan0/drop_unicast_in_l2_multicast: No such file or directory
wpa_supplicant[3370]:  nl80211: Failed to set IPv6 unicast in multicast filter

这本身是无害的,但很难真正找到其他有用的消息。

我怎样才能知道wpa_supplicant只使用IPv4而不尝试配置IPv6

答案1

正如我在您的另一篇文章中提到的,在 wpa_supplicant 中禁用 IPv6 支持是不可能的。如果您的唯一目标是阻止 wpa_supplicant 记录问题中提到的两个错误,只需克隆源代码并修改通过注释掉设置 IPv6 参数的行来实现该函数。

// comment out these lines in nl80211_configure_data_frame_filters(...)

static int nl80211_configure_data_frame_filters(void *priv, u32 filter_flags)
{
    struct i802_bss *bss = priv;
    char path[128];
    int ret;

    /* P2P-Device has no netdev that can (or should) be configured here */
    if (nl80211_get_ifmode(bss) == NL80211_IFTYPE_P2P_DEVICE)
        return 0;

    wpa_printf(MSG_DEBUG, "nl80211: Data frame filter flags=0x%x",
           filter_flags);

    /* Configure filtering of unicast frame encrypted using GTK */
    ret = os_snprintf(path, sizeof(path),
              "/proc/sys/net/ipv4/conf/%s/drop_unicast_in_l2_multicast",
              bss->ifname);
    if (os_snprintf_error(sizeof(path), ret))
        return -1;

    ret = nl80211_write_to_file(path,
                    !!(filter_flags &
                       WPA_DATA_FRAME_FILTER_FLAG_GTK));
    if (ret) {
        wpa_printf(MSG_ERROR,
               "nl80211: Failed to set IPv4 unicast in multicast filter");
        return ret;
    }

/** THIS BLOCK
    os_snprintf(path, sizeof(path),
            "/proc/sys/net/ipv6/conf/%s/drop_unicast_in_l2_multicast",
            bss->ifname);
    ret = nl80211_write_to_file(path,
                    !!(filter_flags &
                       WPA_DATA_FRAME_FILTER_FLAG_GTK));

    if (ret) {
        wpa_printf(MSG_ERROR,
               "nl80211: Failed to set IPv6 unicast in multicast filter");
        return ret;
    }
**/

    /* Configure filtering of unicast frame encrypted using GTK */
    os_snprintf(path, sizeof(path),
            "/proc/sys/net/ipv4/conf/%s/drop_gratuitous_arp",
            bss->ifname);
    ret = nl80211_write_to_file(path,
                    !!(filter_flags &
                       WPA_DATA_FRAME_FILTER_FLAG_ARP));
    if (ret) {
        wpa_printf(MSG_ERROR,
               "nl80211: Failed set gratuitous ARP filter");
        return ret;
    }

    /* Configure filtering of IPv6 NA frames */
/** THIS BLOCK
    os_snprintf(path, sizeof(path),
            "/proc/sys/net/ipv6/conf/%s/drop_unsolicited_na",
            bss->ifname);
    ret = nl80211_write_to_file(path,
                    !!(filter_flags &
                       WPA_DATA_FRAME_FILTER_FLAG_NA));
    if (ret) {
        wpa_printf(MSG_ERROR,
               "nl80211: Failed to set unsolicited NA filter");
        return ret;
    }
**/

    return 0;
}

但实际上你应该做的是向人们发送电子邮件主机[电子邮件受保护])并解释您不支持 IPv6,并且 wpa_supplicant 正在向您的日志发送垃圾邮件,您希望它停止。老实说,维护人员在回答问题时很随意,因此请确保您清楚地提出问题,并提供他们进行评估所需的所有信息。

答案2

wpa_supplicant没有在运行时禁用 IPv6 支持的选项。您需要重新编译它。我检查了2.9版本的源代码。

相关内容