Patchwork [iproute,v2,3/3] ss: Drop filter_default_dbs()

login
register
mail settings
Submitter Phil Sutter
Date March 27, 2018, 11:51 p.m.
Message ID <20180327235156.16680-4-phil@nwl.cc>
Download mbox | patch
Permalink /patch/486169/
State New
Headers show

Comments

Phil Sutter - March 27, 2018, 11:51 p.m.
Instead call filter_db_parse(..., "all"). This eliminates the duplicate
default DB definition.

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 misc/ss.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

Patch

diff --git a/misc/ss.c b/misc/ss.c
index 83e476a0407e5..fc8e2a0d719fd 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -408,23 +408,6 @@  static int filter_af_get(struct filter *f, int af)
 	return !!(f->families & FAMILY_MASK(af));
 }
 
-static void filter_default_dbs(struct filter *f, bool enable)
-{
-	filter_db_set(f, UDP_DB, enable);
-	filter_db_set(f, DCCP_DB, enable);
-	filter_db_set(f, TCP_DB, enable);
-	filter_db_set(f, RAW_DB, enable);
-	filter_db_set(f, UNIX_ST_DB, enable);
-	filter_db_set(f, UNIX_DG_DB, enable);
-	filter_db_set(f, UNIX_SQ_DB, enable);
-	filter_db_set(f, PACKET_R_DB, enable);
-	filter_db_set(f, PACKET_DG_DB, enable);
-	filter_db_set(f, NETLINK_DB, enable);
-	filter_db_set(f, SCTP_DB, enable);
-	filter_db_set(f, VSOCK_ST_DB, enable);
-	filter_db_set(f, VSOCK_DG_DB, enable);
-}
-
 static void filter_states_set(struct filter *f, int states)
 {
 	if (states)
@@ -4934,7 +4917,7 @@  int main(int argc, char *argv[])
 
 	if (do_default) {
 		state_filter = state_filter ? state_filter : SS_CONN;
-		filter_default_dbs(&current_filter, true);
+		filter_db_parse(&current_filter, "all");
 	}
 
 	filter_states_set(&current_filter, state_filter);