Holger Freyther has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9663 )

Change subject: ms: Use the new API to pass credentials to the event server
......................................................................

ms: Use the new API to pass credentials to the event server

We are using the "autobind" feature of Linux to get a special
socket address. This allows us to have roughly 2^20 clients on
the system.

Change-Id: Ie9b9ac6267f40345baf7dbb3becaecf264a5df5f
---
M src/osmo_ms_driver/event_server.py
M src/osmo_ms_driver/location_update_test.py
M src/osmo_ms_driver/lua/ms_support.lua
3 files changed, 4 insertions(+), 3 deletions(-)

Approvals:
  Harald Welte: Looks good to me, but someone else must approve
  Pau Espin Pedrol: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo_ms_driver/event_server.py 
b/src/osmo_ms_driver/event_server.py
index 6b0232b..b0f699d 100644
--- a/src/osmo_ms_driver/event_server.py
+++ b/src/osmo_ms_driver/event_server.py
@@ -27,7 +27,7 @@
     def read_cb(self, obj, mask):
         # addresss doesn't give us the remote but currently we don't
         # need it.
-        (data, address) = self._server.recvfrom(4096)
+        data, ancdata, flags, addr = self._server.recvmsg(4096, 4096)
         now = time.clock_gettime(time.CLOCK_MONOTONIC)
         for handler in self._handlers:
-            handler(data, now)
+            handler(data, addr, now)
diff --git a/src/osmo_ms_driver/location_update_test.py 
b/src/osmo_ms_driver/location_update_test.py
index 2d661ca..0d27d0e 100644
--- a/src/osmo_ms_driver/location_update_test.py
+++ b/src/osmo_ms_driver/location_update_test.py
@@ -167,7 +167,7 @@
         for launcher in self._started:
             launcher.kill()

-    def handle_msg(self, _data, time):
+    def handle_msg(self, _data, addr, time):
         import json
         data = json.loads(_data.decode())

diff --git a/src/osmo_ms_driver/lua/ms_support.lua 
b/src/osmo_ms_driver/lua/ms_support.lua
index 817a564..6490bec 100644
--- a/src/osmo_ms_driver/lua/ms_support.lua
+++ b/src/osmo_ms_driver/lua/ms_support.lua
@@ -11,6 +11,7 @@
 function mod.register(ms, path)
        g_ms = ms

+       osmo.unix_passcred(g_c:getfd())
        g_c:connect(path)

        local event = {}

--
To view, visit https://gerrit.osmocom.org/9663
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie9b9ac6267f40345baf7dbb3becaecf264a5df5f
Gerrit-Change-Number: 9663
Gerrit-PatchSet: 2
Gerrit-Owner: Holger Freyther <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Holger Freyther <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol <[email protected]>

Reply via email to