From 4104bebdd2236302c82f3cfe467c172e2adb4289 Mon Sep 17 00:00:00 2001 From: p1-ra Date: Fri, 12 Jun 2020 16:03:32 +0000 Subject: [PATCH] Use socket adaptation (~ppid) option as default adaptation value - Current SCTP linux release A1305EABD8F6C3D37020C43 break the behaviour of previous release AE81E0A508A0D11D1341E64 In AE81E0A508A0D11D1341E64 when setting the socket option SCTP_ADAPTATION_LAYER, it was then use as global default value for next assosiations. It is not the case anymore in A1305EABD8F6C3D37020C43. That commit shield us against that breaking change. --- sctp.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sctp.py b/sctp.py index 6c94eb8..87bcd2b 100644 --- a/sctp.py +++ b/sctp.py @@ -1112,7 +1112,7 @@ def getladdrs(self, assoc_id = 0): # -> tuple of sockaddrs as strings return _sctp.getladdrs(self._sk.fileno(), assoc_id) - def sctp_send(self, msg, to=("",0), ppid=0, flags=0, stream=None, timetolive=None, context=0, + def sctp_send(self, msg, to=("",0), ppid=None, flags=0, stream=None, timetolive=None, context=0, record_file_prefix="RECORD_sctp_traffic", datalogging = False): """ Sends a SCTP message. While send()/sendto() can also be used, this method also @@ -1157,6 +1157,9 @@ def sctp_send(self, msg, to=("",0), ppid=0, flags=0, stream=None, timetolive=Non The application must configure this buffer accordingly. """ + if ppid is None: + ppid = self.adaptation + if timetolive is None: timetolive = self._ttl