diff --git a/_sctp.c b/_sctp.c index aa0dca7..2276262 100644 --- a/_sctp.c +++ b/_sctp.c @@ -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; diff --git a/sctp.py b/sctp.py index 95c6470..3a8a379 100644 --- a/sctp.py +++ b/sctp.py @@ -65,7 +65,7 @@ """ from __future__ import print_function - +from socket import * import socket import _sctp @@ -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): """