sgsn: Fix echo timer not started upon first pdp ctx created

Commit 176a4d2f33865a5c0433f8679f5e68f209d7b874 moved echo timer related
code to its own function but did some mistakes when moving the logic
from several places into its own function. As a result, echo timer was
only enabled after the 2nd pdp ctx was created, instead of the expected
1st.
First, let's be consistent and always call the function *after* changing
state, since that's what the function expects. This fixes the issue.

Finally make the logic in the function more intuitive by checking in the
if clause the only case where actually the echo timer should be enabled:
Only if policy specifies so and we have at least 1 pdp ctx against that ggsn.

Fixes: 176a4d2f33865a5c0433f8679f5e68f209d7b874
Change-Id: I826030978edb61ea5a172c2b72f63758206a6246
This commit is contained in:
Pau Espin 2019-05-27 18:04:02 +02:00 committed by Harald Welte
parent a8459de1ef
commit 226b4bc58a

Diff Content Not Available