[gsm_04_08] Fix gsm48_tx_mm_auth_req implementation
It was mainly missing the key_seq field, causing the command to just be rejected by the ME. Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
parent
59d284e8cf
commit
849f554c87
|
@ -78,6 +78,13 @@ struct gsm48_loc_area_id {
|
|||
u_int16_t lac;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Section 9.2.2 */
|
||||
struct gsm48_auth_req {
|
||||
u_int8_t key_seq:4,
|
||||
spare:4;
|
||||
u_int8_t rand[16];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Section 9.2.15 */
|
||||
struct gsm48_loc_upd_req {
|
||||
u_int8_t type:4,
|
||||
|
|
|
@ -1233,7 +1233,7 @@ int gsm48_tx_mm_auth_req(struct gsm_lchan *lchan, u_int8_t *rand)
|
|||
{
|
||||
struct msgb *msg = gsm48_msgb_alloc();
|
||||
struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
|
||||
u_int8_t *r;
|
||||
struct gsm48_auth_req *ar = (struct gsm48_auth_req *) msgb_put(msg, sizeof(*ar));
|
||||
|
||||
DEBUGP(DMM, "-> AUTH REQ\n");
|
||||
|
||||
|
@ -1241,10 +1241,12 @@ int gsm48_tx_mm_auth_req(struct gsm_lchan *lchan, u_int8_t *rand)
|
|||
gh->proto_discr = GSM48_PDISC_MM;
|
||||
gh->msg_type = GSM48_MT_MM_AUTH_REQ;
|
||||
|
||||
/* Key Sequence: FIXME fixed to 0 */
|
||||
ar->key_seq = 0;
|
||||
|
||||
/* 16 bytes RAND parameters */
|
||||
r = msgb_put(msg, 16);
|
||||
if (rand)
|
||||
memcpy(r, rand, 16);
|
||||
memcpy(ar->rand, rand, 16);
|
||||
|
||||
return gsm48_sendmsg(msg, NULL);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue