From d1287e379b284f5b27baa1edb185e0b74a221a7d Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sun, 2 May 2010 18:58:10 +0800 Subject: nat: Do not allow a BSC to send auth messages twice. --- openbsc/src/nat/bsc_nat.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c index 1cca8bacc..d9cf5e54f 100644 --- a/openbsc/src/nat/bsc_nat.c +++ b/openbsc/src/nat/bsc_nat.c @@ -477,6 +477,12 @@ static void ipaccess_auth_bsc(struct tlv_parsed *tvp, struct bsc_connection *bsc struct bsc_config *conf; const char* token = (const char *) TLVP_VAL(tvp, IPAC_IDTAG_UNITNAME); + if (bsc->cfg) { + LOGP(DNAT, LOGL_ERROR, "Reauth on fd %d bsc nr %d\n", + bsc->write_queue.bfd.fd, bsc->cfg->nr); + return; + } + llist_for_each_entry(conf, &bsc->nat->bsc_configs, entry) { if (strcmp(conf->token, token) == 0) { counter_inc(conf->stats.net.reconn); -- cgit v1.2.3