Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
e28cf8d9
Commit
e28cf8d9
authored
Sep 01, 2020
by
vsky
Committed by
Marcel Stör
Sep 04, 2020
Browse files
Fixes `net.ifinfo` failure
parent
e7620b06
Changes
1
Show whitespace changes
Inline
Side-by-side
app/modules/net.c
View file @
e28cf8d9
...
@@ -983,6 +983,9 @@ field_from_ipaddr(lua_State *L, const char * field_name, ip_addr_t* addr) {
...
@@ -983,6 +983,9 @@ field_from_ipaddr(lua_State *L, const char * field_name, ip_addr_t* addr) {
static
int
net_ifinfo
(
lua_State
*
L
)
{
static
int
net_ifinfo
(
lua_State
*
L
)
{
int
ifidx
=
luaL_optint
(
L
,
1
,
0
);
int
ifidx
=
luaL_optint
(
L
,
1
,
0
);
if
(
ifidx
!=
0
&&
ifidx
!=
1
)
{
return
0
;
}
struct
netif
*
nif
=
eagle_lwip_getif
(
ifidx
);
struct
netif
*
nif
=
eagle_lwip_getif
(
ifidx
);
if
(
nif
==
NULL
)
{
if
(
nif
==
NULL
)
{
...
@@ -1004,8 +1007,8 @@ static int net_ifinfo( lua_State* L ) {
...
@@ -1004,8 +1007,8 @@ static int net_ifinfo( lua_State* L ) {
field_from_ipaddr
(
L
,
"server_ip"
,
&
nif
->
dhcp
->
server_ip_addr
);
field_from_ipaddr
(
L
,
"server_ip"
,
&
nif
->
dhcp
->
server_ip_addr
);
field_from_ipaddr
(
L
,
"client_ip"
,
&
nif
->
dhcp
->
offered_ip_addr
);
field_from_ipaddr
(
L
,
"client_ip"
,
&
nif
->
dhcp
->
offered_ip_addr
);
field_from_ipaddr
(
L
,
"ntp_server"
,
&
nif
->
dhcp
->
offered_ntp_addr
);
field_from_ipaddr
(
L
,
"ntp_server"
,
&
nif
->
dhcp
->
offered_ntp_addr
);
}
lua_setfield
(
L
,
-
2
,
"dhcp"
);
lua_setfield
(
L
,
-
2
,
"dhcp"
);
}
return
1
;
return
1
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment