Page MenuHomeFreeBSD

D56927.diff
No OneTemporary

D56927.diff

diff --git a/sbin/devd/Makefile b/sbin/devd/Makefile
--- a/sbin/devd/Makefile
+++ b/sbin/devd/Makefile
@@ -17,10 +17,9 @@
AUTOFSPACKAGE= autofs
.endif
-CONFGROUPS+= DHCLIENT
-DHCLIENTDIR= ${DEVDDIR}
-DHCLIENT+= dhclient.conf
-DHCLIENTPACKAGE= dhclient
+.if ${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no"
+DEVD+= auto-ip-addr.conf
+.endif
.if ${MACHINE} == "i386" || ${MACHINE} == "amd64" || \
${MACHINE} == "arm64"
diff --git a/sbin/devd/auto-ip-addr.conf b/sbin/devd/auto-ip-addr.conf
new file mode 100644
--- /dev/null
+++ b/sbin/devd/auto-ip-addr.conf
@@ -0,0 +1,25 @@
+#
+# Try to start dhclient on Ethernet-like interfaces when the link comes
+# up. Only devices that are configured to support DHCP will actually
+# run it. No link down rule exists because dhclient automatically exits
+# when the link goes down.
+# Also run rtsol on Ethernet-like interfaces to emit Router Solicitation
+# messages. This helps expedite IPv6 autoconfiguration when the link
+# comes up.
+#
+
+notify 0 {
+ match "system" "IFNET";
+ match "type" "LINK_UP";
+ media-type "ethernet";
+ action "[ -x /sbin/dhclient ] && service dhclient quietstart $subsystem";
+ action "[ -x /sbin/rtsol ] && ifconfig $subsystem | grep -q 'ACCEPT_RTADV' && rtsol -i $subsystem";
+};
+
+notify 0 {
+ match "system" "IFNET";
+ match "type" "LINK_UP";
+ media-type "802.11";
+ action "[ -x /sbin/dhclient ] && service dhclient quietstart $subsystem";
+ action "[ -x /sbin/rtsol ] && ifconfig $subsystem | grep -q 'ACCEPT_RTADV' && rtsol -i $subsystem";
+};
diff --git a/sbin/devd/dhclient.conf b/sbin/devd/dhclient.conf
deleted file mode 100644
--- a/sbin/devd/dhclient.conf
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Try to start dhclient on Ethernet-like interfaces when the link comes
-# up. Only devices that are configured to support DHCP will actually
-# run it. No link down rule exists because dhclient automatically exits
-# when the link goes down.
-#
-notify 0 {
- match "system" "IFNET";
- match "type" "LINK_UP";
- media-type "ethernet";
- action "service dhclient quietstart $subsystem";
-};
-
-notify 0 {
- match "system" "IFNET";
- match "type" "LINK_UP";
- media-type "802.11";
- action "service dhclient quietstart $subsystem";
-};

File Metadata

Mime Type
text/plain
Expires
Wed, May 20, 9:47 PM (11 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33358183
Default Alt Text
D56927.diff (2 KB)

Event Timeline