Skip to content

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

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

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

Attention: Patch coverage is 14.28571% with 30 lines in your changes missing coverage. Please review.

Project coverage is 67.08%. Comparing base (3c283ff) to head (28832bb).
Report is 178 commits behind head on master.

Files with missing lines Patch % Lines
dhcpv4/nclient4/conn_unix.go 15.15% 27 Missing and 1 partial ⚠️
dhcpv4/nclient4/client.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            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.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@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