SEDbgMuxApp: handle ConnEstablished with DPRef=0xffff

This format string found in firmware image of a modem:

  DebugMux[DL,HandleConnectReq] Could not find DPRef 0x%04X;
                                sending Connect Response with ConnRef=0xFFFF

gives us a hint on what happens when ConnEstablish message contains
an unknown DPRef that was not announced or has became inactive.
master
Vadim Yanitskiy 9 months ago committed by Vadim Yanitskiy
parent 4d19f594c3
commit e09c227661
  1. 5
      sedbgmux.py

@ -124,6 +124,11 @@ class SEDbgMuxApp(cmd2.Cmd):
f = self.peer.recv()
assert(f['MsgType'] == DbgMuxFrame.MsgType.ConnEstablished)
ConnRef = DbgMuxFrame.MsgConnEstablished.parse(f['MsgData'])['ConnRef']
if ConnRef == 0xffff:
log.warning("Connection failed: unknown DPRef=0x%04x?", opts.DPRef)
self.peer.send(DbgMuxFrame.MsgType.Ack)
return
log.info("Connection established (ConnRef=0x%04x)", ConnRef)
# Read the messages

Loading…
Cancel
Save