Skip to content
Snippets Groups Projects
Commit ae2a1d07 authored by Gregory Nutt's avatar Gregory Nutt
Browse files

Networking: drivers/net/loopback.c: Eliminate a warning. ...

Networking: drivers/net/loopback.c: Eliminate a warning.  net/netdev/netdev_ifconfig.c: Was not returning all of the address info.
parent 7af976c0
No related branches found
No related tags found
No related merge requests found
......@@ -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 */
......
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment