Skip to content

Commit

Permalink
Force IP addrs, don't pass through host names
Browse files Browse the repository at this point in the history
When the auto networking plugin assigns sockets it passes through
`local_host` and `media_addr` preset values. The problem is that if
these are long enough or malformed enough SIPp will just crash. So just
always force them to addresses at the inset and avoid yet another SIPp
nightmare...
  • Loading branch information
Tyler Goodlet committed Jul 20, 2017
1 parent 2bf70a8 commit a12442e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pysipp/netplug.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ def pysipp_conf_scen(agents, scen):
for ua in scen.agents.values():
copy = scen.prepare_agent(ua)

ip, port = getsockaddr(ua.local_host)

if not copy.local_host:
ua.local_host = host
ua.local_host = ip

if not copy.local_port:
ua.local_port = getsockaddr(ua.local_host)[1]
ua.local_port = port

if not copy.media_addr:
ua.media_addr = ua.local_host
Expand Down

0 comments on commit a12442e

Please sign in to comment.