brcmfmac: Disable ARP offloading when promiscuous
authorPhil Elwell <phil@raspberrypi.org>
Thu, 24 Aug 2017 15:16:16 +0000 (16:16 +0100)
committerpopcornmix <popcornmix@gmail.com>
Mon, 13 May 2019 23:08:03 +0000 (00:08 +0100)
This is a test patch for brcmfmac from Franky Lin at Broadcom to disable
ARP offloading when in promiscuous mode, re-enabling the ability to
sniff ARP packets over WiFi.

See: https://github.com/raspberrypi/linux/issues/2171

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h

index 860a437..6d593dd 100644 (file)
@@ -88,25 +88,25 @@ void brcmf_configure_arp_nd_offload(struct brcmf_if *ifp, bool enable)
        if (err) {
                brcmf_dbg(TRACE, "failed to set ARP offload mode to 0x%x, err = %d\n",
                          mode, err);
+               err = 0;
        } else {
                err = brcmf_fil_iovar_int_set(ifp, "arpoe", enable);
                if (err) {
                        brcmf_dbg(TRACE, "failed to configure (%d) ARP offload err = %d\n",
                                  enable, err);
-               } else {
+                       err = 0;
+               } else
                        brcmf_dbg(TRACE, "successfully configured (%d) ARP offload to 0x%x\n",
                                  enable, mode);
-               }
        }
 
        err = brcmf_fil_iovar_int_set(ifp, "ndoe", enable);
-       if (err) {
+       if (err)
                brcmf_dbg(TRACE, "failed to configure (%d) ND offload err = %d\n",
                          enable, err);
-       } else {
+       else
                brcmf_dbg(TRACE, "successfully configured (%d) ND offload to 0x%x\n",
                          enable, mode);
-       }
 }
 
 static void _brcmf_set_multicast_list(struct work_struct *work)
@@ -172,6 +172,7 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
        if (err < 0)
                brcmf_err("Setting BRCMF_C_SET_PROMISC failed, %d\n",
                          err);
+
        brcmf_configure_arp_nd_offload(ifp, !cmd_value);
 }
 
index dcf6e27..edfb09e 100644 (file)
@@ -210,6 +210,7 @@ char *brcmf_ifname(struct brcmf_if *ifp);
 struct brcmf_if *brcmf_get_ifp(struct brcmf_pub *drvr, int ifidx);
 void brcmf_configure_arp_nd_offload(struct brcmf_if *ifp, bool enable);
 int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked);
+void brcmf_configure_arp_nd_offload(struct brcmf_if *ifp, bool enable);
 struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bsscfgidx, s32 ifidx,
                              bool is_p2pdev, const char *name, u8 *mac_addr);
 void brcmf_remove_interface(struct brcmf_if *ifp, bool rtnl_locked);