Skip to content

fix SOMEIP answers function, in case there is SD above #4061

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
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
12 changes: 11 additions & 1 deletion scapy/contrib/automotive/someip.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,21 @@ def answers(self, other):
if isinstance(other, type(self)):
if self.msg_type in [SOMEIP.TYPE_REQUEST_NO_RET,
SOMEIP.TYPE_REQUEST_NORET_ACK,
SOMEIP.TYPE_NOTIFICATION,
SOMEIP.TYPE_TP_REQUEST_NO_RET,
SOMEIP.TYPE_TP_NOTIFICATION]:
return 0

# if Notification but not SD
if (self.msg_type == SOMEIP.TYPE_NOTIFICATION and (self.srv_id != SD.SOMEIP_MSGID_SRVID
or self.sub_id != SD.SOMEIP_MSGID_SUBID
or self.event_id != SD.SOMEIP_MSGID_EVENTID
or self.proto_ver != SD.SOMEIP_PROTO_VER
or self.iface_ver != SD.SOMEIP_IFACE_VER
or self.retcode != SD.SOMEIP_RETCODE)):
return 0

return self.payload.answers(other.payload)

return 0

@staticmethod
Expand Down