Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change unicast connection of DHCPv4 client as a raw socket #458

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yaocw2020
Copy link
Contributor

If the network manager in the operating system uses DHCP to obtain an IP
for the network card, it will occupy the DHCP client port. In this case
the release function will fail because the unicast connection with UDP
socket need the same port. Use a raw udp socket instead of a datagram
udp socket to solve it.

Signed-off-by: yaocw2020 [email protected]

@codecov
Copy link

codecov bot commented Jan 21, 2022

Codecov Report

Merging #458 (28832bb) into master (3c283ff) will decrease coverage by 0.34%.
The diff coverage is 14.28%.

@@            Coverage Diff             @@
##           master     #458      +/-   ##
==========================================
- Coverage   67.42%   67.08%   -0.35%     
==========================================
  Files          90       90              
  Lines        3758     3795      +37     
==========================================
+ Hits         2534     2546      +12     
- Misses       1053     1076      +23     
- Partials      171      173       +2     
Flag Coverage Δ
integtests ?
unittests 67.08% <14.28%> (-0.35%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
dhcpv4/nclient4/client.go 59.59% <0.00%> (+1.18%) ⬆️
dhcpv4/nclient4/conn_unix.go 39.75% <15.15%> (-15.15%) ⬇️
dhcpv6/ztpv6/parse_vendor_options.go 89.74% <0.00%> (-3.59%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3c283ff...28832bb. Read the comment docs.

@yaocw2020 yaocw2020 force-pushed the unicast branch 9 times, most recently from 636fc63 to 2386756 Compare January 23, 2022 16:36
@yaocw2020
Copy link
Contributor Author

yaocw2020 commented Jan 23, 2022

@insomniacslk @pmazzini @hugelgupf Could you help review this pr? Moreover, are the unit tests mandatory? It seems hard to add the unit tests for the arp request in this testing environment.

If the network manager in the operating system uses DHCP to obtain an IP
for the network card, it will occupy the DHCP client port. In this case
the release function will fail because the unicast connection with UDP
socket needs the same port. Use a raw udp socket instead of a datagram
udp socket to solve it.

Signed-off-by: yaocw2020 <[email protected]>
@yaocw2020
Copy link
Contributor Author

@insomniacslk @pmazzini @hugelgupf Could you help review this pr? By the way, there is something abnormal about the integration-tests(dhcpv6)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant