mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
pkg/lwip: Update netif_get_name implementation
Correctly refer to the struct netif inside the netif_t Fix call to netif_get_name from lwIP ifconfig shell command
This commit is contained in:
parent
efeaac51ca
commit
7593bb0e40
@ -16,12 +16,13 @@
|
||||
*/
|
||||
|
||||
#include "fmt.h"
|
||||
#include "lwip/netif.h"
|
||||
#include "lwip/netif/compat.h"
|
||||
#include "net/netif.h"
|
||||
|
||||
int netif_get_name(netif_t *iface, char *name)
|
||||
{
|
||||
struct netif *netif = (struct netif *)iface;
|
||||
lwip_netif_t *lwip_netif = (lwip_netif_t*) iface;
|
||||
struct netif *netif = &lwip_netif->lwip_netif;
|
||||
|
||||
int res = 2;
|
||||
name[0] = netif->name[0];
|
||||
|
@ -18,8 +18,9 @@
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include <kernel_defines.h>
|
||||
#include <stdio.h>
|
||||
#include "lwip/netif.h"
|
||||
#include "lwip/netif/compat.h"
|
||||
#include "net/netdev.h"
|
||||
#include "net/netopt.h"
|
||||
|
||||
@ -43,9 +44,10 @@ static void _netif_list_ipv6(struct netif *netif, int addr_index) {
|
||||
|
||||
static void _netif_list(struct netif *netif) {
|
||||
int i;
|
||||
char name[8];
|
||||
char name[CONFIG_NETIF_NAMELENMAX];
|
||||
struct netdev *dev = netif->state;
|
||||
netif_get_name((netif_t *)netif, name);
|
||||
lwip_netif_t *compat = container_of(netif, lwip_netif_t, lwip_netif);
|
||||
netif_get_name(&compat->common_netif, name);
|
||||
printf("Iface %s HWaddr: ", name);
|
||||
for (i = 0; i < netif->hwaddr_len; i++) {
|
||||
printf("%02x", netif->hwaddr[i]);
|
||||
|
Loading…
Reference in New Issue
Block a user