summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2016-04-08 08:31:33 +0200
committerMartin Pitt <martin.pitt@ubuntu.com>2016-04-08 08:31:33 +0200
commit710a8858a930a13da8dabbba61d64eb8f420b448 (patch)
tree62c976a11d6719f67788d5e9e813a8e9944aca23 /src/network
parent74dd72d559911bd56f9865a273c355e4e2e48fae (diff)
parentc8cf4dc1e52335eb67823c3c4fa066578e016608 (diff)
Merge pull request #2985 from keszybz/lldp-assert
Replace if with assert_cc in lldp code and a build-sys tweak
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkd-lldp-tx.c3
1 files changed, 1 insertions, 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 :