Skip to content

No need to be root for pcapplay.#57

Open
wdoekes wants to merge 2 commits into
SIPp:masterfrom
ossobv:wjd-no_root_for_pcap
Open

No need to be root for pcapplay.#57
wdoekes wants to merge 2 commits into
SIPp:masterfrom
ossobv:wjd-no_root_for_pcap

Conversation

@wdoekes

@wdoekes wdoekes commented Mar 12, 2014

Copy link
Copy Markdown
Member

The first part, needed to get pcapplay without root powers going.

@wdoekes

wdoekes commented Mar 12, 2014

Copy link
Copy Markdown
Member Author

Ok. And pushing along, the second part got appended to this pull request too.

Oh, well. That was the intention anyway.

@rkday

rkday commented Mar 14, 2014

Copy link
Copy Markdown
Contributor

Looks good, thanks! I'd like to compile this and kick the tyres myself before I merge, but I should get to that this week.

What OSes have you tested this on? I have Linux, OS X, Cygwin and FreeBSD available to me, and it probably makes sense for me to test on the ones you haven't been able to.

@wdoekes

wdoekes commented Mar 15, 2014

Copy link
Copy Markdown
Member Author

Only tested on Linux.

Similar changes have been running for a longer while on the sipp-osso hg fork, but those too have only been seen by a Linux OS.

Cheers,
Walter

(Excuse the short msg. This was composed on a phone...)

Rob Day notifications@github.com wrote:

Looks good, thanks! I'd like to compile this and kick the tyres myself before I merge, but I should get to that this week.

What OSes have you tested this on? I have Linux, OS X, Cygwin and FreeBSD available to me, and it probably makes sense for me to test on the ones you haven't been able to.


Reply to this email directly or view it on GitHub.

@wdoekes wdoekes mentioned this pull request May 13, 2014
@wdoekes

wdoekes commented May 13, 2014

Copy link
Copy Markdown
Member Author

I believe this has one issue: if you're using RTCP and/or other data over multiple ports, this does not work.

Not sure how to proceed.

  • We could run the old code if one is root.
  • Or we could add code to open extra ports as needed.

Both have disadvantages:

  • Using the old root-code makes behaviour inconsistent/unpredictable.
  • Opening ports as needed may not be possible (someone may have already allocated those).

@rkday

rkday commented May 28, 2014

Copy link
Copy Markdown
Contributor

Sorry for the delay - had to mull that issue over. I think the right thing to do is to open the necessary range of ports - but we should do that at the very start (by checking the pcap files, seeing how many unique port numbers there are, and opening that many at the right offsets from the "base" port). If we fail to open one, we can just choose another "base" port and retry.

@wdoekes wdoekes force-pushed the master branch 2 times, most recently from bebdf78 to 8923379 Compare October 3, 2014 06:55
@wdoekes wdoekes mentioned this pull request May 5, 2015
@vodik

vodik commented May 29, 2015

Copy link
Copy Markdown
Member

Another option is to set CAP_NET_RAW on sipp.

@wdoekes

wdoekes commented Jun 1, 2015

Copy link
Copy Markdown
Member Author

An interesting option, but it has its own drawbacks.

I tried it indeed:

sudo setcap cap_net_raw+ep `which sipp`

But that broke my unittest framework, which introspects which sockets are open by looking at proc:

$ ls /proc/`pidof sipp`/fd
ls: cannot open directory /proc/9986/fd: Permission denied

@vodik

vodik commented Jun 1, 2015

Copy link
Copy Markdown
Member

Your personal unittest stuff Linux? Maybe ss would be more appropriate. The -p flag adds process information to the output.

@wdoekes

wdoekes commented Jun 1, 2015

Copy link
Copy Markdown
Member Author

Same difference:

$ ss -lp | grep 5060
tcp    UNCONN     0      0                    *:ipproto-5060               *:*        users:(("sipp",3600,4))

Vs:

$ ss -lp | grep 5060
tcp    UNCONN     0      0                    *:ipproto-5060               *:*

Was to be expected ;)

@vodik

vodik commented Jun 1, 2015

Copy link
Copy Markdown
Member

Yeah, huh. TIL.

@vodik vodik force-pushed the master branch 3 times, most recently from 231edd4 to 341fb97 Compare July 16, 2015 20:58
@wdoekes

wdoekes commented Aug 30, 2015

Copy link
Copy Markdown
Member Author

Interestingly, the polycom-sipped also did some work on this, seeing that the RAW sockets changed to DGRAM in this commit:
SIPp/polycom-sipped@e9b1f62

@alienpenguin

Copy link
Copy Markdown

hi, is there any update on this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants