Skip to content

Conversation

@johnandersen777
Copy link

DHCP requests are asking for DNS servers but then doing nothing with them. This patch updates DNS to accept BOUND as a valid state. It also modifies the DHCP client to create a new DNS context when the DHCP client gets the DNS server option back in a packet.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very mad...
was this for debugging?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nashif you move faster than I can Type WIP :)

@johnandersen777 johnandersen777 changed the title net: dhcp: dns: Bound is now a vaild state WIP: net: dhcp: dns: Bound is now a vaild state Sep 5, 2017
@johnandersen777
Copy link
Author

Note to self I might need to rebase onto #1341.

Copy link
Member

@jukkar jukkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to refactor the commits but I suppose that was planned because of the "WIP" tag in subject.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to enable IPv6 in DHCPv4 client sample?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not enable the debugs in default prj.conf file. If you need debugging prints, create a conf file just for this purpose and use that in your testing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use NET_IPV4_ADDR_LEN here, then you can also remove max_ipv4_addr_len variable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use sizeof(dns_string) as a length, this way we can get rid of extra variable

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here length should be min(strlen(net_sprint_ipv4_addr(&dns), sizeof(dns_string))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No // comments

@johnandersen777
Copy link
Author

As @jukkar found I had lot's of random debugging in there to help me feel out the codebase. I'm still working on this I want it to be perfect before I remove the WIP. I just like to leave any WIP stuff in a PR so others can see it's being worked on so they don't duplicate effort 👍

@pfalcon
Copy link
Contributor

pfalcon commented Sep 8, 2017

I just like to leave any WIP stuff in a PR so others can see it's being worked on so they don't duplicate effort

+1 for that (in reasonable bounds), but naming PRs is still important (a common problem in this project actually). For example, "net: dhcp: dns: Bound is now a vaild state" doesn't tell me much.

@johnandersen777 johnandersen777 changed the title WIP: net: dhcp: dns: Bound is now a vaild state WIP: net: DHCP use the DNS servers option we request Sep 8, 2017
Signed-off-by: John Andersen <[email protected]>
@jukkar
Copy link
Member

jukkar commented Oct 8, 2017

Hi @pdxjohnny any progress on this one, are you able to re-submit the PR?

nagineni pushed a commit to nagineni/zephyr that referenced this pull request Nov 20, 2017
…oject-rtos#1424)

The callstack of 2k is causing segfault in BLE stack,
for example, when it starts physical web advertising,
or the Websocket over 6lowpan, increasing
it to 4k fixes the segfault.

Fixes zephyrproject-rtos#1369 zephyrproject-rtos#1421

Signed-off-by: Jimmy Huang <[email protected]>
@pfalcon
Copy link
Contributor

pfalcon commented Jan 16, 2018

@pdxjohnny : Ping, hit this again in real life. Let me know if you'd like me to pick this up and polish for submission.


NET_DBG("options_dns: %s", dns_servers[0]);

// TODO Change this to its own context
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re: this TODO. I guess, for initial version of this feature it's not required.

}

memset(dns_string, 0, sizeof(dns_string));
memcpy(dns_string, net_sprint_ipv4_addr(&dns),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this is what I don't like. Convert binary address to string, just for it to be converted back? Nope, we should allow to init resolver with struct in_addr.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This definitely won't do, because net_sprint_ipv4_addr() is debugging func, available only when logging is enabled.

@pdxjohnny : I'm in the process of refactoring this patch already.

@pfalcon
Copy link
Contributor

pfalcon commented Jan 17, 2018

@pdxjohnny : So, I took your patch as a base, added missing parts, refactored and submitted as #5711. I kept your git authorship (but the patch is of course updated) and added my sign-off. Let me know if you have any concerns.

Otherwise, I'm closing this patch as superseded. Thanks.

@pfalcon pfalcon closed this Jan 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants