From 56815242acd94baa90992b45fa646abd6c436be8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 4 Apr 2016 10:42:58 -0400 Subject: [PATCH 1/2] build-sys: force generation of triggers.systemd file We don't want to actually install it anywhere, because it is only usable copied or %included directly into a spec file, and must be available before %prep is run. But still, it's useful to generate it automatically so it's easier to copy and it doesn't go stale. --- Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile.am b/Makefile.am index 6ee5aaa403..d670ae1984 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1383,6 +1383,9 @@ pkgconfigdata_DATA += \ nodist_rpmmacros_DATA = \ src/core/macros.systemd +BUILT_SOURCES += \ + src/core/triggers.systemd + EXTRA_DIST += \ src/core/systemd.pc.in \ src/core/macros.systemd.in \ From c8cf4dc1e52335eb67823c3c4fa066578e016608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 7 Apr 2016 14:29:07 -0400 Subject: [PATCH 2/2] lldp: replace if with assert_cc LLDP_TX_HOLD or one of the other variables might be changed in the future resulting in a silent error here if the if was just removed. Replacement for #2983. --- src/network/networkd-lldp-tx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/network/networkd-lldp-tx.c b/src/network/networkd-lldp-tx.c index 5af2a31ea7..c940e63052 100644 --- a/src/network/networkd-lldp-tx.c +++ b/src/network/networkd-lldp-tx.c @@ -239,9 +239,8 @@ static int link_send_lldp(Link *link) { (void) gethostname_strict(&hostname); (void) parse_env_file("/etc/machine-info", NEWLINE, "PRETTY_HOSTNAME", &pretty_hostname, NULL); + assert_cc(LLDP_TX_INTERVAL_USEC * LLDP_TX_HOLD + 1 <= (UINT16_MAX - 1) * USEC_PER_SEC); ttl = DIV_ROUND_UP(LLDP_TX_INTERVAL_USEC * LLDP_TX_HOLD + 1, USEC_PER_SEC); - if (ttl > (usec_t) UINT16_MAX) - ttl = (usec_t) UINT16_MAX; caps = (link->network && link->network->ip_forward != ADDRESS_FAMILY_NO) ? SD_LLDP_SYSTEM_CAPABILITIES_ROUTER :