stm32/modnetwork: Fix arg indexing in generic ifconfig method.
This commit is contained in:
parent
7d86ac6c01
commit
309fe39dbb
@ -136,7 +136,7 @@ mp_obj_t mod_network_nic_ifconfig(struct netif *netif, size_t n_args, const mp_o
|
|||||||
netutils_format_ipv4_addr((uint8_t*)&dns, NETUTILS_BIG),
|
netutils_format_ipv4_addr((uint8_t*)&dns, NETUTILS_BIG),
|
||||||
};
|
};
|
||||||
return mp_obj_new_tuple(4, tuple);
|
return mp_obj_new_tuple(4, tuple);
|
||||||
} else if (args[1] == MP_OBJ_NEW_QSTR(MP_QSTR_dhcp)) {
|
} else if (args[0] == MP_OBJ_NEW_QSTR(MP_QSTR_dhcp)) {
|
||||||
// Start the DHCP client
|
// Start the DHCP client
|
||||||
if (dhcp_supplied_address(netif)) {
|
if (dhcp_supplied_address(netif)) {
|
||||||
dhcp_renew(netif);
|
dhcp_renew(netif);
|
||||||
@ -161,7 +161,7 @@ mp_obj_t mod_network_nic_ifconfig(struct netif *netif, size_t n_args, const mp_o
|
|||||||
dhcp_stop(netif);
|
dhcp_stop(netif);
|
||||||
// Set static IP addresses
|
// Set static IP addresses
|
||||||
mp_obj_t *items;
|
mp_obj_t *items;
|
||||||
mp_obj_get_array_fixed_n(args[1], 4, &items);
|
mp_obj_get_array_fixed_n(args[0], 4, &items);
|
||||||
netutils_parse_ipv4_addr(items[0], (uint8_t*)&netif->ip_addr, NETUTILS_BIG);
|
netutils_parse_ipv4_addr(items[0], (uint8_t*)&netif->ip_addr, NETUTILS_BIG);
|
||||||
netutils_parse_ipv4_addr(items[1], (uint8_t*)&netif->netmask, NETUTILS_BIG);
|
netutils_parse_ipv4_addr(items[1], (uint8_t*)&netif->netmask, NETUTILS_BIG);
|
||||||
netutils_parse_ipv4_addr(items[2], (uint8_t*)&netif->gw, NETUTILS_BIG);
|
netutils_parse_ipv4_addr(items[2], (uint8_t*)&netif->gw, NETUTILS_BIG);
|
||||||
|
Loading…
Reference in New Issue
Block a user