From 55afe0072b435a0d9abc2db934ec9f17d4fb07dd Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Wed, 21 Mar 2018 13:46:34 +0100 Subject: trx_toolkit: Add cmdline arg to set bind addr Previous hardcoded default of 0.0.0.0 was inappropiate in some scenarios, as it sets the SRC addr of the packets sent through the socket based on the routing. For instance, if iface IF1 has assigned two IP addresses A and B, A being the first addr of the interface, and osmo-bts-trx is configured with "osmotrx ip local A" and "osmotrx ip remote B", the following happens: CMD POWER OFF src=A:5801 dst=B:5701 RSP POWER OFF src=A:5701 dst=A:5701 <-- A is assigned as src addr. But osmo-bts-trx is waiting for packets from B:5701, and the packet is dropped with ICMP Unreachable. If addr binding is forced in fake_trx to B, then everthing's fine. Let's extend the UDPLink in order to allow manual, but optional setting of bind address, and add a corresponding cmdline argument to all executables. Change-Id: I7be18fef40967fb7551f4115f22cbbd9cdb0840d --- src/target/trx_toolkit/clck_gen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/target/trx_toolkit/clck_gen.py') diff --git a/src/target/trx_toolkit/clck_gen.py b/src/target/trx_toolkit/clck_gen.py index 4b86c31a..b488770e 100755 --- a/src/target/trx_toolkit/clck_gen.py +++ b/src/target/trx_toolkit/clck_gen.py @@ -102,7 +102,7 @@ class Application: signal.signal(signal.SIGINT, self.sig_handler) def run(self): - self.link = UDPLink("127.0.0.1", 5800, 5700) + self.link = UDPLink("127.0.0.1", 5800, "0.0.0.0", 5700) self.clck = CLCKGen([self.link], ind_period = 51) self.clck.start() -- cgit v1.2.3