Hey,
netstat included in the net-tools is more or less obsolete on modern
Linux systems[1] and therefore deprecated in some distributions
already[2].
On linux systems the calls to netstat (for routes and sockets) can be
easily replaced by "ip route" and "ss". (See patch [3] or at the end
of this post)
I now know that "ip" and "ss are Linux-only non-portable programs I
think sshuttle should atleast have an option to change the internally
used program (similar to the "--python" switch).
Jan-Erik
[1]:
http://www.linuxfoundation.org/collaborate/workgroups/networking/net-tools
[2]:
http://www.archlinux.org/news/deprecation-of-net-tools/
[3]:
https://github.com/apenwarr/sshuttle/pull/14
From 8711ae6caf58dea91540942e56b8a3d2d4813441 Mon Sep 17 00:00:00 2001
From: Jan-Erik Rediger <
bad...@archlinux.us>
Date: Sat, 10 Mar 2012 20:09:18 +0100
Subject: [PATCH] replace netstat with "ip route" and "ss"
---
hostwatch.py | 2 +-
server.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/hostwatch.py b/hostwatch.py
index 66e7461..5f57600 100644
--- a/hostwatch.py
+++ b/hostwatch.py
@@ -111,7 +111,7 @@ def _check_dns(hostname):
def _check_netstat():
debug2(' > netstat\n')
- argv = ['netstat', '-n']
+ argv = ['ss']
try:
p = ssubprocess.Popen(argv, stdout=ssubprocess.PIPE,
stderr=null)
content = p.stdout.read()
diff --git a/server.py b/server.py
index e1b327d..122cdd0 100644
--- a/server.py
+++ b/server.py
@@ -47,7 +47,7 @@ def _shl(n, bits):
def _list_routes():
- argv = ['netstat', '-rn']
+ argv = ['ip', 'route']
p = ssubprocess.Popen(argv, stdout=ssubprocess.PIPE)
routes = []
for line in p.stdout:
--
1.7.9.3