summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/src/mobile/settings.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/host/layer23/src/mobile/settings.c')
-rw-r--r--src/host/layer23/src/mobile/settings.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/host/layer23/src/mobile/settings.c b/src/host/layer23/src/mobile/settings.c
index 80b0b482..7370b0ab 100644
--- a/src/host/layer23/src/mobile/settings.c
+++ b/src/host/layer23/src/mobile/settings.c
@@ -23,7 +23,6 @@
#include <errno.h>
#include <string.h>
#include <osmocom/core/talloc.h>
-#include <osmocom/gsm/gsm_utils.h>
#include <osmocom/bb/mobile/app_mobile.h>
#include <osmocom/bb/common/logging.h>
@@ -179,19 +178,14 @@ int gsm_random_imei(struct gsm_settings *set)
{
int digits = set->imei_random;
char rand[16];
- long rand_num;
if (digits <= 0)
return 0;
if (digits > 15)
digits = 15;
- if (osmo_get_rand_id((uint8_t *) &rand_num, sizeof(rand_num)) != 0)
- rand_num = random();
- sprintf(rand, "%08ld", rand_num % 100000000);
- if (osmo_get_rand_id((uint8_t *) &rand_num, sizeof(rand_num)) != 0)
- rand_num = random();
- sprintf(rand + 8, "%07ld", rand_num % 10000000);
+ sprintf(rand, "%08ld", random() % 100000000);
+ sprintf(rand + 8, "%07ld", random() % 10000000);
strcpy(set->imei + 15 - digits, rand + 15 - digits);
strncpy(set->imeisv, set->imei, 15);