From e306723ec4290f8cd0fa08caf12bdc28afda5ed9 Mon Sep 17 00:00:00 2001 From: Nathan McSween Date: Thu, 18 Feb 2016 23:34:30 +0000 Subject: Remove/add (un)needed includes --- src/basic/hostname-util.c | 1 - src/libsystemd-network/lldp-network.c | 2 +- src/machine/machine-dbus.c | 1 + src/network/networkd-netdev-tuntap.c | 1 + src/shared/machine-image.c | 1 + src/shared/machine-pool.c | 1 + src/udev/net/link-config.c | 1 - 7 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/basic/hostname-util.c b/src/basic/hostname-util.c index 7bb23448ed..57031b645c 100644 --- a/src/basic/hostname-util.c +++ b/src/basic/hostname-util.c @@ -17,7 +17,6 @@ along with systemd; If not, see . ***/ -#include #include #include #include diff --git a/src/libsystemd-network/lldp-network.c b/src/libsystemd-network/lldp-network.c index 42058c4449..7c865b46cb 100644 --- a/src/libsystemd-network/lldp-network.c +++ b/src/libsystemd-network/lldp-network.c @@ -19,7 +19,7 @@ ***/ #include -#include +#include #include "fd-util.h" #include "lldp-internal.h" diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c index 71f20b3f07..c5bbf2fbde 100644 --- a/src/machine/machine-dbus.c +++ b/src/machine/machine-dbus.c @@ -20,6 +20,7 @@ #include #include #include +#include /* When we include libgen.h because we need dirname() we immediately * undefine basename() since libgen.h defines it as a macro to the POSIX diff --git a/src/network/networkd-netdev-tuntap.c b/src/network/networkd-netdev-tuntap.c index ab9a1b0426..cdf443862d 100644 --- a/src/network/networkd-netdev-tuntap.c +++ b/src/network/networkd-netdev-tuntap.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "alloc-util.h" #include "fd-util.h" diff --git a/src/shared/machine-image.c b/src/shared/machine-image.c index ed8a29c575..d2f1c4a40c 100644 --- a/src/shared/machine-image.c +++ b/src/shared/machine-image.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include diff --git a/src/shared/machine-pool.c b/src/shared/machine-pool.c index e5674e4137..f080b849a4 100644 --- a/src/shared/machine-pool.c +++ b/src/shared/machine-pool.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c index 15145fc5eb..c66504102f 100644 --- a/src/udev/net/link-config.c +++ b/src/udev/net/link-config.c @@ -18,7 +18,6 @@ ***/ #include -#include #include "sd-netlink.h" -- cgit v1.2.3-54-g00ecf From 3a43755733292fde399548248a5ba158d9df27ac Mon Sep 17 00:00:00 2001 From: Nathan McSween Date: Thu, 18 Feb 2016 23:35:22 +0000 Subject: Don't use internal struct member names --- src/network/networkd-ndisc.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/network/networkd-ndisc.c b/src/network/networkd-ndisc.c index f2287be20a..3e8932e160 100644 --- a/src/network/networkd-ndisc.c +++ b/src/network/networkd-ndisc.c @@ -19,6 +19,7 @@ #include #include +#include #include #include "sd-ndisc.h" @@ -76,15 +77,15 @@ static void ndisc_prefix_autonomous_handler(sd_ndisc *nd, const struct in6_addr memcpy(((char *)&address->in_addr.in6) + 8, ((char *)&link->network->ipv6_token) + 8, 8); else { /* see RFC4291 section 2.5.1 */ - address->in_addr.in6.__in6_u.__u6_addr8[8] = link->mac.ether_addr_octet[0]; - address->in_addr.in6.__in6_u.__u6_addr8[8] ^= 1 << 1; - address->in_addr.in6.__in6_u.__u6_addr8[9] = link->mac.ether_addr_octet[1]; - address->in_addr.in6.__in6_u.__u6_addr8[10] = link->mac.ether_addr_octet[2]; - address->in_addr.in6.__in6_u.__u6_addr8[11] = 0xff; - address->in_addr.in6.__in6_u.__u6_addr8[12] = 0xfe; - address->in_addr.in6.__in6_u.__u6_addr8[13] = link->mac.ether_addr_octet[3]; - address->in_addr.in6.__in6_u.__u6_addr8[14] = link->mac.ether_addr_octet[4]; - address->in_addr.in6.__in6_u.__u6_addr8[15] = link->mac.ether_addr_octet[5]; + address->in_addr.in6.s6_addr[8] = link->mac.ether_addr_octet[0]; + address->in_addr.in6.s6_addr[8] ^= 1 << 1; + address->in_addr.in6.s6_addr[9] = link->mac.ether_addr_octet[1]; + address->in_addr.in6.s6_addr[10] = link->mac.ether_addr_octet[2]; + address->in_addr.in6.s6_addr[11] = 0xff; + address->in_addr.in6.s6_addr[12] = 0xfe; + address->in_addr.in6.s6_addr[13] = link->mac.ether_addr_octet[3]; + address->in_addr.in6.s6_addr[14] = link->mac.ether_addr_octet[4]; + address->in_addr.in6.s6_addr[15] = link->mac.ether_addr_octet[5]; } address->prefixlen = prefixlen; address->flags = IFA_F_NOPREFIXROUTE|IFA_F_MANAGETEMPADDR; -- cgit v1.2.3-54-g00ecf