neels has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-upf/+/30524
)
Change subject: gtpu_echo: do not osmo_fd_register twice
......................................................................
gtpu_echo: do not osmo_fd_register twice
Change-Id: Ib498cc8d5252c05e12196f84bd1ea18d67e3052c
---
M src/osmo-upf/upf_gtpu_echo.c
1 file changed, 6 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-upf refs/changes/24/30524/1
diff --git a/src/osmo-upf/upf_gtpu_echo.c b/src/osmo-upf/upf_gtpu_echo.c
index f6dfe5c..60a8da8 100644
--- a/src/osmo-upf/upf_gtpu_echo.c
+++ b/src/osmo-upf/upf_gtpu_echo.c
@@ -155,7 +155,12 @@
return -EINVAL;
}
+ /* the caller should already have osmo_fd_register()ed when setting up the socket. */
+ OSMO_ASSERT(osmo_fd_is_registered(&dev->gtpv1.ofd));
+ /* make sure there is no cb yet that this would be replacing. */
+ OSMO_ASSERT(dev->gtpv1.ofd.cb == NULL);
+
dev->gtpv1.ofd.cb = upf_gtpu_echo_read_cb;
dev->gtpv1.ofd.data = dev;
- return osmo_fd_register(&dev->gtpv1.ofd);
+ return 0;
}
--
To view, visit
https://gerrit.osmocom.org/c/osmo-upf/+/30524
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-upf
Gerrit-Branch: master
Gerrit-Change-Id: Ib498cc8d5252c05e12196f84bd1ea18d67e3052c
Gerrit-Change-Number: 30524
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange