Networking: drivers/net/loopback.c: Eliminate a warning. net/netdev/netdev_ifconfig.c: Was not returning all of the address info.

This commit is contained in:
Gregory Nutt 2017-09-19 15:00:46 -06:00
parent 7af976c00a
commit ae2a1d07b3
2 changed files with 10 additions and 6 deletions

View File

@ -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 int lo_ifdown(FAR struct net_driver_s *dev);
static void lo_txavail_work(FAR void *arg); static void lo_txavail_work(FAR void *arg);
static int lo_txavail(FAR struct net_driver_s *dev); 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 #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); static int lo_rmmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac);
#endif #endif
#endif
/**************************************************************************** /****************************************************************************
* Private Functions * 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) static int lo_addmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac)
{ {
/* There is no multicast support in the loopback driver */ /* There is no multicast support in the loopback driver */

View File

@ -134,8 +134,11 @@ static int ifconf_ipv4_callback(FAR struct net_driver_s *dev, FAR void *arg)
* transferred is returned in ifc_len. * transferred is returned in ifc_len.
*/ */
strncpy(req->ifr_name, dev->d_ifname, IFNAMSIZ); strncpy(req->ifr_name, dev->d_ifname, IFNAMSIZ);
net_ipv4addr_copy(inaddr->sin_addr.s_addr, dev->d_ipaddr);
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 */ /* 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); 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); net_ipv6addr_copy(inaddr->sin6_addr.s6_addr16, dev->d_ipv6addr);
} }