Remove CONFIG_NETDEV_MULTINIC. This increases code size by a little, but greatly reduces the complexity of the network code.

This commit is contained in:
Gregory Nutt
2017-08-08 14:24:12 -06:00
parent d49d6a6aa9
commit bd7c84b23e
55 changed files with 84 additions and 776 deletions
-3
View File
@@ -172,14 +172,11 @@ static uint16_t send_interrupt(FAR struct net_driver_s *dev,
}
#endif
#ifdef CONFIG_NETDEV_MULTINIC
/* REVISIT: Verify that this is the correct IEEE802.15.4 network driver to
* route the outgoing frame(s). Chances are that there is only one
* IEEE802.15.4 network driver
*/
#endif
/* Check if the IEEE802.15.4 network driver went down */
if ((flags & NETDEV_DOWN) != 0)
+1 -19
View File
@@ -219,13 +219,11 @@ static int sixlowpan_tcp_header(FAR struct tcp_conn_s *conn,
/* Copy the source and destination addresses */
net_ipv6addr_hdrcopy(ipv6tcp->ipv6.destipaddr, conn->u.ipv6.raddr);
#ifdef CONFIG_NETDEV_MULTINIC
if (!net_ipv6addr_cmp(conn->u.ipv6.laddr, g_ipv6_allzeroaddr))
{
net_ipv6addr_hdrcopy(ipv6tcp->ipv6.srcipaddr, conn->u.ipv6.laddr);
}
else
#endif
{
net_ipv6addr_hdrcopy(ipv6tcp->ipv6.srcipaddr, dev->d_ipv6addr);
}
@@ -363,7 +361,6 @@ static uint16_t tcp_send_interrupt(FAR struct net_driver_s *dev,
}
#endif
#ifdef CONFIG_NETDEV_MULTINIC
/* The TCP socket is connected and, hence, should be bound to a device.
* Make sure that the polling device is the one that we are bound to.
*/
@@ -371,10 +368,9 @@ static uint16_t tcp_send_interrupt(FAR struct net_driver_s *dev,
DEBUGASSERT(conn->dev != NULL);
if (dev != conn->dev)
{
ninfo("Not the connecte device\n");
ninfo("Not the connected device\n");
return flags;
}
#endif
/* Check if the IEEE802.15.4 network driver went down */
@@ -800,9 +796,6 @@ ssize_t psock_6lowpan_tcp_send(FAR struct socket *psock, FAR const void *buf,
/* Route outgoing message to the correct device */
#ifdef CONFIG_NETDEV_MULTINIC
/* There are multiple network devices */
dev = netdev_findby_ipv6addr(conn->u.ipv6.laddr, conn->u.ipv6.raddr);
if (dev == NULL)
{
@@ -823,17 +816,6 @@ ssize_t psock_6lowpan_tcp_send(FAR struct socket *psock, FAR const void *buf,
}
#endif
#else
/* There is a single network device */
dev = netdev_findby_ipv6addr(conn->u.ipv6.raddr);
if (dev == NULL)
{
nwarn("WARNING: Not routable\n");
return (ssize_t)-ENETUNREACH;
}
#endif
#ifdef CONFIG_NET_ICMPv6_NEIGHBOR
/* Make sure that the IP address mapping is in the Neighbor Table */
-14
View File
@@ -205,9 +205,6 @@ ssize_t psock_6lowpan_udp_sendto(FAR struct socket *psock,
/* Route outgoing message to the correct device */
#ifdef CONFIG_NETDEV_MULTINIC
/* There are multiple network devices */
dev = netdev_findby_ipv6addr(conn->u.ipv6.laddr,
to6->sin6_addr.in6_u.u6_addr16);
if (dev == NULL)
@@ -229,15 +226,6 @@ ssize_t psock_6lowpan_udp_sendto(FAR struct socket *psock,
}
#endif
#else
dev = netdev_findby_ipv6addr(to6->sin6_addr.in6_u.u6_addr16);
if (dev == NULL)
{
nwarn("WARNING: Not routable\n");
return (ssize_t)-ENETUNREACH;
}
#endif
#ifdef CONFIG_NET_ICMPv6_NEIGHBOR
/* Make sure that the IP address mapping is in the Neighbor Table */
@@ -268,13 +256,11 @@ ssize_t psock_6lowpan_udp_sendto(FAR struct socket *psock,
/* Copy the source and destination addresses */
net_ipv6addr_hdrcopy(ipv6udp.ipv6.destipaddr, to6->sin6_addr.in6_u.u6_addr16);
#ifdef CONFIG_NETDEV_MULTINIC
if (!net_ipv6addr_cmp(conn->u.ipv6.laddr, g_ipv6_allzeroaddr))
{
net_ipv6addr_hdrcopy(ipv6udp.ipv6.srcipaddr, conn->u.ipv6.laddr);
}
else
#endif
{
net_ipv6addr_hdrcopy(ipv6udp.ipv6.srcipaddr, dev->d_ipv6addr);
}