slotmap: restructure read_cb()
Change-Id: I7fb457f028f9aabc7b4b53bf036e5eac9d785299
This commit is contained in:
parent
e5c7773c7f
commit
7bfcc65227
|
@ -462,21 +462,31 @@ static int sock_read_cb(struct ipa_server_conn *peer, struct msgb *msg)
|
||||||
if (msgb_length(msg) < sizeof(*hh))
|
if (msgb_length(msg) < sizeof(*hh))
|
||||||
goto invalid;
|
goto invalid;
|
||||||
msg->l2h = &hh->data[0];
|
msg->l2h = &hh->data[0];
|
||||||
if (hh->proto != IPAC_PROTO_OSMO)
|
switch (hh->proto) {
|
||||||
goto invalid;
|
case IPAC_PROTO_IPACCESS:
|
||||||
if (!he || msgb_l2len(msg)< sizeof(*he))
|
rc = ipa_server_conn_ccm(peer, msg);
|
||||||
goto invalid;
|
break;
|
||||||
msg->l2h = &he->data[0];
|
case IPAC_PROTO_OSMO:
|
||||||
|
if (!he || msgb_l2len(msg)< sizeof(*he))
|
||||||
|
goto invalid;
|
||||||
|
msg->l2h = &he->data[0];
|
||||||
|
|
||||||
if (he->proto!= IPAC_PROTO_EXT_RSPRO)
|
switch (he->proto) {
|
||||||
goto invalid;
|
case IPAC_PROTO_EXT_RSPRO:
|
||||||
|
pdu = rspro_dec_msg(msg);
|
||||||
|
if (!pdu)
|
||||||
|
goto invalid;
|
||||||
|
|
||||||
pdu = rspro_dec_msg(msg);
|
rc = handle_rx_rspro(conn, pdu);
|
||||||
if (!pdu)
|
ASN_STRUCT_FREE(asn_DEF_RsproPDU, pdu);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
goto invalid;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
goto invalid;
|
goto invalid;
|
||||||
|
}
|
||||||
rc = handle_rx_rspro(conn, pdu);
|
|
||||||
ASN_STRUCT_FREE(asn_DEF_RsproPDU, pdu);
|
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
invalid:
|
invalid:
|
||||||
|
|
Loading…
Reference in New Issue