Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the config translation for GTP path options #454

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions apps/ergw/src/ergw_compat.erl
Original file line number Diff line number Diff line change
Expand Up @@ -893,12 +893,23 @@ gtp_proxy_ds_translate_option(Opt, Value) ->
]).

gtp_path_translate_options(Values) ->
#{idle_echo := IdleEcho, idle_timeout := IdleTimeout,
#{t3 := T3, n3 := N3,
echo := BusyEcho,
icmp_error_handling := ICMP,
idle_echo := IdleEcho, idle_timeout := IdleTimeout,
down_echo := DownEcho, down_timeout := DownTimeout} =
C0 = translate_options(fun gtp_path_translate_option/2, Values, ?PathDefaults, map),
C1 = maps:without([idle_echo, idle_timeout, down_echo, down_timeout], C0),
C1#{idle => #{echo => IdleEcho, timeout => IdleTimeout},
down => #{echo => DownEcho, timeout => DownTimeout}}.
translate_options(fun gtp_path_translate_option/2, Values, ?PathDefaults, map),

Evs0 = #{icmp_error => warning, echo_timeout => critical},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't QA using a value of info for the icmp_error?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is used only for the conversion of old (v2.8.x) configs. The old config does not have a value for this and this mirrors the defaults use in ergw_config.

Events = case ICMP of
immediate -> Evs0#{icmp_error := critical};
_ -> Evs0
end,
SetS = #{t3 => T3, n3 => N3, events => Events},
#{busy => SetS#{echo => BusyEcho},
idle => SetS#{echo => IdleEcho, timeout => IdleTimeout},
down => SetS#{echo => DownEcho, timeout => DownTimeout, notify => active},
suspect => SetS#{echo => 60 * 1000, timeout => 300 * 1000}}.

gtp_path_translate_echo(_Opt, Value) when is_integer(Value), Value >= 60 * 1000 ->
Value;
Expand Down