diff --git a/gc/network.h b/gc/network.h index bdd6ed1b..dd2accce 100644 --- a/gc/network.h +++ b/gc/network.h @@ -280,7 +280,7 @@ s32 net_init_async(netcallback cb, void *usrdata); s32 net_get_status(void); void net_wc24cleanup(void); #endif -s32 net_get_mac_address(void *mac_buf); +s32 net_get_mac_address(u8 mac_buf[6]); void net_deinit(void); u32 net_gethostip(void); diff --git a/libogc/network_wii.c b/libogc/network_wii.c index 6bde0b30..f916a58d 100644 --- a/libogc/network_wii.c +++ b/libogc/network_wii.c @@ -657,10 +657,10 @@ void net_wc24cleanup(void) { } } -s32 net_get_mac_address(void *mac_buf) { +s32 net_get_mac_address(u8 mac_buf[6]) { s32 fd; s32 result; - void *_mac_buf; + u8 *_mac_buf; STACK_ALIGN(u32, manage_buf, 0x20, 32); if (mac_buf==NULL) return -EINVAL; diff --git a/lwip/network.c b/lwip/network.c index c89390d5..bcc7c131 100644 --- a/lwip/network.c +++ b/lwip/network.c @@ -1612,9 +1612,10 @@ u32 net_gethostip(void) return g_hNetIF.ip_addr.addr; } -s32 net_get_mac_address(void *mac_buf) +s32 net_get_mac_address(u8 mac_buf[6]) { if(mac_buf==NULL) return -EINVAL; + if(g_hNetIF.hwaddr_len!=6) return -ERANGE; memcpy(mac_buf,g_hNetIF.hwaddr,g_hNetIF.hwaddr_len); return 0; }