Right now it's difficult to grasp what's implemented of the SAP since it was scattered around several places. Put all the SAP forwarding logic into its own file so it's easy to follow and extend (eg. adding new helper functions, etc.)
Previous transition to S_IDLE was wrong, since there's no way to recover from that state unless the SCTP connection is closed. Instead, try harder waiting for some new notifications to try re-activating the ASP and see if the AS becomes active, or end up timing out and reconnecting to re-attempt complete set of steps.
xua_rkm: send_reg_req: Avoid adding Routing Context with value 0
We use routing context 0 internally as "no routing context". Since the Routing Context in the Routing KEy IE in RKM REG REQ is optional, if local rctx is 0 (because we expect to get one allocated by the STP and receive it through RKM REG RESP), avoid sending it with the value 0.