Skip to content

Commit

Permalink
txDevITelexSrv.py: Tighten own Telex number check
Browse files Browse the repository at this point in the history
i-Telex numbers must not only fit into a 32-bit integer, but must also
be at least five digits long (no leading noughts). Tighten the check
accordingly.
  • Loading branch information
b-schliessmann committed Jan 16, 2022
1 parent 381b601 commit a776dd9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions txDevITelexSrv.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ def __init__(self, **params):
self._number = int(params.get('number', 0))
if self._number:
l.warning("Configuration option \"number\" is deprecated and will be removed in a future version. Use \"tns-dynip-number\" instead.")
if self._number <= 0 or self._number > 0xffffffff:
# Own number no valid integer inside 32 bit; client_update requires
# this though, so ignore
if self._number < 10000 or self._number > 0xffffffff:
# Own number must be a valid 32-bit integer with at least 5 digits.
# client_update requires this, so ignore faulty number
l.warning("Invalid own number, ignored: " + repr(self._number))
self._number = None

Expand Down

0 comments on commit a776dd9

Please sign in to comment.