How to change network interface parameters after calling mg_tcpip_init? #2606
Answered
by
scaprile
pseudotronics
asked this question in
Ask questions, get answers
-
What's the proper procedure for changing the network interface parameters after calling mg_tcpip_init? |
Beta Was this translation helpful? Give feedback.
Answered by
scaprile
Feb 12, 2024
Replies: 1 comment 3 replies
-
Can you please be more specific ? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The stack would reconfigure when link goes down and up. So, if you change IP or go static <-> DHCP, you should force that. You should also close all open connections.
The fallback case... Our DHCP client will keep on trying as long as it is configured for DHCP and link is up (
ifp->state == MG_TCPIP_STATE_UP
). You could probably get away with reconfiguring and settingifp->state = MG_TCPIP_STATE_READY
. However, I suggest you reset the interface forcing a link down.Regarding how to force a link down/up...
mongoose/src/net_builtin.c
Lines 849 to 861 in c8d45c9