diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index fcebc69966..8b48a45056 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c @@ -133,12 +133,10 @@ static int lo_ifup(FAR struct net_driver_s *dev); static int lo_ifdown(FAR struct net_driver_s *dev); static void lo_txavail_work(FAR void *arg); static int lo_txavail(FAR struct net_driver_s *dev); -#if defined(CONFIG_NET_IGMP) || defined(CONFIG_NET_ICMPv6) -static int lo_addmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac); #ifdef CONFIG_NET_IGMP +static int lo_addmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac); static int lo_rmmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac); #endif -#endif /**************************************************************************** * Private Functions @@ -455,7 +453,7 @@ static int lo_txavail(FAR struct net_driver_s *dev) * ****************************************************************************/ -#if defined(CONFIG_NET_IGMP) || defined(CONFIG_NET_ICMPv6) +#ifdef CONFIG_NET_IGMP static int lo_addmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac) { /* There is no multicast support in the loopback driver */ diff --git a/net/netdev/netdev_ifconf.c b/net/netdev/netdev_ifconf.c index 44efdea4a1..6b2a821914 100644 --- a/net/netdev/netdev_ifconf.c +++ b/net/netdev/netdev_ifconf.c @@ -134,8 +134,11 @@ static int ifconf_ipv4_callback(FAR struct net_driver_s *dev, FAR void *arg) * transferred is returned in ifc_len. */ - strncpy(req->ifr_name, dev->d_ifname, IFNAMSIZ); - net_ipv4addr_copy(inaddr->sin_addr.s_addr, dev->d_ipaddr); + strncpy(req->ifr_name, dev->d_ifname, IFNAMSIZ); + + inaddr->sin_family = AF_INET; + inaddr->sin_port = 0; + net_ipv4addr_copy(inaddr->sin_addr.s_addr, dev->d_ipaddr); } /* Increment the size of the buffer in any event */ @@ -206,6 +209,9 @@ static int ifconf_ipv6_callback(FAR struct net_driver_s *dev, FAR void *arg) */ strncpy(req->lifr_name, dev->d_ifname, IFNAMSIZ); + + inaddr->sin6_family = AF_INET6; + inaddr->sin6_port = 0; net_ipv6addr_copy(inaddr->sin6_addr.s6_addr16, dev->d_ipv6addr); }