Skip to content

net: Bind IP and get IP via DHCP: is the altered behavior intended or not? #71600

Answered by jukkar
Aluleichtbau asked this question in General
Discussion options

You must be logged in to vote
  • When not binding the IP is not set. So the check is not done.
    -------> SOLUTION: instead of passing CONFIG_NET_CONFIG_MY_IPV4_ADDR:54321 to bind the port only just pass 0.0.0.0:54321

This is the culprit, when binding, you need to decide whether to bind to any address or to one specific address. If the IP address changes, and you are binding to specific address, then the packets cannot be delivered to proper socket.
So depending on use case, you should usually always bind using any address (INADDR_ANY) instead of a specific IP address.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Aluleichtbau
Comment options

@jukkar
Comment options

Answer selected by Aluleichtbau
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants