[MERGED] openbsc[master]: vty test: nat_msc_test: setsockopt REUSE to avoid TIME_WAIT ...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Tue Feb 28 18:22:06 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: vty test: nat_msc_test: setsockopt REUSE to avoid TIME_WAIT problems
......................................................................


vty test: nat_msc_test: setsockopt REUSE to avoid TIME_WAIT problems

When running the testBSCreload test in close succession, I get a "Connection
refused" error because the socket is still in TIME_WAIT state. Passing the
SO_REUSEADDR flag allows reusing the addr despite a TIME_WAIT socket.

Change-Id: I941851b062999ab4b962430f7b27c19935993e0a
---
M openbsc/tests/vty_test_runner.py
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py
index 821c6d3..5836cd4 100644
--- a/openbsc/tests/vty_test_runner.py
+++ b/openbsc/tests/vty_test_runner.py
@@ -1207,6 +1207,7 @@
 
 def nat_msc_test(x, ip, port, verbose = False):
     msc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+    msc.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
     msc.settimeout(5)
     msc.bind((ip, port))
     msc.listen(5)

-- 
To view, visit https://gerrit.osmocom.org/1932
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I941851b062999ab4b962430f7b27c19935993e0a
Gerrit-PatchSet: 3
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list