summaryrefslogtreecommitdiff
path: root/src/network/networkd-link.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2015-09-22 15:19:42 +0200
committerDavid Herrmann <dh.herrmann@gmail.com>2015-09-22 15:19:42 +0200
commit9ef61f2e4802abdb4a2853a82126420b1e77b419 (patch)
treed4bb3f57e4b6828b9e8be1748a3dd2899481de63 /src/network/networkd-link.c
parent8955cf0a4586010f913bb7e0f8d05f1fc116c246 (diff)
sd-lldp: hide internal details
Currently, sd-lldp.h exports "UPDATE_INFO".. and defines it to a magic constant '10'. This is completely bogus, so fix it to follow our coding standards: - Prefix exported symbols by SD_LLDP_* - Define a separate event-enum for event types - Translate internal state to external event-types
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r--src/network/networkd-link.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 215c47b8af..86f1c3bb1a 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1112,13 +1112,16 @@ static void lldp_handler(sd_lldp *lldp, int event, void *userdata) {
assert(link->network);
assert(link->manager);
- if (event != UPDATE_INFO)
- return;
-
- r = sd_lldp_save(link->lldp, link->lldp_file);
- if (r < 0)
- log_link_warning_errno(link, r, "Could not save LLDP: %m");
+ switch (event) {
+ case SD_LLDP_EVENT_UPDATE_INFO:
+ r = sd_lldp_save(link->lldp, link->lldp_file);
+ if (r < 0)
+ log_link_warning_errno(link, r, "Could not save LLDP: %m");
+ break;
+ default:
+ break;
+ }
}
static int link_acquire_conf(Link *link) {