netutils: make re class attribute and catch IndexError
These missing changes were initially agreed upon but then forgotten. First, we move the valid name regex to the class-level such that it won't be compiled for every invocation of GetIP() and we wrap the result of getaddrinfo() into a try/except to catch a possible IndexError. Signed-off-by:Manuel Franceschini <livewire@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
Loading
Please register or sign in to comment