#916467 ifupdown: settle-dad.sh fails when interface is unplugged

Package:
ifupdown
Source:
ifupdown
Description:
high level tools to configure network interfaces
Submitter:
Ghasem Naddaf
Date:
2019-10-13 08:57:10 UTC
Severity:
normal
#916467#5
Date:
2018-12-14 19:16:50 UTC
From:
To:
* Steps to reproduce:
1. Configure interface with a static ipv6 address

# cat /etc/network/interfaces.d/eth1
auto eth1
iface eth1 inet static
   10.2.3.4
   netmask 255.255.255.0
iface eth1 inet6 static
   address fd60:d925:aaaa::bbbb
   netmask 64

2. Restart networking service. Note that the address is assigned:

# systemctl restart networking
# ip -6 addr show dev eth1
    inet6 fd60:d925:aaaa::bbbb/64 scope global
       valid_lft forever preferred_lft forever

3. Now unplug interface and restart networking service

* Expected Results:
- Networking service restarts successfully

* Actual results
- Networking service goes to failed state

* Cause
I think this line of code
https://salsa.debian.org/debian/ifupdown/blob/master/inet6.defn#L98
causes ifup to fail if the interface is unplugged. In particular after unplug and restart, my ipv6 address
is added as "tentative" and settle-dad.sh does not like it:
# ip -6 addr show dev eth1
    inet6 fd60:d925:aaaa::bbbb/64 scope global tentative
       valid_lft forever preferred_lft forever

* Workaround:
Put "dad-attempts 0" in the ipv6 stanza with static address.

However, I would like to have the DAD capacbility.

Would it be possible to set dad-attempts condionally
i.e. add `nodad` also if the interface is unplugged https://salsa.debian.org/debian/ifupdown/blob/master/inet6.defn#L95 ?
--- up and down scripts installed:
/etc/network/if-down.d:
total 4
-rwxr-xr-x 1 root root 332 Jun  2  2015 upstart
lrwxrwxrwx 1 root root  32 Aug  9 00:23 wpasupplicant -> ../../wpa_supplicant/ifupdown.sh

/etc/network/if-post-down.d:
total 0
lrwxrwxrwx 1 root root 23 Jan 23  2017 avahi-daemon -> ../if-up.d/avahi-daemon
lrwxrwxrwx 1 root root 32 Aug  9 00:23 wpasupplicant -> ../../wpa_supplicant/ifupdown.sh

/etc/network/if-pre-up.d:
total 0
lrwxrwxrwx 1 root root 32 Aug  9 00:23 wpasupplicant -> ../../wpa_supplicant/ifupdown.sh

/etc/network/if-up.d:
total 12
-rwxr-xr-x 1 root root  484 Jan 23  2017 avahi-daemon
-rwxr-xr-x 1 root root  972 Mar  1  2018 openssh-server
-rwxr-xr-x 1 root root 1483 Jun  2  2015 upstart
lrwxrwxrwx 1 root root   32 Aug  9 00:23 wpasupplicant -> ../../wpa_supplicant/ifupdown.sh

#916467#10
Date:
2019-10-13 08:51:33 UTC
From:
To:
I suspect this issue affects bridged interfaces as well. Watching the
boot process, I can see the DAD attempt being sent before any interfaces
have transitioned to Forwarding state.  I don't see how this is any use
because no neighbours would ever see the ND packets!