P1sec / pysctp

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

ppid field changed from 32 bits to 128 bits #48

Closed CHsixnine closed 1 year ago

CHsixnine commented 1 year ago

When I set like this below sctp_send(msg=data, ppid=60) When I use wireshark parse the package ppid will become 10^30

image

After that I go directly to the file _sctp.c and set ppid to 0x3c(60)

Py_BEGIN_ALLOW_THREADS
ppid = 0x3c;
size_sent = sctp_sendmsg(fd, msg, msg_len, (struct sockaddr*) psto, sto_len, ppid, 
            flags, stream, ttl, context);

Parsing the package with a wireshark will become like this

image image

ppid should be 32 bits, but it looks like 128 bits

Please help me to solve this problem Thanks

p1-bmu commented 1 year ago

Maybe if you read carefully the previous issue on PPID, it will provide you with the appropriate answer ? https://github.com/P1sec/pysctp/issues/46

CHsixnine commented 1 year ago

Thank you very much I have successfully solved this problem. I successfully solved it after adding the following two lines of code to the sctp.py

68 | from socket import *
1178 | return sctp.sctp_send_msg(self._sk.fileno(), msg, to, ntohl(ppid), flags, stream, timetolive, context)