Skip to content

Commit e274dd4

Browse files
authored
Merge pull request #161 from pennam/net-iface-enum-fix
Ethernet: fix interface discovery on portenta c33
2 parents 78df734 + c4c204c commit e274dd4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/SocketWrapper/Ethernet.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ class EthernetClass: public NetworkInterface
4646
EthernetHardwareStatus hardwareStatus() {
4747
const struct device *const dev = DEVICE_DT_GET(DT_COMPAT_GET_ANY_STATUS_OKAY(ethernet_phy));
4848
if (device_is_ready(dev)) {
49-
for (int i = 1; i < 3; i++) {
49+
for (int i = 1; i < 4; i++) {
5050
auto _if = net_if_get_by_index(i);
51-
if (!net_eth_type_is_wifi(_if)) {
51+
if (_if && !net_eth_type_is_wifi(_if)) {
5252
netif = _if;
5353
break;
5454
}

0 commit comments

Comments
 (0)