summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/sd-lldp.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-22 15:31:55 +0200
committerLennart Poettering <lennart@poettering.net>2015-09-22 15:31:55 +0200
commit9c90e27767697e01b0cfb9f345b928763942b731 (patch)
treeb9a73972a13c83ceaab9a65ce31f515df90ac8f3 /src/libsystemd-network/sd-lldp.c
parent85fade1edbc3d6ccf7e0685bbf4790f30d35009e (diff)
parent9ef61f2e4802abdb4a2853a82126420b1e77b419 (diff)
Merge pull request #1333 from dvdhrm/sd-network-cleanup
sd-network: random API cleanups
Diffstat (limited to 'src/libsystemd-network/sd-lldp.c')
-rw-r--r--src/libsystemd-network/sd-lldp.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/libsystemd-network/sd-lldp.c b/src/libsystemd-network/sd-lldp.c
index 574e04b541..17512884f5 100644
--- a/src/libsystemd-network/sd-lldp.c
+++ b/src/libsystemd-network/sd-lldp.c
@@ -366,10 +366,16 @@ static void lldp_set_state(sd_lldp *lldp, LLDPAgentRXState state) {
}
static void lldp_run_state_machine(sd_lldp *lldp) {
+ if (!lldp->cb)
+ return;
- if (lldp->rx_state == LLDP_AGENT_RX_UPDATE_INFO)
- if (lldp->cb)
- lldp->cb(lldp, LLDP_AGENT_RX_UPDATE_INFO, lldp->userdata);
+ switch (lldp->rx_state) {
+ case LLDP_AGENT_RX_UPDATE_INFO:
+ lldp->cb(lldp, SD_LLDP_EVENT_UPDATE_INFO, lldp->userdata);
+ break;
+ default:
+ break;
+ }
}
/* 10.5.5.2.1 mibDeleteObjects ()