From 5a37ff0d0eaccafd55d3121aafb9c8bf92b43fe0 Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Thu, 19 Feb 2015 17:41:09 +0000 Subject: [PATCH] Discourage future readers of iputil.py from using Win32 APIs in preference to route.exe. Signed-off-by: Daira Hopwood --- src/allmydata/util/iputil.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/allmydata/util/iputil.py b/src/allmydata/util/iputil.py index d58c578a..4b90b250 100644 --- a/src/allmydata/util/iputil.py +++ b/src/allmydata/util/iputil.py @@ -142,8 +142,10 @@ def get_local_ip_for(target): # Wow, I'm really amazed at home much mileage we've gotten out of calling # the external route.exe program on windows... It appears to work on all -# versions so far. Still, the real system calls would much be preferred... +# versions so far. # ... thus wrote Greg Smith in time immemorial... +# Also, the Win32 APIs for this are really klunky and error-prone. --Daira + _win32_re = re.compile(r'^\s*\d+\.\d+\.\d+\.\d+\s.+\s(?P
\d+\.\d+\.\d+\.\d+)\s+(?P\d+)\s*$', flags=re.M|re.I|re.S) _win32_commands = (('route.exe', ('print',), _win32_re),) -- 2.37.2