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
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef CONFIG_NET
|
#ifdef CONFIG_NET_ETHERNET
|
||||||
/* Run the network if enabled */
|
/* Run the network if enabled */
|
||||||
|
|
||||||
netdriver_loop();
|
netdriver_loop();
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ void up_initialize(void)
|
|||||||
up_registerblockdevice(); /* Our FAT ramdisk at /dev/ram0 */
|
up_registerblockdevice(); /* Our FAT ramdisk at /dev/ram0 */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_NET
|
#ifdef CONFIG_NET_ETHERNET
|
||||||
netdriver_init(); /* Our "real" network driver */
|
netdriver_init(); /* Our "real" network driver */
|
||||||
#endif
|
#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 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
|
/* Traverse all of the active packet connections and perform the poll
|
||||||
* action.
|
* 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 devif_timer(FAR struct net_driver_s *dev, devif_poll_callback_t callback,
|
||||||
int hsec)
|
int hsec)
|
||||||
{
|
{
|
||||||
int bstop;
|
int bstop = false;
|
||||||
|
|
||||||
/* Increment the timer used by the IP reassembly logic */
|
/* Increment the timer used by the IP reassembly logic */
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
|
|
||||||
#if defined(CONFIG_NET_SLIP)
|
#if defined(CONFIG_NET_SLIP)
|
||||||
# define NETDEV_DEFAULT_FORMAT NETDEV_SLIP_FORMAT
|
# 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
|
# define NETDEV_DEFAULT_FORMAT NETDEV_ETH_FORMAT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+26
-12
@@ -1615,23 +1615,37 @@ ssize_t psock_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
|
|||||||
|
|
||||||
/* Get the minimum socket length */
|
/* Get the minimum socket length */
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IPv4
|
switch (psock->s_domain)
|
||||||
#ifdef CONFIG_NET_IPv6
|
|
||||||
if (psock->s_domain == PF_INET)
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
minlen = sizeof(struct sockaddr_in);
|
#ifdef CONFIG_NET_IPv4
|
||||||
}
|
case PF_INET:
|
||||||
#endif /*CONFIG_NET_IPv4 */
|
{
|
||||||
|
minlen = sizeof(struct sockaddr_in);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IPv6
|
#ifdef CONFIG_NET_IPv6
|
||||||
#ifdef CONFIG_NET_IPv4
|
case PF_INET6:
|
||||||
else
|
{
|
||||||
|
minlen = sizeof(struct sockaddr_in6);
|
||||||
|
}
|
||||||
|
break;
|
||||||
#endif
|
#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)
|
if (*fromlen < minlen)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user