Use LittleEndian for correct byte order on DNS IPs

Nameserver IP 10.11.12.13 would otherwise get written to resolv.conf as 13.12.11.10, as was happening on my client.

Signed-off-by: Eduardo Kienetz <eduardo@kienetz.com>
This commit is contained in:
Eduardo Kienetz 2020-07-17 23:58:47 -04:00 committed by Dave Anderson
parent 52969bdfb0
commit 5df6be9d38

View File

@ -143,7 +143,7 @@ func dnsNetworkManagerUp(config DNSConfig, interfaceName string) error {
for _, ip := range config.Nameservers {
b := ip.As16()
if ip.Is4() {
dnsv4 = append(dnsv4, binary.BigEndian.Uint32(b[12:]))
dnsv4 = append(dnsv4, binary.LittleEndian.Uint32(b[12:]))
} else {
dnsv6 = append(dnsv6, b[:])
}