[gsm_04_08] Fix gsm48_send_rr_ciph_mode algorithm ID

The algorithm ID used in the GSM 04.08 RR message is
(x-1) for A5/x. In RSL it's (x+1) for A5/x so there is
a difference of 2.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
Sylvain Munaut 2009-09-27 11:11:41 +02:00 committed by Harald Welte
parent cca253a7c4
commit a948c11c76

View file

@ -1699,7 +1699,7 @@ int gsm48_send_rr_ciph_mode(struct gsm_lchan *lchan)
if (lchan->encr.alg_id <= RSL_ENC_ALG_A5(0))
ciph_mod_set = 0;
else
ciph_mod_set = (lchan->encr.alg_id-1)<<1 | 1;
ciph_mod_set = (lchan->encr.alg_id-2)<<1 | 1;
gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1);
gh->proto_discr = GSM48_PDISC_RR;