Project

General

Profile

Actions

Bug #13966

closed

strong IP hostmodel breaks DHCP

Added by Jason King 4 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
kernel
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

When the ipv4 hostmodel property is set to strong (see ipadm(1M)), while the initial DHCP lease succeeds, if the link flaps for any reason, dhcpagent is unable to send any subsequent requests. With the dhcpagent logging set to debug, you see:

2021-07-22T21:32:31.000000+00:00 localhost-empty-hostname /sbin/dhcpagent[127]: [ID 490758 daemon.error] send_pkt_internal: cannot send REQUEST packet to server (will retry in 4 seconds): Network is unreachable

repeated (with increasing backoff intervals).

The most immediate affect of this is that the default gateway is never re-added after the link is restored. Doing a little investigation with truss(1), the relevant sequence appears to be:

so_socket(PF_INET, SOCK_DGRAM, IPPROTO_IP, 0x00000000, SOV_XPG4_2) = 4
setsockopt(4, SOL_SOCKET, SO_REUSEADDR, 0x08047438, 4, SOV_DEFAULT) = 0
bind(4, 0x0804743C, 16, SOV_XPG4_2)             = 0
        AF_INET  name = 0.0.0.0  port = 68
setsockopt(4, ip, 66, 0x0804748C, 4, SOV_DEFAULT) = 0
setsockopt(4, ip, 69, 0x0807E2C4, 4, SOV_DEFAULT) = 0
setsockopt(4, ip, 67, 0x0804748B, 1, SOV_DEFAULT) = 0
setsockopt(4, ip, 65, 0x08047490, 4, SOV_DEFAULT) = 0
ioctl(0, SIOCGLIFFLAGS, 0x08047494)             = 0
stat("/etc/default/dhcpagent", 0x08046DD4)      = 0
fstat(6, 0x08046454)                            = 0
time()                                          = 1626989551
getpid()                                        = 127 [1]
putmsg(6, 0x080464F8, 0x08046504, 0)            = 0
fstat(6, 0x08046454)                            = 0
putmsg(6, 0x080464F8, 0x08046504, 0)            = 0
fstat(6, 0x08046454)                            = 0
time()                                          = 1626989551
getpid()                                        = 127 [1]
putmsg(6, 0x080464F8, 0x08046504, 0)            = 0
stat("/etc/default/dhcpagent", 0x08046F44)      = 0
fstat(6, 0x080465C4)                            = 0
time()                                          = 1626989551
getpid()                                        = 127 [1]
putmsg(6, 0x08046668, 0x08046674, 0)            = 0
open("/etc/hostname.admin0", O_RDONLY)          Err#2 ENOENT
fstat(6, 0x080465C4)                            = 0
time()                                          = 1626989551
getpid()                                        = 127 [1]
putmsg(6, 0x08046668, 0x08046674, 0)            = 0
fstat(6, 0x080468A4)                            = 0
time()                                          = 1626989551
getpid()                                        = 127 [1]
putmsg(6, 0x08046948, 0x08046954, 0)            = 0
sendto(4, "010106\01D03 ~ A\080\0\0".., 300, 32768, 0x0807E668, 16) Err#128 ENETUNREACH
        AF_INET  to = 255.255.255.255  port = 67

Performing ipadm disable-addr -t addrobj; ipadm enable-addr -t addrobj seems to unstick things, but obviously isn't useful unless one has console access to the server.


Files

test.c (1.99 KB) test.c Jason King, 2021-07-26 05:01 PM
Actions

Also available in: Atom PDF