Internal DHCP client fails to establish a connection when the netmask is missing
In gnome-network-displays (WiFi-Direct/P2P WiFi) we have found a case of a TV with a broken DHCP server. It'll send a netmask in the DHCP offer, but then fails to send it again in the DHCP ACK.
This appears to work fine with dhclient, which apparently falls back to a default netmask if none is given.
In this case, it doesn't really matter what we do. All we need is being able to establish connections to the IP address of the DHCP server. It would be good if at least that would somehow work.
See https://gitlab.gnome.org/GNOME/gnome-network-displays/-/issues/247#note_1480782 for the original bug report and discussion.
DHCP Offer:
Frame 7: 316 bytes on wire (2528 bits), 316 bytes captured (2528 bits)
Ethernet II, Src: c2:48:e6:ae:c0:10 (c2:48:e6:ae:c0:10), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol Version 4, Src: 192.168.49.1, Dst: 255.255.255.255
User Datagram Protocol, Src Port: 67, Dst Port: 68
Dynamic Host Configuration Protocol (Offer)
Message type: Boot Reply (2)
Hardware type: Ethernet (0x01)
Hardware address length: 6
Hops: 0
Transaction ID: 0xd300f990
Seconds elapsed: 0
Bootp flags: 0x0000 (Unicast)
Client IP address: 0.0.0.0
Your (client) IP address: 192.168.49.20
Next server IP address: 192.168.49.1
Relay agent IP address: 0.0.0.0
Client MAC address: IntelCor_15:00:b4 (9c:29:76:15:00:b4)
Client hardware address padding: 00000000000000000000
Server host name not given
Boot file name not given
Magic cookie: DHCP
Option: (53) DHCP Message Type (Offer)
Option: (54) DHCP Server Identifier (192.168.49.1)
Option: (51) IP Address Lease Time
Option: (1) Subnet Mask (255.255.255.0)
Option: (28) Broadcast Address (192.168.49.255)
Option: (3) Router
Option: (255) End
DHCP Request:
Frame 8: 330 bytes on wire (2640 bits), 330 bytes captured (2640 bits)
Ethernet II, Src: IntelCor_15:00:b4 (9c:29:76:15:00:b4), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol Version 4, Src: 0.0.0.0, Dst: 255.255.255.255
User Datagram Protocol, Src Port: 68, Dst Port: 67
Dynamic Host Configuration Protocol (Request)
Message type: Boot Request (1)
Hardware type: Ethernet (0x01)
Hardware address length: 6
Hops: 0
Transaction ID: 0xd300f990
Seconds elapsed: 1
Bootp flags: 0x0000 (Unicast)
Client IP address: 0.0.0.0
Your (client) IP address: 0.0.0.0
Next server IP address: 0.0.0.0
Relay agent IP address: 0.0.0.0
Client MAC address: IntelCor_15:00:b4 (9c:29:76:15:00:b4)
Client hardware address padding: 00000000000000000000
Server host name not given
Boot file name not given
Magic cookie: DHCP
Option: (53) DHCP Message Type (Request)
Option: (61) Client identifier
Option: (55) Parameter Request List
Option: (57) Maximum DHCP Message Size
Option: (50) Requested IP Address (192.168.49.20)
Option: (54) DHCP Server Identifier (192.168.49.1)
Option: (255) End
DHCP ACK:
Frame 9: 298 bytes on wire (2384 bits), 298 bytes captured (2384 bits)
Ethernet II, Src: c2:48:e6:ae:c0:10 (c2:48:e6:ae:c0:10), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol Version 4, Src: 192.168.49.1, Dst: 255.255.255.255
User Datagram Protocol, Src Port: 67, Dst Port: 68
Dynamic Host Configuration Protocol (ACK)
Message type: Boot Reply (2)
Hardware type: Ethernet (0x01)
Hardware address length: 6
Hops: 0
Transaction ID: 0xd300f990
Seconds elapsed: 0
Bootp flags: 0x0000 (Unicast)
Client IP address: 0.0.0.0
Your (client) IP address: 192.168.49.20
Next server IP address: 192.168.49.1
Relay agent IP address: 0.0.0.0
Client MAC address: IntelCor_15:00:b4 (9c:29:76:15:00:b4)
Client hardware address padding: 00000000000000000000
Server host name not given
Boot file name not given
Magic cookie: DHCP
Option: (53) DHCP Message Type (ACK)
Option: (54) DHCP Server Identifier (192.168.49.1)
Option: (51) IP Address Lease Time
Option: (255) End