mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 01:21:26 +08:00
Unix domain: More fixed to build without Ethernet or Slip
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
+22
-8
@@ -1615,23 +1615,37 @@ ssize_t psock_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
|
||||
|
||||
/* Get the minimum socket length */
|
||||
|
||||
switch (psock->s_domain)
|
||||
{
|
||||
#ifdef CONFIG_NET_IPv4
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
if (psock->s_domain == PF_INET)
|
||||
#endif
|
||||
case PF_INET:
|
||||
{
|
||||
minlen = sizeof(struct sockaddr_in);
|
||||
}
|
||||
#endif /*CONFIG_NET_IPv4 */
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
#ifdef CONFIG_NET_IPv4
|
||||
else
|
||||
#endif
|
||||
case PF_INET6:
|
||||
{
|
||||
minlen = sizeof(struct sockaddr_in6);
|
||||
}
|
||||
#endif /*CONFIG_NET_IPv6 */
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_LOCAL
|
||||
case PF_LOCAL:
|
||||
{
|
||||
minlen = sizeof(sa_family_t);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
DEBUGPANIC();
|
||||
err = EINVAL;
|
||||
goto errout;
|
||||
}
|
||||
|
||||
if (*fromlen < minlen)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user