Skip to content

ppid Byte-ordering is incorrect fix #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion _sctp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1663,7 +1663,8 @@ static PyObject* getladdrs(PyObject* dummy, PyObject* args)

static PyObject* sctp_send_msg(PyObject* dummy, PyObject* args)
{
int fd, msg_len, size_sent, ppid, flags, stream, ttl, context;
int fd, msg_len, size_sent, flags, stream, ttl, context;
int ppid;
const char *msg;
char *to;
int port;
Expand Down
4 changes: 2 additions & 2 deletions sctp.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"""

from __future__ import print_function

from socket import *
import socket
import _sctp

Expand Down Expand Up @@ -1175,7 +1175,7 @@ def sctp_send(self, msg, to=("",0), ppid=None, flags=0, stream=None, timetolive=
recordlog = open(recordfilename+"%d"%i, 'w')
recordlog.write(msg)
recordlog.close()
return _sctp.sctp_send_msg(self._sk.fileno(), msg, to, ppid, flags, stream, timetolive, context)
return _sctp.sctp_send_msg(self._sk.fileno(), msg, to, ntohl(ppid), flags, stream, timetolive, context)

def sctp_recv(self, maxlen):
"""
Expand Down