aboutsummaryrefslogtreecommitdiffstats
path: root/src/vty.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2021-03-26 09:29:15 +0100
committerHarald Welte <laforge@osmocom.org>2021-03-26 09:29:15 +0100
commit67b6f40201299ed208de9b9fdec11d7274eb7149 (patch)
treeaf7c25d39e5662ca6daeee4e4be3ada419f2a183 /src/vty.c
parent4fea7a7083047a2f553a126ce983a7ce07ce4750 (diff)
e1d: fix ASSERT during "write terminal"
There was some wrong ordering in config_write_e1d() regarding resolving the vpair 'peer' devices. We can only call e1d_vpair_intf_peer() _after_ we have established that the given interface actually is of type VPAIR. Assert failed intf->drv == E1_DRIVER_VPAIR vpair.c:96 Change-Id: If494d77ed1df5cda655d3b4a60868154dc2b355e
Diffstat (limited to 'src/vty.c')
-rw-r--r--src/vty.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/vty.c b/src/vty.c
index 0d8ab2b..563950d 100644
--- a/src/vty.c
+++ b/src/vty.c
@@ -185,12 +185,16 @@ static int config_write_e1d(struct vty *vty)
/* find all vpair interfaces */
llist_for_each_entry(intf, &vty_e1d->interfaces, list) {
- struct e1_intf *peer = e1d_vpair_intf_peer(intf);
+ struct e1_intf *peer;
unsigned int line_count = 0;
struct e1_line *line;
if (intf->drv != E1_DRIVER_VPAIR)
continue;
+
+ peer = e1d_vpair_intf_peer(intf);
+ OSMO_ASSERT(peer);
+
/* skip the 'mirror' interfaces */
if (intf->id > peer->id)
continue;