summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-02-09 18:15:34 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-02-09 18:15:34 -0600
commitebe02632384fe2718af9c2f96ee487c8da0cfeda (patch)
treec65df88c00ef2c29b14fec46b2657af79a4299d3
parent8f6349163cb8a38dbf85adca8711ed6396ac87ba (diff)
downloadnuttx-ebe02632384fe2718af9c2f96ee487c8da0cfeda.tar.gz
nuttx-ebe02632384fe2718af9c2f96ee487c8da0cfeda.tar.bz2
nuttx-ebe02632384fe2718af9c2f96ee487c8da0cfeda.zip
net/: Lots of build problems introduced into multiple NIC support. Many places where conditional logic based on CONFIG_NETDEV_MULTINIC is confused with CONFIG_NET_MULTILINK. Lots of code changed with IPv6 that was never compiled with MULTINIC enabled. Still some problem with parameter passing.
-rw-r--r--nuttx/net/arp/arp_send.c2
-rw-r--r--nuttx/net/icmp/icmp_ping.c2
-rw-r--r--nuttx/net/icmpv6/icmpv6_autoconfig.c1
-rw-r--r--nuttx/net/icmpv6/icmpv6_neighbor.c2
-rw-r--r--nuttx/net/icmpv6/icmpv6_ping.c2
-rw-r--r--nuttx/net/icmpv6/icmpv6_rnotify.c6
-rw-r--r--nuttx/net/netdev/netdev.h16
-rw-r--r--nuttx/net/netdev/netdev_findbyaddr.c16
-rw-r--r--nuttx/net/netdev/netdev_rxnotify.c8
-rw-r--r--nuttx/net/netdev/netdev_txnotify.c8
-rw-r--r--nuttx/net/socket/net_close.c4
-rw-r--r--nuttx/net/socket/net_sendfile.c4
-rw-r--r--nuttx/net/socket/recvfrom.c4
-rw-r--r--nuttx/net/tcp/tcp_conn.c14
-rw-r--r--nuttx/net/tcp/tcp_send_buffered.c4
-rw-r--r--nuttx/net/tcp/tcp_send_unbuffered.c4
-rw-r--r--nuttx/net/udp/udp_conn.c4
-rw-r--r--nuttx/net/udp/udp_sendto.c4
18 files changed, 56 insertions, 49 deletions
diff --git a/nuttx/net/arp/arp_send.c b/nuttx/net/arp/arp_send.c
index e14513df7..dfd38dbcb 100644
--- a/nuttx/net/arp/arp_send.c
+++ b/nuttx/net/arp/arp_send.c
@@ -222,7 +222,7 @@ int arp_send(in_addr_t ipaddr)
/* Get the device that can route this request */
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
dev = netdev_findby_ipv4addr(g_ipv4_allzeroaddr, ipaddr);
#else
dev = netdev_findby_ipv4addr(ipaddr);
diff --git a/nuttx/net/icmp/icmp_ping.c b/nuttx/net/icmp/icmp_ping.c
index 8158f2ab4..76d7e8a61 100644
--- a/nuttx/net/icmp/icmp_ping.c
+++ b/nuttx/net/icmp/icmp_ping.c
@@ -369,7 +369,7 @@ int icmp_ping(in_addr_t addr, uint16_t id, uint16_t seqno, uint16_t datalen,
/* Notify the device driver of the availability of TX data */
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
netdev_ipv4_txnotify(g_ipv4_allzeroaddr, state.png_addr);
#else
netdev_ipv4_txnotify(state.png_addr);
diff --git a/nuttx/net/icmpv6/icmpv6_autoconfig.c b/nuttx/net/icmpv6/icmpv6_autoconfig.c
index 082e17ab1..22a570c76 100644
--- a/nuttx/net/icmpv6/icmpv6_autoconfig.c
+++ b/nuttx/net/icmpv6/icmpv6_autoconfig.c
@@ -354,6 +354,7 @@ int icmpv6_autoconfig(FAR struct net_driver_s *dev)
return -ENOSYS;
}
#endif
+
/* The interface should be in the down state */
save = net_lock();
diff --git a/nuttx/net/icmpv6/icmpv6_neighbor.c b/nuttx/net/icmpv6/icmpv6_neighbor.c
index 794b02d67..b27a0bfb1 100644
--- a/nuttx/net/icmpv6/icmpv6_neighbor.c
+++ b/nuttx/net/icmpv6/icmpv6_neighbor.c
@@ -225,7 +225,7 @@ int icmpv6_neighbor(const net_ipv6addr_t ipaddr)
/* Get the device that can route this request */
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
dev = netdev_findby_ipv6addr(g_ipv6_allzeroaddr, ipaddr);
#else
dev = netdev_findby_ipv6addr(ipaddr);
diff --git a/nuttx/net/icmpv6/icmpv6_ping.c b/nuttx/net/icmpv6/icmpv6_ping.c
index 8f8ec37c6..4072cce95 100644
--- a/nuttx/net/icmpv6/icmpv6_ping.c
+++ b/nuttx/net/icmpv6/icmpv6_ping.c
@@ -439,7 +439,7 @@ int icmpv6_ping(net_ipv6addr_t addr, uint16_t id, uint16_t seqno,
/* Notify the device driver of the availability of TX data */
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
netdev_ipv6_txnotify(g_ipv6_allzeroaddr, state.png_addr);
#else
netdev_ipv6_txnotify(state.png_addr);
diff --git a/nuttx/net/icmpv6/icmpv6_rnotify.c b/nuttx/net/icmpv6/icmpv6_rnotify.c
index a605dc577..174c8c16a 100644
--- a/nuttx/net/icmpv6/icmpv6_rnotify.c
+++ b/nuttx/net/icmpv6/icmpv6_rnotify.c
@@ -159,7 +159,7 @@ static void icmpv6_setaddresses(FAR struct net_driver_s *dev,
void icmpv6_rwait_setup(FAR struct net_driver_s *dev,
FAR struct icmpv6_rnotify_s *notify)
{
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
irqstate_t flags;
/* Initialize the wait structure */
@@ -206,7 +206,7 @@ void icmpv6_rwait_setup(FAR struct net_driver_s *dev,
int icmpv6_rwait_cancel(FAR struct icmpv6_rnotify_s *notify)
{
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
FAR struct icmpv6_rnotify_s *curr;
FAR struct icmpv6_rnotify_s *prev;
irqstate_t flags;
@@ -332,7 +332,7 @@ int icmpv6_rwait(FAR struct icmpv6_rnotify_s *notify,
void icmpv6_rnotify(FAR struct net_driver_s *dev, const net_ipv6addr_t draddr,
const net_ipv6addr_t prefix, unsigned int preflen)
{
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
FAR struct icmpv6_rnotify_s *curr;
nvdbg("Notified\n");
diff --git a/nuttx/net/netdev/netdev.h b/nuttx/net/netdev/netdev.h
index d0083723b..3a1c0908b 100644
--- a/nuttx/net/netdev/netdev.h
+++ b/nuttx/net/netdev/netdev.h
@@ -100,7 +100,7 @@ FAR struct net_driver_s *netdev_findbyname(FAR const char *ifname);
#if CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET_IPv4
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
FAR struct net_driver_s *netdev_findby_ipv4addr(in_addr_t lipaddr,
in_addr_t ripaddr);
#else
@@ -109,7 +109,7 @@ FAR struct net_driver_s *netdev_findby_ipv4addr(in_addr_t ripaddr);
#endif
#ifdef CONFIG_NET_IPv6
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
FAR struct net_driver_s *netdev_findby_ipv6addr(const net_ipv6addr_t lipaddr,
const net_ipv6addr_t ripaddr);
#else
@@ -128,7 +128,7 @@ FAR struct net_driver_s *netdev_default(void);
#if CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET_IPv4
-# ifdef CONFIG_NET_MULTILINK
+# ifdef CONFIG_NETDEV_MULTINIC
void netdev_ipv4_txnotify(in_addr_t lipaddr, in_addr_t ripaddr);
# else
void netdev_ipv4_txnotify(in_addr_t ripaddr);
@@ -136,7 +136,7 @@ void netdev_ipv4_txnotify(in_addr_t ripaddr);
#endif /* CONFIG_NET_IPv4 */
#ifdef CONFIG_NET_IPv6
-# ifdef CONFIG_NET_MULTILINK
+# ifdef CONFIG_NETDEV_MULTINIC
void netdev_ipv6_txnotify(FAR const net_ipv6addr_t lipaddr,
FAR const net_ipv6addr_t ripaddr);
# else
@@ -150,7 +150,7 @@ void netdev_ipv6_txnotify(FAR const net_ipv6addr_t ripaddr);
#if CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET_RXAVAIL)
#ifdef CONFIG_NET_IPv4
-# ifdef CONFIG_NET_MULTILINK
+# ifdef CONFIG_NETDEV_MULTINIC
void netdev_ipv4_rxnotify(in_addr_t lipaddr, in_addr_t ripaddr);
# else
void netdev_ipv4_rxnotify(in_addr_t ripaddr);
@@ -158,7 +158,7 @@ void netdev_ipv4_rxnotify(in_addr_t ripaddr);
#endif /* CONFIG_NET_IPv4 */
#ifdef CONFIG_NET_IPv6
-# ifdef CONFIG_NET_MULTILINK
+# ifdef CONFIG_NETDEV_MULTINIC
void netdev_ipv6_rxnotify(FAR const net_ipv6addr_t lipaddr,
FAR const net_ipv6addr_t ripaddr);
# else
@@ -168,7 +168,7 @@ void netdev_ipv6_rxnotify(FAR const net_ipv6addr_t ripaddr);
#else
#ifdef CONFIG_NET_IPv4
-# ifdef CONFIG_NET_MULTILINK
+# ifdef CONFIG_NETDEV_MULTINIC
# define netdev_ipv4_rxnotify(lipaddr,ripaddr)
# else
# define netdev_ipv4_rxnotify(ripaddr)
@@ -176,7 +176,7 @@ void netdev_ipv6_rxnotify(FAR const net_ipv6addr_t ripaddr);
#endif /* CONFIG_NET_IPv4 */
#ifdef CONFIG_NET_IPv6
-# ifdef CONFIG_NET_MULTILINK
+# ifdef CONFIG_NETDEV_MULTINIC
# define netdev_ipv6_rxnotify(lipaddr,ripaddr)
# else
# define netdev_ipv6_rxnotify(ripaddr)
diff --git a/nuttx/net/netdev/netdev_findbyaddr.c b/nuttx/net/netdev/netdev_findbyaddr.c
index 14b284563..f7ba9de73 100644
--- a/nuttx/net/netdev/netdev_findbyaddr.c
+++ b/nuttx/net/netdev/netdev_findbyaddr.c
@@ -192,7 +192,7 @@ netdev_finddevice_ipv6addr(const net_ipv6addr_t ripaddr)
*
* Parameters:
* lipaddr - Local, bound address of a connection. Used only if ripaddr
- * is the broadcast address. Used only if CONFIG_NET_MULTILINK.
+ * is the broadcast address. Used only if CONFIG_NETDEV_MULTINIC.
* ripaddr - Remote address of a connection to use in the lookup
*
* Returned Value:
@@ -204,7 +204,7 @@ netdev_finddevice_ipv6addr(const net_ipv6addr_t ripaddr)
****************************************************************************/
#ifdef CONFIG_NET_IPv4
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
FAR struct net_driver_s *netdev_findby_ipv4addr(in_addr_t lipaddr,
in_addr_t ripaddr)
#else
@@ -221,7 +221,7 @@ FAR struct net_driver_s *netdev_findby_ipv4addr(in_addr_t ripaddr)
if (net_ipv4addr_cmp(ripaddr, g_ipv4_alloneaddr))
{
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
/* Yes.. Check the local, bound address. Is it INADDR_ANY? */
if (net_ipv4addr_cmp(lipaddr, g_ipv4_allzeroaddr))
@@ -283,7 +283,7 @@ FAR struct net_driver_s *netdev_findby_ipv4addr(in_addr_t ripaddr)
* out subnet to a router and there is no routing information.
*/
-#ifndef CONFIG_NET_MULTILINK
+#ifndef CONFIG_NETDEV_MULTINIC
/* If there is only a single, registered network interface, then the
* decision is pretty easy. Use that device and its default router
* address.
@@ -310,7 +310,7 @@ FAR struct net_driver_s *netdev_findby_ipv4addr(in_addr_t ripaddr)
*
* Parameters:
* lipaddr - Local, bound address of a connection. Used only if ripaddr
- * is the broadcast address. Used only if CONFIG_NET_MULTILINK.
+ * is the broadcast address. Used only if CONFIG_NETDEV_MULTINIC.
* ripaddr - Remote address of a connection to use in the lookup
*
* Returned Value:
@@ -322,7 +322,7 @@ FAR struct net_driver_s *netdev_findby_ipv4addr(in_addr_t ripaddr)
****************************************************************************/
#ifdef CONFIG_NET_IPv6
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
FAR struct net_driver_s *netdev_findby_ipv6addr(const net_ipv6addr_t lipaddr,
const net_ipv6addr_t ripaddr)
#else
@@ -339,7 +339,7 @@ FAR struct net_driver_s *netdev_findby_ipv6addr(const net_ipv6addr_t ripaddr)
if (net_ipv6addr_cmp(ripaddr, g_ipv6_alloneaddr))
{
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
/* Yes.. Check the local, bound address. Is it INADDR_ANY? */
if (net_ipv6addr_cmp(lipaddr, g_ipv6_allzeroaddr))
@@ -401,7 +401,7 @@ FAR struct net_driver_s *netdev_findby_ipv6addr(const net_ipv6addr_t ripaddr)
* out subnet to a router and there is no routing information.
*/
-#ifndef CONFIG_NET_MULTILINK
+#ifndef CONFIG_NETDEV_MULTINIC
/* If there is only a single, registered network interface, then the
* decision is pretty easy. Use that device and its default router
* address.
diff --git a/nuttx/net/netdev/netdev_rxnotify.c b/nuttx/net/netdev/netdev_rxnotify.c
index 89e690c1c..824c78f89 100644
--- a/nuttx/net/netdev/netdev_rxnotify.c
+++ b/nuttx/net/netdev/netdev_rxnotify.c
@@ -94,7 +94,7 @@
****************************************************************************/
#ifdef CONFIG_NET_IPv4
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
void netdev_ipv4_rxnotify(in_addr_t lipaddr, in_addr_t ripaddr)
#else
void netdev_ipv4_rxnotify(in_addr_t ripaddr)
@@ -104,7 +104,7 @@ void netdev_ipv4_rxnotify(in_addr_t ripaddr)
/* Find the device driver that serves the subnet of the remote address */
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
dev = netdev_findby_ipv4addr(lipaddr, ripaddr);
#else
dev = netdev_findby_ipv4addr(ripaddr);
@@ -139,7 +139,7 @@ void netdev_ipv4_rxnotify(in_addr_t ripaddr)
****************************************************************************/
#ifdef CONFIG_NET_IPv6
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
void netdev_ipv6_rxnotify(FAR const net_ipv6addr_t lipaddr,
FAR const net_ipv6addr_t ripaddr)
#else
@@ -150,7 +150,7 @@ void netdev_ipv6_rxnotify(FAR const net_ipv6addr_t ripaddr)
/* Find the device driver that serves the subnet of the remote address */
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
dev = netdev_findby_ipv6addr(lipaddr, ripaddr);
#else
dev = netdev_findby_ipv6addr(ripaddr);
diff --git a/nuttx/net/netdev/netdev_txnotify.c b/nuttx/net/netdev/netdev_txnotify.c
index d06064b3f..9346d58a2 100644
--- a/nuttx/net/netdev/netdev_txnotify.c
+++ b/nuttx/net/netdev/netdev_txnotify.c
@@ -94,7 +94,7 @@
****************************************************************************/
#ifdef CONFIG_NET_IPv4
-# ifdef CONFIG_NET_MULTILINK
+# ifdef CONFIG_NETDEV_MULTINIC
void netdev_ipv4_txnotify(in_addr_t lipaddr, in_addr_t ripaddr)
# else
void netdev_ipv4_txnotify(in_addr_t ripaddr)
@@ -104,7 +104,7 @@ void netdev_ipv4_txnotify(in_addr_t ripaddr)
/* Find the device driver that serves the subnet of the remote address */
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
dev = netdev_findby_ipv4addr(lipaddr, ripaddr);
#else
dev = netdev_findby_ipv4addr(ripaddr);
@@ -140,7 +140,7 @@ void netdev_ipv4_txnotify(in_addr_t ripaddr)
****************************************************************************/
#ifdef CONFIG_NET_IPv6
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
void netdev_ipv6_txnotify(FAR const net_ipv6addr_t lipaddr,
FAR const net_ipv6addr_t ripaddr)
#else
@@ -151,7 +151,7 @@ void netdev_ipv6_txnotify(FAR const net_ipv6addr_t ripaddr)
/* Find the device driver that serves the subnet of the remote address */
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
dev = netdev_findby_ipv6addr(lipaddr, ripaddr);
#else
dev = netdev_findby_ipv6addr(ripaddr);
diff --git a/nuttx/net/socket/net_close.c b/nuttx/net/socket/net_close.c
index ce87fcc9a..2ae8e606d 100644
--- a/nuttx/net/socket/net_close.c
+++ b/nuttx/net/socket/net_close.c
@@ -289,7 +289,7 @@ static inline void netclose_txnotify(FAR struct socket *psock,
{
/* Notify the device driver that send data is available */
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
netdev_ipv4_txnotify(conn->u.ipv4.laddr, conn->u.ipv4.raddr);
#else
netdev_ipv4_txnotify(conn->u.ipv4.raddr);
@@ -305,7 +305,7 @@ static inline void netclose_txnotify(FAR struct socket *psock,
/* Notify the device driver that send data is available */
DEBUGASSERT(psock->s_domain == PF_INET6);
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
netdev_ipv6_txnotify(conn->u.ipv6.laddr, conn->u.ipv6.raddr);
#else
netdev_ipv6_txnotify(conn->u.ipv6.raddr);
diff --git a/nuttx/net/socket/net_sendfile.c b/nuttx/net/socket/net_sendfile.c
index 036aa7103..52daf6203 100644
--- a/nuttx/net/socket/net_sendfile.c
+++ b/nuttx/net/socket/net_sendfile.c
@@ -492,7 +492,7 @@ static inline void sendfile_txnotify(FAR struct socket *psock,
{
/* Notify the device driver that send data is available */
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
netdev_ipv4_txnotify(conn->u.ipv4.laddr, conn->u.ipv4.raddr);
#else
netdev_ipv4_txnotify(conn->u.ipv4.raddr);
@@ -508,7 +508,7 @@ static inline void sendfile_txnotify(FAR struct socket *psock,
/* Notify the device driver that send data is available */
DEBUGASSERT(psock->s_domain == PF_INET6);
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
netdev_ipv6_txnotify(conn->u.ipv6.laddr, conn->u.ipv6.raddr);
#else
netdev_ipv6_txnotify(conn->u.ipv6.raddr);
diff --git a/nuttx/net/socket/recvfrom.c b/nuttx/net/socket/recvfrom.c
index 7f10853e8..d9e4f42c3 100644
--- a/nuttx/net/socket/recvfrom.c
+++ b/nuttx/net/socket/recvfrom.c
@@ -1225,7 +1225,7 @@ static inline void recvfrom_udp_rxnotify(FAR struct socket *psock,
{
/* Notify the device driver of the receive ready */
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
netdev_ipv4_rxnotify(conn->u.ipv4.laddr, conn->u.ipv4.raddr);
#else
netdev_ipv4_rxnotify(conn->u.ipv4.raddr);
@@ -1241,7 +1241,7 @@ static inline void recvfrom_udp_rxnotify(FAR struct socket *psock,
/* Notify the device driver of the receive ready */
DEBUGASSERT(psock->s_domain == PF_INET6);
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
netdev_ipv6_rxnotify(conn->u.ipv6.laddr, conn->u.ipv6.raddr);
#else
netdev_ipv6_rxnotify(conn->u.ipv6.raddr);
diff --git a/nuttx/net/tcp/tcp_conn.c b/nuttx/net/tcp/tcp_conn.c
index 32a5b7e25..d7a807067 100644
--- a/nuttx/net/tcp/tcp_conn.c
+++ b/nuttx/net/tcp/tcp_conn.c
@@ -104,7 +104,7 @@ static uint16_t g_last_tcp_port;
****************************************************************************/
#if defined(CONFIG_NET_IPv4) && defined(CONFIG_NETDEV_MULTINIC)
-static inline FAR struct tcp_conn_s *tcp_ipv4_listener(inaddr_t ipaddr,
+static inline FAR struct tcp_conn_s *tcp_ipv4_listener(in_addr_t ipaddr,
uint16_t portno)
{
FAR struct tcp_conn_s *conn;
@@ -207,7 +207,7 @@ static inline FAR struct tcp_conn_s *tcp_ipv6_ listener(net_ipv6addr_t ipaddr,
#ifdef CONFIG_NETDEV_MULTINIC
static FAR struct tcp_conn_s *
- tcp_listener(uint8_t domain, FAR const union ip_binding_u *ipaddr,
+ tcp_listener(uint8_t domain, FAR const union ip_addr_u *ipaddr,
uint16_t portno)
{
#ifdef CONFIG_NET_IPv4
@@ -521,7 +521,7 @@ static inline int tcp_ipv4_bind(FAR struct tcp_conn_s *conn,
#ifdef CONFIG_NETDEV_MULTINIC
port = tcp_selectport(PF_INET,
- (FAR const union ip_addr_u ipaddr *)&addr->sin_addr.s_addr,
+ (FAR const union ip_addr_u *)&addr->sin_addr.s_addr,
ntohs(addr->sin_port));
#else
port = tcp_selectport(ntohs(addr->sin_port));
@@ -539,7 +539,7 @@ static inline int tcp_ipv4_bind(FAR struct tcp_conn_s *conn,
conn->lport = addr->sin_port;
#ifdef CONFIG_NETDEV_MULTINIC
- net_ipv4addr_copy(conn->u.ipv4.laddr, ipaddr);
+ net_ipv4addr_copy(conn->u.ipv4.laddr, addr->sin_addr.s_addr);
#endif
return OK;
@@ -1100,7 +1100,13 @@ int tcp_connect(FAR struct tcp_conn_s *conn, FAR const struct sockaddr *addr)
flags = net_lock();
#ifdef CONFIG_NETDEV_MULTINIC
+#if defined(CONFIG_NET_IPv4) && defined(CONFIG_NET_IPv6)
port = tcp_selectport(conn->domain, &conn->u, ntohs(conn->lport));
+#elif defined(CONFIG_NET_IPv4)
+ port = tcp_selectport(PF_INET, &conn->u, ntohs(conn->lport));
+#else
+ port = tcp_selectport(PF_INET6, &conn->u, ntohs(conn->lport));
+#endif
#else
port = tcp_selectport(ntohs(conn->lport));
#endif
diff --git a/nuttx/net/tcp/tcp_send_buffered.c b/nuttx/net/tcp/tcp_send_buffered.c
index f8c0b02c1..db814cfb6 100644
--- a/nuttx/net/tcp/tcp_send_buffered.c
+++ b/nuttx/net/tcp/tcp_send_buffered.c
@@ -829,7 +829,7 @@ static inline void send_txnotify(FAR struct socket *psock,
{
/* Notify the device driver that send data is available */
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
netdev_ipv4_txnotify(conn->u.ipv4.laddr, conn->u.ipv4.raddr);
#else
netdev_ipv4_txnotify(conn->u.ipv4.raddr);
@@ -845,7 +845,7 @@ static inline void send_txnotify(FAR struct socket *psock,
/* Notify the device driver that send data is available */
DEBUGASSERT(psock->s_domain == PF_INET6);
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
netdev_ipv6_txnotify(conn->u.ipv6.laddr, conn->u.ipv6.raddr);
#else
netdev_ipv6_txnotify(conn->u.ipv6.raddr);
diff --git a/nuttx/net/tcp/tcp_send_unbuffered.c b/nuttx/net/tcp/tcp_send_unbuffered.c
index 0d4efbc1c..9d7de805b 100644
--- a/nuttx/net/tcp/tcp_send_unbuffered.c
+++ b/nuttx/net/tcp/tcp_send_unbuffered.c
@@ -615,7 +615,7 @@ static inline void send_txnotify(FAR struct socket *psock,
{
/* Notify the device driver that send data is available */
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
netdev_ipv4_txnotify(conn->u.ipv4.laddr, conn->u.ipv4.raddr);
#else
netdev_ipv4_txnotify(conn->u.ipv4.raddr);
@@ -631,7 +631,7 @@ static inline void send_txnotify(FAR struct socket *psock,
/* Notify the device driver that send data is available */
DEBUGASSERT(psock->s_domain == PF_INET6);
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
netdev_ipv6_txnotify(conn->u.ipv6.laddr, conn->u.ipv6.raddr);
#else
netdev_ipv6_txnotify(conn->u.ipv6.raddr);
diff --git a/nuttx/net/udp/udp_conn.c b/nuttx/net/udp/udp_conn.c
index a72004318..2592aa7dc 100644
--- a/nuttx/net/udp/udp_conn.c
+++ b/nuttx/net/udp/udp_conn.c
@@ -596,7 +596,7 @@ int udp_bind(FAR struct udp_conn_s *conn, FAR const struct sockaddr *addr)
* interfaces for receiving (Sending will use the default port).
*/
- net_ipv4addr_copy(conn->u.ipv4.laddr, inaddr->sin_addr.s_addr;);
+ net_ipv4addr_copy(conn->u.ipv4.laddr, inaddr->sin_addr.s_addr);
#endif /* CONFIG_NETDEV_MULTINIC */
}
#endif /* CONFIG_NET_IPv4 */
@@ -646,7 +646,7 @@ int udp_bind(FAR struct udp_conn_s *conn, FAR const struct sockaddr *addr)
/* Is any other UDP connection already bound to this address and port? */
#ifdef CONFIG_NETDEV_MULTINIC
- if (!udp_find_conn(conn->domain, &config->u, portno))
+ if (!udp_find_conn(conn->domain, &conn->u, portno))
#else
if (!udp_find_conn(portno))
#endif
diff --git a/nuttx/net/udp/udp_sendto.c b/nuttx/net/udp/udp_sendto.c
index 3af854cb8..289cc87c4 100644
--- a/nuttx/net/udp/udp_sendto.c
+++ b/nuttx/net/udp/udp_sendto.c
@@ -320,7 +320,7 @@ static inline void sendto_txnotify(FAR struct socket *psock,
{
/* Notify the device driver that send data is available */
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
netdev_ipv4_txnotify(conn->u.ipv4.laddr, conn->u.ipv4.raddr);
#else
netdev_ipv4_txnotify(conn->u.ipv4.raddr);
@@ -336,7 +336,7 @@ static inline void sendto_txnotify(FAR struct socket *psock,
/* Notify the device driver that send data is available */
DEBUGASSERT(psock->s_domain == PF_INET6);
-#ifdef CONFIG_NET_MULTILINK
+#ifdef CONFIG_NETDEV_MULTINIC
netdev_ipv6_txnotify(conn->u.ipv6.laddr, conn->u.ipv6.raddr);
#else
netdev_ipv6_txnotify(conn->u.ipv6.raddr);