Files
systemd-stable/src
Paul Martin 804319344b networkd DHCPv4 logging endian fix
On Tue, Feb 10, 2015 at 08:10:43PM +0100, Lennart Poettering wrote:

> Hmm, I think it would be nicer to use be32toh() here instead, since it
> ensures the macro is (to a limited degree) typesafe.
>
> Any chance you could rework that?

From: Paul Martin <paul.martin@codethink.co.uk>
Date: Wed, 11 Feb 2015 11:47:16 +0000
Subject: [PATCH] networkd dhcpv4 logging endian fix

On a big-endian host, systemd-networkd prints out IPv4 network
addresses byte reversed:

Feb 10 16:43:32 hostname systemd-networkd[151]: eth0 : DHCPv4 address 158.1.24.10/16 via 1.1.24.10

The address obtained is 10.24.1.158/16 and the route is

  10.24.0.0/16 dev eth0  src 10.24.1.187

The macro ADDRESS_FMT_VAL() unpacks a "struct in_addr" in a
little-endian specific manner.

This patch forces the passed address into host order, then unpacks it.

On an x86 later than i486, compiled with -O2, the only extra overhead
is a single bswap instruction.
2015-02-11 12:57:17 +01:00
..
2014-08-03 21:46:07 -04:00
2015-01-23 09:30:44 -05:00
2015-02-05 16:52:42 +01:00
2014-08-03 21:46:07 -04:00
2014-06-21 16:25:15 +02:00
2015-01-22 01:14:52 -05:00
2015-02-05 12:04:19 +01:00
2014-08-03 21:46:07 -04:00
2014-09-19 00:15:39 +02:00
2015-02-10 12:34:11 +01:00
2014-12-09 21:36:08 -05:00