Skip to content

NetAddress fixup

Christopher Schinnerl requested to merge gateway-netaddress-fix into master

Created by: VoidingWarranties

Cleans up the NetAddress type. The main change is adding to the IsValid() method, which checks whether a NetAddress is a valid address. Valid is defined as being of the form "host:port" such that "host" is not a loopback address (except in testing) nor an unspecified IP address, and such that neither the host nor port are blank, contain white space, or contain the null character.

Previously some methods allowed loopback addresses in testing while others did not. This change makes loopback addresses always valid in testing only. This allows us to get rid of some kludges in the gateway testing.

Fixes #1040 (closed)

Merge request reports