[tor-commits] [stem/master] Skip udp addresses with a blank destination

atagar at torproject.org atagar at torproject.org
Mon Feb 1 04:21:04 UTC 2016


commit f31cdcb4e9177fc123f6accd8d932657f57e1545
Author: Damian Johnson <atagar at torproject.org>
Date:   Sat Jan 30 15:21:25 2016 -0800

    Skip udp addresses with a blank destination
    
    We can filter tcp connections by if the connection is established, but for udp
    we need to pick something else. Omitting addresses with a blank destination...
    
     * 127.0.0.1:53 => 0.0.0.0:0 (udp)
     * 0.0.0.0:45768 => 0.0.0.0:0 (udp)
     * 0.0.0.0:5353 => 0.0.0.0:0 (udp)
     * :::5353 => :::0 (udp)
     * :::36611 => :::0 (udp)
---
 stem/util/proc.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/stem/util/proc.py b/stem/util/proc.py
index 40f9ba8..a0ceb8b 100644
--- a/stem/util/proc.py
+++ b/stem/util/proc.py
@@ -381,6 +381,8 @@ def connections(pid = None, user = None):
               continue
             elif protocol == 'tcp' and status != b'01':
               continue  # skip tcp connections that aren't yet established
+            elif protocol == 'udp' and (f_addr == '00000000:0000' or f_addr == '00000000000000000000000000000000:0000'):
+              continue  # skip udp connections with a blank destination
 
             local_ip, local_port = _decode_proc_address_encoding(l_addr, is_ipv6)
             foreign_ip, foreign_port = _decode_proc_address_encoding(f_addr, is_ipv6)





More information about the tor-commits mailing list