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>
pull/572/head
Eduardo Kienetz 4 years ago committed by Dave Anderson
parent 52969bdfb0
commit 5df6be9d38

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

Loading…
Cancel
Save