Systemd/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
..
ac-power treewide: no need to negate errno for log_*_errno() 2014-11-28 13:29:21 +01:00
activate treewide: another round of simplifications 2014-11-28 19:57:32 +01:00
analyze notify,firstboot,analyze,run: trim --help output to 80 lines 2015-01-27 21:48:12 -05:00
ask-password ask-password: Add --echo to enable echoing the user input 2014-10-05 15:29:41 -04:00
backlight backlight: let udev properties override clamping 2015-02-02 17:18:40 +01:00
binfmt treewide: use log_*_errno whenever %m is in the format string 2014-11-28 19:49:27 +01:00
boot Unify parse_argv style 2014-08-03 21:46:07 -04:00
bootchart bootchart: Ensure that systemd is the init called after using bootchart 2015-02-02 17:40:35 +01:00
bus-proxyd bus-proxyd: initialize ioctl structure only once 2015-02-10 20:46:09 +01:00
cgls util: rework strappenda(), and rename it strjoina() 2015-02-03 02:05:59 +01:00
cgroups-agent treewide: no need to negate errno for log_*_errno() 2014-11-28 13:29:21 +01:00
cgtop treewide: no need to negate errno for log_*_errno() 2014-11-28 13:29:21 +01:00
compat-libs #pragma once here and there 2015-01-23 09:30:44 -05:00
console Move DEFINE_TRIVIAL_CLEANUP_FUNC to macro.h 2015-01-18 19:06:48 -05:00
core bus: sync with kdbus (ABI break) 2015-02-05 16:52:42 +01:00
cryptsetup util: rework strappenda(), and rename it strjoina() 2015-02-03 02:05:59 +01:00
dbus1-generator util: rework strappenda(), and rename it strjoina() 2015-02-03 02:05:59 +01:00
debug-generator treewide: use log_*_errno whenever %m is in the format string 2014-11-28 19:49:27 +01:00
delta delta: fix output alignment of [REDIRECTED] entries 2014-12-14 12:54:17 -05:00
detect-virt treewide: no need to negate errno for log_*_errno() 2014-11-28 13:29:21 +01:00
efi-boot-generator util: rework strappenda(), and rename it strjoina() 2015-02-03 02:05:59 +01:00
escape Unify parse_argv style 2014-08-03 21:46:07 -04:00
firstboot util: rework strappenda(), and rename it strjoina() 2015-02-03 02:05:59 +01:00
fsck Add a snprinf wrapper which checks that the buffer was big enough 2015-02-01 17:21:39 -05:00
fstab-generator util: rework strappenda(), and rename it strjoina() 2015-02-03 02:05:59 +01:00
getty-generator util: rework strappenda(), and rename it strjoina() 2015-02-03 02:05:59 +01:00
gpt-auto-generator util: rework strappenda(), and rename it strjoina() 2015-02-03 02:05:59 +01:00
gudev gudev: replace regex with sym file 2014-06-21 16:25:15 +02:00
hibernate-resume treewide: another round of simplifications 2014-11-28 19:57:32 +01:00
hostname tmpfiles: add new line type 'v' for creating btrfs subvolumes 2014-12-28 02:08:40 +01:00
hwdb Assorted format fixes 2015-01-22 01:14:52 -05:00
import networkd: exit on idle 2015-02-05 12:04:19 +01:00
initctl treewide: use log_*_errno whenever %m is in the format string 2014-11-28 19:49:27 +01:00
journal journald: don't specify inline in local functions 2015-02-10 12:34:11 +01:00
journal-remote util: rework strappenda(), and rename it strjoina() 2015-02-03 02:05:59 +01:00
kernel-install kernel-install/90-loaderentry.install: fix cmdline parsing 2014-11-01 14:39:48 -04:00
libsystemd tree-wide: Always use recvmsg with MSG_CMSG_CLOEXEC 2015-02-10 21:20:16 +01:00
libsystemd-network net: support globbing and disjunction in Match logic 2015-02-10 22:30:35 +01:00
libsystemd-terminal util: rework strappenda(), and rename it strjoina() 2015-02-03 02:05:59 +01:00
libudev tree-wide: Always use recvmsg with MSG_CMSG_CLOEXEC 2015-02-10 21:20:16 +01:00
locale language fallback: it_CH (Italian, Swiss) -> it_IT (Italian, Italy) 2015-02-09 07:39:24 +01:00
login logind: tell Coverity that we knowingly ignore mkdir()'s return value 2015-02-10 12:34:11 +01:00
machine tree-wide: Always use recvmsg with MSG_CMSG_CLOEXEC 2015-02-10 21:20:16 +01:00
machine-id-commit machine-id-commit: Introduce machine-id-commit binary 2014-12-03 03:41:19 +01:00
machine-id-setup Unify parse_argv style 2014-08-03 21:46:07 -04:00
modules-load treewide: use log_*_errno whenever %m is in the format string 2014-11-28 19:49:27 +01:00
network networkd DHCPv4 logging endian fix 2015-02-11 12:57:17 +01:00
notify notify,firstboot,analyze,run: trim --help output to 80 lines 2015-01-27 21:48:12 -05:00
nspawn nspawn: Allow module loading if CAP_SYS_MODULE is requested 2015-02-04 13:34:46 +01:00
nss-myhostname nss-myhostname: always will in canonical hostname field when resolving addresses to hostnames 2015-01-05 16:24:41 +01:00
nss-mymachines nss: remove dead code 2014-09-19 00:15:39 +02:00
nss-resolve sd-bus: move common errors src/shared/bus-errors.h → src/libsystemd/sd-bus/bus-common-errors.h 2014-12-10 19:07:48 +01:00
path treewide: yet more log_*_errno + return simplifications 2014-11-28 18:56:16 +01:00
python-systemd python-systemd: avoid hitting assert in __exit__ 2014-10-14 08:35:16 -04:00
quotacheck delta: diff returns 1 when files differ, ignore this 2014-11-29 11:10:51 -05:00
random-seed random-seed: avoid errors when we cannot write random-seed file 2015-01-17 11:55:14 +01:00
rc-local-generator treewide: use log_*_errno whenever %m is in the format string 2014-11-28 19:49:27 +01:00
remount-fs treewide: use log_*_errno whenever %m is in the format string 2014-11-28 19:49:27 +01:00
reply-password treewide: another round of simplifications 2014-11-28 19:57:32 +01:00
resolve tree-wide: Always use recvmsg with MSG_CMSG_CLOEXEC 2015-02-10 21:20:16 +01:00
resolve-host sd-bus: move common errors src/shared/bus-errors.h → src/libsystemd/sd-bus/bus-common-errors.h 2014-12-10 19:07:48 +01:00
rfkill rfkill: rework how we generate file names from rfkill devices 2014-12-03 02:04:55 +01:00
run util: rework strappenda(), and rename it strjoina() 2015-02-03 02:05:59 +01:00
shared shared: untabify 2015-02-10 12:34:11 +01:00
shutdownd tree-wide: Always use recvmsg with MSG_CMSG_CLOEXEC 2015-02-10 21:20:16 +01:00
sleep Implement masking and overriding of generators 2015-01-11 18:17:33 -05:00
socket-proxy treewide: another round of simplifications 2014-11-28 19:57:32 +01:00
sysctl sysctl: consider --prefix while parsing the files 2015-02-07 12:19:37 -05:00
system-update-generator util: rework strappenda(), and rename it strjoina() 2015-02-03 02:05:59 +01:00
systemctl systemctl: unit_find_paths(): unify error handling in two code pathes 2015-02-04 20:10:28 -05:00
systemd sd-rtnl: extend type system to allow address-family to decide the union members 2015-02-08 17:43:39 +01:00
sysusers util: rework strappenda(), and rename it strjoina() 2015-02-03 02:05:59 +01:00
sysv-generator sysv-generator: no need to check for identical symlinks source and target twice 2015-01-28 15:11:49 +01:00
test cg_path_get_user_unit(): Did not correctly parse user-unit templates. 2015-02-04 02:16:33 +01:00
timedate time-util: let's make xstrftime() useful for everybody, even if we only have a single user so far. 2015-02-02 21:28:33 +01:00
timesync tree-wide: Always use recvmsg with MSG_CMSG_CLOEXEC 2015-02-10 21:20:16 +01:00
tmpfiles tmpfiles: fix compilation without acl support 2015-02-03 21:28:46 -05:00
tty-ask-password-agent util: rework strappenda(), and rename it strjoina() 2015-02-03 02:05:59 +01:00
udev net: support globbing and disjunction in Match logic 2015-02-10 22:30:35 +01:00
update-done tmpfiles: add new line type 'v' for creating btrfs subvolumes 2014-12-28 02:08:40 +01:00
update-utmp treewide: use log_*_errno whenever %m is in the format string 2014-11-28 19:49:27 +01:00
vconsole treewide: sanitize loop_write 2014-12-09 21:36:08 -05:00
.gitignore
Makefile