nuttx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiaoxi...@apache.org
Subject [incubator-nuttx] 01/05: netlink/route: remove domain check
Date Thu, 16 Apr 2020 09:47:27 GMT
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 85dce03d22cc91cd49577cc0f1449e36ce2a7226
Author: chao.an <anchao@xiaomi.com>
AuthorDate: Mon Apr 13 15:32:13 2020 +0800

    netlink/route: remove domain check
    
    Change-Id: I965788c3bd2e6bfa41048b87d8c26f111f61c48e
    Signed-off-by: chao.an <anchao@xiaomi.com>
---
 net/netlink/netlink_route.c | 116 --------------------------------------------
 1 file changed, 116 deletions(-)

diff --git a/net/netlink/netlink_route.c b/net/netlink/netlink_route.c
index f42b95d..6f356d7 100644
--- a/net/netlink/netlink_route.c
+++ b/net/netlink/netlink_route.c
@@ -221,122 +221,6 @@ static int netlink_device_callback(FAR struct net_driver_s *dev,
       return 0;
     }
 
-  /* Filter only the requested address families */
-
-  switch (info->req->gen.rtgen_family)
-    {
-#ifdef CONFIG_NET_LOCAL
-      case AF_LOCAL:
-        /* Should have info->psock->s_domain == PF_LOCAL and d_lltype ==
-         * NET_LL_LOOPBACK.
-         */
-
-        if (info->psock->s_domain == PF_LOCAL)
-          {
-            DEBUGASSERT(dev->d_lltype == NET_LL_LOOPBACK);
-            break;
-          }
-        else
-          {
-            return 0;
-          }
-#endif
-
-#ifdef CONFIG_NET_IPv4
-        /* Should have info->psock->s_domain == PF_INET but d_lltype could be
-         * several things.
-         */
-
-      case AF_INET:
-
-        if (info->psock->s_domain == PF_INET)
-          {
-            break;
-          }
-        else
-          {
-            return 0;
-          }
-#endif
-
-#ifdef CONFIG_NET_IPv6
-        /* Should have info->psock->s_domain == PF_INET6 but d_lltype could
-         * be several things.
-         */
-
-      case AF_INET6:
-
-        if (info->psock->s_domain == PF_INET6)
-          {
-            break;
-          }
-        else
-          {
-            return 0;
-          }
-#endif
-
-#ifdef CONFIG_NET_BLUETOOTH
-        /* Should have info->psock->s_domain == PF_PACKET and d_lltype should
-         * be NET_LL_BLUETOOTH.
-         */
-
-      case AF_BLUETOOTH:
-        if (info->psock->s_domain == PF_PACKET)
-          {
-            DEBUGASSERT(dev->d_lltype == NET_LL_BLUETOOTH);
-            break;
-          }
-        else
-          {
-            return 0;
-          }
-#endif
-
-#if defined(CONFIG_NET_6LOWPAN) || defined(CONFIG_NET_IEEE802154)
-      /* psock_domain could be PF_PACKET or PF_INET6 but d_lltype should
-       * be AF_IEEE802154.
-       */
-
-      case AF_IEEE802154:
-        if (dev->d_lltype == NET_LL_IEEE802154)
-          {
-            DEBUGASSERT(info->psock->s_domain == PF_PACKET ||
-                        info->psock->s_domain == PF_INET6);
-            break;
-          }
-        else
-          {
-            return 0;
-          }
-#endif
-
-#ifdef CONFIG_NET_6LOWPAN
-      /* psock_domain should be PF_INET6 and d_lltype should be
-       * NET_LL_PKTRADIO.
-       */
-
-        if (dev->d_lltype == NET_LL_PKTRADIO)
-          {
-            DEBUGASSERT(info->psock->s_domain == PF_INET6);
-            break;
-          }
-        else
-          {
-            return 0;
-          }
-#endif
-
-      case AF_PACKET:     /* Take all address families */
-        break;
-
-      case AF_UNSPEC:
-      case AF_PKTRADIO:
-      default:
-        nerr("ERROR: Unsupported address family: %u\n", info->req->gen);
-        return 0;
-    }
-
   /* Allocate the response buffer */
 
   alloc = (FAR struct getlink_recvfrom_rsplist_s *)


Mime
View raw message