netlink/route: remove domain check

Change-Id: I965788c3bd2e6bfa41048b87d8c26f111f61c48e
Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
chao.an 2020-04-13 15:32:13 +08:00 committed by Xiang Xiao
parent 773f540d74
commit 85dce03d22

View File

@ -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 *)