summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/test-lldp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd-network/test-lldp.c')
-rw-r--r--src/libsystemd-network/test-lldp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libsystemd-network/test-lldp.c b/src/libsystemd-network/test-lldp.c
index 1aae2253c0..6bcd65de0a 100644
--- a/src/libsystemd-network/test-lldp.c
+++ b/src/libsystemd-network/test-lldp.c
@@ -54,11 +54,11 @@ static void lldp_handler(sd_lldp *lldp, sd_lldp_event event, sd_lldp_neighbor *n
static int start_lldp(sd_lldp **lldp, sd_event *e, sd_lldp_callback_t cb, void *cb_data) {
int r;
- r = sd_lldp_new(lldp, 42);
+ r = sd_lldp_new(lldp);
if (r < 0)
return r;
- r = sd_lldp_attach_event(*lldp, e, 0);
+ r = sd_lldp_set_ifindex(*lldp, 42);
if (r < 0)
return r;
@@ -66,6 +66,10 @@ static int start_lldp(sd_lldp **lldp, sd_event *e, sd_lldp_callback_t cb, void *
if (r < 0)
return r;
+ r = sd_lldp_attach_event(*lldp, e, 0);
+ if (r < 0)
+ return r;
+
r = sd_lldp_start(*lldp);
if (r < 0)
return r;