mirror of
https://github.com/apache/nuttx.git
synced 2026-08-09 06:25:09 +00:00
Unix domain: More fixed to build without Ethernet or Slip
This commit is contained in:
parent
c49c7bc447
commit
c250c97186
5 changed files with 31 additions and 17 deletions
|
|
@ -117,7 +117,7 @@ void up_idle(void)
|
|||
#endif
|
||||
|
||||
|
||||
#ifdef CONFIG_NET
|
||||
#ifdef CONFIG_NET_ETHERNET
|
||||
/* Run the network if enabled */
|
||||
|
||||
netdriver_loop();
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ void up_initialize(void)
|
|||
up_registerblockdevice(); /* Our FAT ramdisk at /dev/ram0 */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET
|
||||
#ifdef CONFIG_NET_ETHERNET
|
||||
netdriver_init(); /* Our "real" network driver */
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -313,7 +313,7 @@ static inline int devif_poll_tcp_timer(FAR struct net_driver_s *dev,
|
|||
|
||||
int devif_poll(FAR struct net_driver_s *dev, devif_poll_callback_t callback)
|
||||
{
|
||||
int bstop;
|
||||
int bstop = false;
|
||||
|
||||
/* Traverse all of the active packet connections and perform the poll
|
||||
* action.
|
||||
|
|
@ -417,7 +417,7 @@ int devif_poll(FAR struct net_driver_s *dev, devif_poll_callback_t callback)
|
|||
int devif_timer(FAR struct net_driver_s *dev, devif_poll_callback_t callback,
|
||||
int hsec)
|
||||
{
|
||||
int bstop;
|
||||
int bstop = false;
|
||||
|
||||
/* Increment the timer used by the IP reassembly logic */
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@
|
|||
|
||||
#if defined(CONFIG_NET_SLIP)
|
||||
# define NETDEV_DEFAULT_FORMAT NETDEV_SLIP_FORMAT
|
||||
#elif defined(CONFIG_NET_ETHERNET)
|
||||
#else /* `if defined(CONFIG_NET_ETHERNET) */
|
||||
# define NETDEV_DEFAULT_FORMAT NETDEV_ETH_FORMAT
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -1615,23 +1615,37 @@ ssize_t psock_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
|
|||
|
||||
/* Get the minimum socket length */
|
||||
|
||||
#ifdef CONFIG_NET_IPv4
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
if (psock->s_domain == PF_INET)
|
||||
#endif
|
||||
switch (psock->s_domain)
|
||||
{
|
||||
minlen = sizeof(struct sockaddr_in);
|
||||
}
|
||||
#endif /*CONFIG_NET_IPv4 */
|
||||
#ifdef CONFIG_NET_IPv4
|
||||
case PF_INET:
|
||||
{
|
||||
minlen = sizeof(struct sockaddr_in);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
#ifdef CONFIG_NET_IPv4
|
||||
else
|
||||
case PF_INET6:
|
||||
{
|
||||
minlen = sizeof(struct sockaddr_in6);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
{
|
||||
minlen = sizeof(struct sockaddr_in6);
|
||||
|
||||
#ifdef CONFIG_NET_LOCAL
|
||||
case PF_LOCAL:
|
||||
{
|
||||
minlen = sizeof(sa_family_t);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
DEBUGPANIC();
|
||||
err = EINVAL;
|
||||
goto errout;
|
||||
}
|
||||
#endif /*CONFIG_NET_IPv6 */
|
||||
|
||||
if (*fromlen < minlen)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue