dhcp icon indicating copy to clipboard operation
dhcp copied to clipboard

Change unicast connection of DHCPv4 client as a raw socket

Open yaocw2020 opened this issue 3 years ago • 3 comments

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]

yaocw2020 avatar Jan 21 '22 17:01 yaocw2020

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%) :arrow_down:

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%) :arrow_up:
dhcpv4/nclient4/conn_unix.go 39.75% <15.15%> (-15.15%) :arrow_down:
dhcpv6/ztpv6/parse_vendor_options.go 89.74% <0.00%> (-3.59%) :arrow_down:

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.

codecov[bot] avatar Jan 21 '22 17:01 codecov[bot]

@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.

yaocw2020 avatar Jan 23 '22 16:01 yaocw2020

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

yaocw2020 avatar Apr 13 '22 08:04 yaocw2020