Bug 559147

Summary: dhclient did not send a Decline msg when find address already used on the link
Product: [Fedora] Fedora Reporter: Yang Ren <ryang>
Component: dhcpAssignee: Jiri Popelka <jpopelka>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: herbert.xu, jpopelka, llim
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: dhcp-4.1.1-13.fc12 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 559403 (view as bug list) Environment:
Last Closed: 2010-04-22 22:34:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 559403    

Comment 1 Jiri Popelka 2010-02-15 16:22:07 UTC
I tried to ask upstream (dhcp-workers mailing list)
https://lists.isc.org/pipermail/dhcp-workers/2010-February/000108.html
but no answer.

Comment 2 Herbert Xu 2010-03-13 11:14:36 UTC
DAD is performed by the kernel.  So you'll need to query the kernel to figure out what is going on.  I have sent a patch to make the kernel send a notification when DAD fails.  The kernel will also send a notification when DAD succeeds.

So you could either listen to those notifications, or just poll the kernel at set intervals.

Comment 3 Yang Ren 2010-03-18 07:12:21 UTC
kernel already passed the test:
Section 3: RFC 4862 - IPv6 Stateless Address Autoconfiguration
That means kernel can deal with DAD correctly.

SO the problem should be how our dhclient discover address duplicate on the link. It's easy to send the Declient msg. But if only client know address duplicate. client will not do it.

Comment 4 Herbert Xu 2010-03-18 07:38:29 UTC
The idea is to get the dhclient shell script to either wait for a notification from the kernel, at which point it can send a decline message if the kernel DAD had failed, or for it to poll the kernel at set intervals to determine whether DAD succeeded or failed.

Comment 5 Jiri Popelka 2010-03-23 17:33:56 UTC
(In reply to comment #4)
> The idea is to get the dhclient shell script to either wait for a notification
> from the kernel, at which point it can send a decline message if the kernel DAD
> had failed, or for it to poll the kernel at set intervals to determine whether
> DAD succeeded or failed.    

Hi Herbert,
thanks for your advices.
I found that 'ip addr show' shows 'tentative' flag in address info when DAD is still not complete or failed. So I use this code in dhclient-script to check whether the address passed DAD:

ip -f inet6 addr add ${new_ip6_address}/${new_ip6_prefixlen} \
                     dev ${interface} scope global

# repeatedly test whether newly added address passed
# duplicate address detection (DAD)
for i in $(seq 5); do
  sleep 1 # give the DAD some time

  # tentative flag = DAD is still not complete or failed
  duplicate=$(ip -6 addr show dev ${interface} tentative \
             | grep ${new_ip6_address}/${new_ip6_prefixlen})

  # if there's no tentative flag, address passed DAD
  if [ -z "${duplicate}" ]; then
    break
  fi
done

# if there's still tentative flag = address didn't pass DAD = it's duplicate = remove it and exit with error
if [ -n "${duplicate}" ]; then
  ip -6 addr del ${new_ip6_address}/${new_ip6_prefixlen} dev ${interface}
  exit_with_hooks 3
fi

Comment 6 Fedora Update System 2010-03-24 11:20:40 UTC
dhcp-4.1.1-14.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/dhcp-4.1.1-14.fc13

Comment 7 Fedora Update System 2010-03-24 11:22:47 UTC
dhcp-4.1.1-12.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/dhcp-4.1.1-12.fc12

Comment 8 Fedora Update System 2010-03-24 23:29:27 UTC
dhcp-4.1.1-12.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update dhcp'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/dhcp-4.1.1-12.fc12

Comment 9 Yang Ren 2010-03-26 05:15:51 UTC
Verified in dhcp-4.1.1-12.fc12

Comment 10 Fedora Update System 2010-03-27 01:01:35 UTC
dhcp-4.1.1-13.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update dhcp'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/dhcp-4.1.1-13.fc12

Comment 11 Fedora Update System 2010-04-21 21:51:41 UTC
dhcp-4.1.1-15.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2010-04-22 22:33:59 UTC
dhcp-4.1.1-13.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.