diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2015-11-24 13:30:38 +0100 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2015-12-03 11:39:49 +0100 |
commit | 508514c7c5a4cc2d4eae27a7e6df80b10ec4e863 (patch) | |
tree | 8b9e4458d143ba445452b134c42660001658a4d1 /openbsc/src/gprs/gtphub.c | |
parent | 29d926be12fccfb2a0240535d252b7f7d8452df8 (diff) |
gtphub: cosmetic/prepare: add nr_map_refresh().
Sponsored-by: On-Waves ehi
Diffstat (limited to 'openbsc/src/gprs/gtphub.c')
-rw-r--r-- | openbsc/src/gprs/gtphub.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/openbsc/src/gprs/gtphub.c b/openbsc/src/gprs/gtphub.c index 97ccf61ab..0550c7ffe 100644 --- a/openbsc/src/gprs/gtphub.c +++ b/openbsc/src/gprs/gtphub.c @@ -660,10 +660,16 @@ void nr_map_add(struct nr_map *map, struct nr_mapping *mapping, time_t now) /* Add to the tail to always yield a list sorted by expiry, in * ascending order. */ llist_add_tail(&mapping->entry, &map->mappings); - if (map->add_items_to_expiry) - expiry_add(map->add_items_to_expiry, - &mapping->expiry_entry, - now); + nr_map_refresh(map, mapping, now); +} + +void nr_map_refresh(struct nr_map *map, struct nr_mapping *mapping, time_t now) +{ + if (!map->add_items_to_expiry) + return; + expiry_add(map->add_items_to_expiry, + &mapping->expiry_entry, + now); } void nr_map_clear(struct nr_map *map) @@ -1010,9 +1016,7 @@ static struct nr_mapping *gtphub_mapping_have(struct nr_map *map, gtphub_port_str(from), (int)(nrm->orig), (int)(nrm->repl)); } else { - /* restart expiry timeout */ - expiry_add(map->add_items_to_expiry, &nrm->expiry_entry, - now); + nr_map_refresh(map, nrm, now); } OSMO_ASSERT(nrm); |