P1sec / pysctp

SCTP stack for Python
http://www.p1sec.com
161 stars 67 forks source link

SCTP payload protocol ID argument issue #27

Closed w910820618 closed 5 years ago

w910820618 commented 5 years ago

I found a small bug in your program. The problem is sctp_sendmsg used in the sctp_send_msg() method in the _sctp.c file. You directly pass ppid through sctp to cause the value of ppid to be wrong. You should use htonl(ppid), so there is no problem.

p1-bmu commented 5 years ago

Thanks for reporting. This is however not a bug, but the way the Linux SCTP API is exposed to userland program. I understand this is not very Python-friendly, but I prefer to keep it as is, and let the application deal with it (see e.g. https://github.com/P1sec/pycrate/blob/af18a03548032b6016bbbcffeda35a4d6f0faf7d/pycrate_corenet/Server.py#L534).

p1-bmu commented 5 years ago

This could be good also that you set a proper title to the issue, such as "SCTP payload protocol ID argument issue"