Merge branch 'master' into 4686-ipset-file

This commit is contained in:
Ainar Garipov 2022-09-12 16:03:11 +03:00
commit 451fd7c445
2 changed files with 6 additions and 16 deletions

View File

@ -15,12 +15,18 @@ and this project adheres to
## [v0.108.0] - 2022-12-01 (APPROX.)
-->
### Changed
- The minimum DHCP message size is reassigned back to BOOTP's constraint of 300
bytes ([#4904]).
### Security
- Weaker cipher suites that use the CBC (cipher block chaining) mode of
operation have been disabled ([#2993]).
[#2993]: https://github.com/AdguardTeam/AdGuardHome/issues/2993
[#4904]: https://github.com/AdguardTeam/AdGuardHome/issues/4904

View File

@ -1086,12 +1086,6 @@ func (s *v4Server) packetHandler(conn net.PacketConn, peer net.Addr, req *dhcpv4
s.send(peer, conn, req, resp)
}
// minDHCPMsgSize is the minimum length of the encoded DHCP message in bytes
// according to RFC-2131.
//
// See https://datatracker.ietf.org/doc/html/rfc2131#section-2.
const minDHCPMsgSize = 576
// send writes resp for peer to conn considering the req's parameters according
// to RFC-2131.
//
@ -1133,16 +1127,6 @@ func (s *v4Server) send(peer net.Addr, conn net.PacketConn, req, resp *dhcpv4.DH
}
pktData := resp.ToBytes()
pktLen := len(pktData)
if pktLen < minDHCPMsgSize {
// Expand the packet to match the minimum DHCP message length. Although
// the dhpcv4 package deals with the BOOTP's lower packet length
// constraint, it seems some clients expecting the length being at least
// 576 bytes as per RFC 2131 (and an obsolete RFC 1533).
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/4337.
pktData = append(pktData, make([]byte, minDHCPMsgSize-pktLen)...)
}
log.Debug("dhcpv4: sending %d bytes to %s: %s", len(pktData), peer, resp.Summary())