diafuzzer icon indicating copy to clipboard operation
diafuzzer copied to clipboard

unit.py client mode runs error

Open Jovons opened this issue 6 years ago • 1 comments

on one computer, I have

./fuzz.py --local-addresses '172.28.15.15','172.28.15.254' --local-port 3868 server scenarios/rx-server.scn

On the other computer:

image

How to run client mode when sctp multihoming?

Jovons avatar Oct 21 '18 08:10 Jovons

For using unit.py, for example: ./unit.py --local-addresses '127.0.0.1','192.168.1.7' --local-port 3867 client scenarios/S6.scn '127.0.0.1:3869' need next patch:

diff --git a/unit.py b/unit.py
index 7825340..7a3556c 100755
--- a/unit.py
+++ b/unit.py
@@ -54,13 +54,14 @@ if __name__ == '__main__':
   # parse additional argument in client or clientloop modes
   target = None
   if args.mode in ('client', 'clientloop'):
-    if len(args.remote) != 2 or len(args.remote[0]) == 0:
+    if len(args.remote) != 1 or len(args.remote[0]) == 0:
       parser.print_help()
       print >>sys.stderr, 'using client or clientloop modes require to specify target ip port'
       sys.exit(1)
 
     target = args.remote[0]
-    port = int(args.remote[1])
+    (host, port) = target.split(':')
+    port = int(port)
 
   # load scenario
   scenario = load_scenario(args.scenario, args.local_hostname, args.local_realm)
@@ -75,7 +76,7 @@ if __name__ == '__main__':
       else:
         f.bind((ADDR_ANY, args.local_port))
 
-      f.connect((target, port))
+      f.connect((host, port))
 
       (exc_info, msgs) = dwr_handler(scenario, f, args.local_hostname, args.local_realm)

EugeneBogush avatar May 07 '20 12:05 EugeneBogush