Network issue with dhclient

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Network issue with dhclient

Christophe Staïesse
>Synopsis: Network issue with dhclient
>Category: system
>Environment:
        System      : OpenBSD 6.4
        Details     : OpenBSD 6.4 (GENERIC.MP) #1: Mon Nov 26 10:18:14 CET 2018
                         [hidden email]:/usr/src/sys/arch/amd64/compile/GENERIC.MP

        Architecture: OpenBSD.amd64
        Machine     : amd64
>Description:

Hello,

The revision 1.553 of sbin/dhclient/dhclient.c has introduced an issue on my system in that the DHCP client rarely succeed to configure the wifi interface (an Intel Pro 3945ABG/Wireless on a Thinkpad T60 if that matters). Configuring a static IP address or using the previous revision of dhclient works and I have no issue with the wired ethernet interface.

>How-To-Repeat:

Following are the log of dhclient. Note that no packet is actually leaving the interface and it seems to be left in a unusable state as I need to turn it down and up before retrying to configure it.

# ifconfig wpi0 down up && ./dhclient -d wpi0
wpi0: link down -> up
wpi0: no link... got link
wpi0: DHCPREQUEST to 255.255.255.255
wpi0: DHCPREQUEST to 255.255.255.255
wpi0: DHCPDISCOVER - interval 1
wpi0: DHCPDISCOVER - interval 1
wpi0: DHCPDISCOVER - interval 1
wpi0: DHCPDISCOVER - interval 1
wpi0: DHCPDISCOVER - interval 1
wpi0: no lease... sleeping
wpi0: DHCPDISCOVER - interval 2
wpi0: no lease... sleeping
wpi0: DHCPDISCOVER - interval 4
wpi0: no lease... sleeping
wpi0: DHCPDISCOVER - interval 9
wpi0: no lease... sleeping
wpi0: DHCPDISCOVER - interval 10

>Fix:

If I add a delay of a few seconds before the invokation of dhclient, things seems to work again more often than not:
# ifconfig wpi0 down up && sleep 5 && dhclient -d wpi0
wpi0: DHCPREQUEST to 255.255.255.255
wpi0: DHCPACK from 192.168.1.1 (c8:cd:72:33:85:c4)
wpi0: bound to 192.168.1.3 from 192.168.1.1 (c8:cd:72:33:85:c4)
wpi0 [priv]: add route 0.0.0.0/0.0.0.0 via 192.168.1.1: File exists

I've noticed that r1.553 removes the delay of 1s before the S_REBOOTING state. Reintroducing it seems to have solved the issue and works 100% of the time. Tested with stable and current.

Index: dhclient.c
===================================================================
RCS file: /cvs/src/sbin/dhclient/dhclient.c,v
retrieving revision 1.577
diff -u -p -u -r1.577 dhclient.c
--- dhclient.c 22 Sep 2018 09:12:36 -0000 1.577
+++ dhclient.c 13 Dec 2018 13:50:27 -0000
@@ -718,7 +718,7 @@ state_preboot(struct interface_info *ifi
  if ((ifi->flags & IFI_VALID_LLADDR) == 0)
  get_hw_address(ifi);
  ifi->state = S_REBOOTING;
- state_reboot(ifi);
+ set_timeout(ifi, 1, state_reboot);
  } else {
  tick_msg("link", 0, tickstart, tickstop);
  if (cur_time > tickstop) {

# ifconfig wpi0 down up && ./dhclient -d wpi0
wpi0: DHCPREQUEST to 255.255.255.255
wpi0: DHCPACK from 192.168.1.1 (c8:cd:72:33:85:c4)
wpi0: bound to 192.168.1.3 from 192.168.1.1 (c8:cd:72:33:85:c4)
wpi0 [priv]: add route 0.0.0.0/0.0.0.0 via 192.168.1.1: File exists

Greetings,
Christophe.

dmesg:
OpenBSD 6.4 (GENERIC.MP) #1: Mon Nov 26 10:18:14 CET 2018
    [hidden email]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 3203203072 (3054MB)
avail mem = 3096903680 (2953MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xe0010 (68 entries)
bios0: vendor LENOVO version "79ETE7WW (2.27 )" date 03/21/2011
bios0: LENOVO 200742G
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SSDT ECDT TCPA APIC MCFG HPET SLIC BOOT SSDT SSDT SSDT SSDT
acpi0: wakeup devices LID_(S3) SLPB(S3) EXP0(S4) EXP1(S4) EXP2(S4) EXP3(S4) PCI1(S4) USB0(S3) USB1(S3) USB2(S3) USB7(S3) HDEF(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpiec0 at acpi0
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM)2 CPU T7200 @ 2.00GHz, 1995.29 MHz, 06-0f-06
cpu0: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,NXE,LONG,LAHF,PERF,SENSOR,MELTDOWN
cpu0: 4MB 64b/line 16-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 166MHz
cpu0: mwait min=64, max=64, C-substates=0.2.2.2.2, IBE
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM)2 CPU T7200 @ 2.00GHz, 1995.00 MHz, 06-0f-06
cpu1: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,NXE,LONG,LAHF,PERF,SENSOR,MELTDOWN
cpu1: 4MB 64b/line 16-way L2 cache
cpu1: smt 0, core 1, package 0
ioapic0 at mainbus0: apid 1 pa 0xfec00000, version 20, 24 pins, remapped
acpimcfg0 at acpi0
acpimcfg0: addr 0xf0000000, bus 0-63
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 1 (AGP_)
acpiprt2 at acpi0: bus 2 (EXP0)
acpiprt3 at acpi0: bus 3 (EXP1)
acpiprt4 at acpi0: bus 4 (EXP2)
acpiprt5 at acpi0: bus 12 (EXP3)
acpiprt6 at acpi0: bus 21 (PCI1)
acpicpu0 at acpi0: !C3(250@17 mwait.3@0x20), !C2(500@1 mwait.1@0x10), C1(1000@1 mwait.1), PSS
acpicpu1 at acpi0: !C3(250@17 mwait.3@0x20), !C2(500@1 mwait.1@0x10), C1(1000@1 mwait.1), PSS
acpipwrres0 at acpi0: PUBS, resource for USB0, USB2, USB7
acpitz0 at acpi0: critical temperature is 127 degC
acpitz1 at acpi0: critical temperature is 99 degC
acpibtn0 at acpi0: LID_
acpibtn1 at acpi0: SLPB
acpicmos0 at acpi0
"IBM0071" at acpi0 not configured
tpm0 at acpi0: TPM_ addr 0xfed40000/0x1000: Atmel 97SC3203 rev 0x5
acpibat0 at acpi0: BAT0 model "92P1141" serial  2498 type LION oem "SONY"
acpiac0 at acpi0: AC unit online
acpithinkpad0 at acpi0
acpidock0 at acpi0: GDCK not docked (0)
acpivideo0 at acpi0: VID_
acpivout0 at acpivideo0: LCD0
acpivideo1 at acpi0: VID_
acpivout at acpivideo1 not configured
cpu0: Enhanced SpeedStep 1995 MHz: speeds: 2000, 1667, 1333, 1000 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel 82945GM Host" rev 0x03
ppb0 at pci0 dev 1 function 0 "Intel 82945GM PCIE" rev 0x03: msi
pci1 at ppb0 bus 1
radeondrm0 at pci1 dev 0 function 0 "ATI Radeon Mobility X1300 M52-64" rev 0x00
drm0 at radeondrm0
radeondrm0: apic 1 int 16
azalia0 at pci0 dev 27 function 0 "Intel 82801GB HD Audio" rev 0x02: msi
azalia0: codecs: Analog Devices AD1981HD, 0x0000/0x0000, using Analog Devices AD1981HD
audio0 at azalia0
ppb1 at pci0 dev 28 function 0 "Intel 82801GB PCIE" rev 0x02: msi
pci2 at ppb1 bus 2
em0 at pci2 dev 0 function 0 "Intel 82573L" rev 0x00: msi, address 00:15:58:83:7c:a8
ppb2 at pci0 dev 28 function 1 "Intel 82801GB PCIE" rev 0x02: msi
pci3 at ppb2 bus 3
wpi0 at pci3 dev 0 function 0 "Intel PRO/Wireless 3945ABG" rev 0x02: msi, MoW2, address 00:19:d2:b1:f6:37
ppb3 at pci0 dev 28 function 2 "Intel 82801GB PCIE" rev 0x02: msi
pci4 at ppb3 bus 4
ppb4 at pci0 dev 28 function 3 "Intel 82801GB PCIE" rev 0x02: msi
pci5 at ppb4 bus 12
uhci0 at pci0 dev 29 function 0 "Intel 82801GB USB" rev 0x02: apic 1 int 16
uhci1 at pci0 dev 29 function 1 "Intel 82801GB USB" rev 0x02: apic 1 int 17
uhci2 at pci0 dev 29 function 2 "Intel 82801GB USB" rev 0x02: apic 1 int 18
uhci3 at pci0 dev 29 function 3 "Intel 82801GB USB" rev 0x02: apic 1 int 19
ehci0 at pci0 dev 29 function 7 "Intel 82801GB USB" rev 0x02: apic 1 int 19
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 configuration 1 interface 0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb5 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0xe2
pci6 at ppb5 bus 21
cbb0 at pci6 dev 0 function 0 "TI PCI1510 CardBus" rev 0x00: apic 1 int 16
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 22 device 0 cacheline 0x8, lattimer 0xb0
pcmcia0 at cardslot0
pcib0 at pci0 dev 31 function 0 "Intel 82801GBM LPC" rev 0x02
pciide0 at pci0 dev 31 function 1 "Intel 82801GB IDE" rev 0x02: DMA, channel 0 configured to compatibility, channel 1 configured to compatibility
atapiscsi0 at pciide0 channel 0 drive 0
scsibus1 at atapiscsi0: 2 targets
cd0 at scsibus1 targ 0 lun 0: <HL-DT-ST, DVD-ROM GDR8087N, 1.01> ATAPI 5/cdrom removable
cd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2
pciide0: channel 1 ignored (disabled)
ahci0 at pci0 dev 31 function 2 "Intel 82801GBM AHCI" rev 0x02: msi, AHCI 1.1
ahci0: port 0: 1.5Gb/s
scsibus2 at ahci0: 32 targets
sd0 at scsibus2 targ 0 lun 0: <ATA, SAMSUNG MZ7LF128, FXT0> SCSI3 0/direct fixed naa.500253874018af29
sd0: 122104MB, 512 bytes/sector, 250069680 sectors, thin
ichiic0 at pci0 dev 31 function 3 "Intel 82801GB SMBus" rev 0x02: apic 1 int 23
iic0 at ichiic0
usb1 at uhci0: USB revision 1.0
uhub1 at usb1 configuration 1 interface 0 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb2 at uhci1: USB revision 1.0
uhub2 at usb2 configuration 1 interface 0 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci2: USB revision 1.0
uhub3 at usb3 configuration 1 interface 0 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb4 at uhci3: USB revision 1.0
uhub4 at usb4 configuration 1 interface 0 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at pcib0
isadma0 at isa0
com1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
pckbc0 at isa0 port 0x60/5 irq 1 irq 12
pckbd0 at pckbc0 (kbd slot)
wskbd0 at pckbd0: console keyboard
pms0 at pckbc0 (aux slot)
wsmouse0 at pms0 mux 0
wsmouse1 at pms0 mux 0
pms0: Synaptics touchpad, firmware 6.2, 0x81a0b1 0x300000
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
aps0 at isa0 port 0x1600/31
vmm0 at mainbus0: VMX (using slow L1TF mitigation)
vscsi0 at root
scsibus3 at vscsi0: 256 targets
softraid0 at root
scsibus4 at softraid0: 256 targets
root on sd0a (ae5ab57f27787252.a) swap on sd0b dump on sd0b
initializing kernel modesetting (RV515 0x1002:0x7149 0x17AA:0x2005).
radeondrm0: 1024x768, 32bpp
wsdisplay0 at radeondrm0 mux 1: console (std, vt100 emulation), using wskbd0
wsdisplay0: screen 1-5 added (std, vt100 emulation)

usbdevs:
Controller /dev/usb0:
addr 01: 8086:0000 Intel, EHCI root hub
         high speed, self powered, config 1, rev 1.00
         driver: uhub0
Controller /dev/usb1:
addr 01: 8086:0000 Intel, UHCI root hub
         full speed, self powered, config 1, rev 1.00
         driver: uhub1
Controller /dev/usb2:
addr 01: 8086:0000 Intel, UHCI root hub
         full speed, self powered, config 1, rev 1.00
         driver: uhub2
Controller /dev/usb3:
addr 01: 8086:0000 Intel, UHCI root hub
         full speed, self powered, config 1, rev 1.00
         driver: uhub3
Controller /dev/usb4:
addr 01: 8086:0000 Intel, UHCI root hub
         full speed, self powered, config 1, rev 1.00
         driver: uhub4