diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-05-05 16:57:38 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-05-05 16:57:38 +0800 |
commit | 08db178271fe342771d6ac0a7ed65e44a500d772 (patch) | |
tree | 94553139b8a0f56e6ce0ba7578f774095d3ea0b8 /openbsc/src/nat/bsc_nat.c | |
parent | 936d8c1b6401a329744f5b926b7df87299af3b39 (diff) |
nat: Make ping/pong timeout configurable.
Diffstat (limited to 'openbsc/src/nat/bsc_nat.c')
-rw-r--r-- | openbsc/src/nat/bsc_nat.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c index a60efd07c..b918e0931 100644 --- a/openbsc/src/nat/bsc_nat.c +++ b/openbsc/src/nat/bsc_nat.c @@ -138,13 +138,16 @@ static void bsc_ping_timeout(void *_bsc) { struct bsc_connection *bsc = _bsc; + if (bsc->nat->ping_timeout < 0) + return; + send_ping(bsc); /* send another ping in 20 seconds */ - bsc_schedule_timer(&bsc->ping_timeout, 20, 0); + bsc_schedule_timer(&bsc->ping_timeout, bsc->nat->ping_timeout, 0); /* also start a pong timer */ - bsc_schedule_timer(&bsc->pong_timeout, 5, 0); + bsc_schedule_timer(&bsc->pong_timeout, bsc->nat->pong_timeout, 0); } static void start_ping_pong(struct bsc_connection *bsc) @@ -772,7 +775,7 @@ static int ipaccess_listen_bsc_cb(struct bsc_fd *bfd, unsigned int what) */ bsc->id_timeout.data = bsc; bsc->id_timeout.cb = ipaccess_close_bsc; - bsc_schedule_timer(&bsc->id_timeout, 2, 0); + bsc_schedule_timer(&bsc->id_timeout, nat->auth_timeout, 0); return 0; } |