aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHolger Freyther <zecke@selfish.org>2009-06-06 13:54:44 +0000
committerHolger Freyther <zecke@selfish.org>2009-06-06 13:54:44 +0000
commiteaf0469a8b4e0fc9416083f97f0a88e06ab305c8 (patch)
tree85ed4205b2e3b5c674fa933021226b9b8d41dc17 /src
parent7c19f74084f9eaa4565d34af405d3526e3bbc27b (diff)
gsm_04_08.c: Some spoofing protection against two location updating requests
Do not allow two location updating requests on the same lchan. Such an event is certainly spoofed and can confuse the internal logic of the application. Prevent that.
Diffstat (limited to 'src')
-rw-r--r--src/gsm_04_08.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gsm_04_08.c b/src/gsm_04_08.c
index 7e448dd68..83f38dd8b 100644
--- a/src/gsm_04_08.c
+++ b/src/gsm_04_08.c
@@ -593,6 +593,17 @@ static int mm_rx_loc_upd_req(struct msgb *msg)
DEBUGP(DMM, "LUPDREQ: mi_type=0x%02x MI(%s) type=%s\n", mi_type, mi_string,
lupd_name(lu->type));
+ /*
+ * Pseudo Spoof detection: Just drop a second/concurrent
+ * location updating request.
+ */
+ if (lchan->loc_operation) {
+ DEBUGP(DMM, "LUPDREQ: ignoring request due an existing one: %p.\n",
+ lchan->loc_operation);
+ gsm0408_loc_upd_rej(lchan, GSM48_REJECT_PROTOCOL_ERROR);
+ return 0;
+ }
+
allocate_loc_updating_req(lchan);
switch (mi_type) {