mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Add logic to netdev_findbyaddr() to return the correct network device for the case where a broadcast address is used. This change caused trivial ripples through other files because additional parameters are required for netdev_findbyaddr() when CONFIG_NET_MULTINIC
This commit is contained in:
@@ -357,7 +357,11 @@ static inline int netclose_disconnect(FAR struct socket *psock)
|
||||
|
||||
/* Notify the device driver of the availability of TX data */
|
||||
|
||||
#ifdef CONFIG_NET_MULTILINK
|
||||
netdev_txnotify(conn->lipaddr, conn->ripaddr);
|
||||
#else
|
||||
netdev_txnotify(conn->ripaddr);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_SOLINGER
|
||||
/* Wait only if we are lingering */
|
||||
|
||||
@@ -562,10 +562,13 @@ ssize_t net_sendfile(int outfd, struct file *infile, off_t *offset,
|
||||
state.snd_datacb->priv = (void*)&state;
|
||||
state.snd_datacb->event = sendfile_interrupt;
|
||||
|
||||
/* Notify the device driver of the availaibilty of TX data */
|
||||
/* Notify the device driver of the availability of TX data */
|
||||
|
||||
#ifdef CONFIG_NET_MULTILINK
|
||||
netdev_txnotify(conn->lipaddr, conn->ripaddr);
|
||||
#else
|
||||
netdev_txnotify(conn->ripaddr);
|
||||
|
||||
#endif
|
||||
net_lockedwait(&state.snd_sem);
|
||||
}
|
||||
while (state.snd_sent >= 0 && state.snd_acked < state.snd_flen);
|
||||
|
||||
+11
-1
@@ -1090,7 +1090,13 @@ static ssize_t pkt_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
|
||||
|
||||
/* Notify the device driver of the receive call */
|
||||
|
||||
/* netdev_rxnotify(conn->ripaddr); */
|
||||
#if 0 /* No */
|
||||
#ifdef CONFIG_NET_MULTILINK
|
||||
netdev_rxnotify(conn->lipaddr, conn->ripaddr);
|
||||
#else
|
||||
netdev_rxnotify(conn->ripaddr);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Wait for either the receive to complete or for an error/timeout to occur.
|
||||
* NOTES: (1) net_lockedwait will also terminate if a signal is received, (2)
|
||||
@@ -1184,7 +1190,11 @@ static ssize_t udp_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
|
||||
|
||||
/* Notify the device driver of the receive call */
|
||||
|
||||
#ifdef CONFIG_NET_MULTILINK
|
||||
netdev_rxnotify(conn->lipaddr, conn->ripaddr);
|
||||
#else
|
||||
netdev_rxnotify(conn->ripaddr);
|
||||
#endif
|
||||
|
||||
/* Wait for either the receive to complete or for an error/timeout to occur.
|
||||
* NOTES: (1) net_lockedwait will also terminate if a signal is received, (2)
|
||||
|
||||
+5
-1
@@ -417,9 +417,13 @@ ssize_t psock_sendto(FAR struct socket *psock, FAR const void *buf,
|
||||
state.st_cb->priv = (void*)&state;
|
||||
state.st_cb->event = sendto_interrupt;
|
||||
|
||||
/* Notify the device driver of the availabilty of TX data */
|
||||
/* Notify the device driver of the availability of TX data */
|
||||
|
||||
#ifdef CONFIG_NET_MULTILINK
|
||||
netdev_txnotify(conn->lipaddr, conn->ripaddr);
|
||||
#else
|
||||
netdev_txnotify(conn->ripaddr);
|
||||
#endif
|
||||
|
||||
/* Wait for either the receive to complete or for an error/timeout to occur.
|
||||
* NOTES: (1) net_lockedwait will also terminate if a signal is received, (2)
|
||||
|
||||
Reference in New Issue
Block a user