naccyde / rpms / iproute

Forked from rpms/iproute 5 months ago
Clone

Blame SOURCES/0232-Revert-link-dump-filter.patch

049c96
From 79b2060582ed044feb9d703e9f13c620fb64c389 Mon Sep 17 00:00:00 2001
049c96
From: Phil Sutter <psutter@redhat.com>
049c96
Date: Wed, 3 Aug 2016 13:28:09 +0200
049c96
Subject: [PATCH] Revert "link dump filter"
049c96
049c96
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1288042
049c96
049c96
This reverts commit 83e4e4b09ca5ca91ab54fe983c1786e04b7ba41b.
049c96
---
049c96
 ip/ip_common.h |  1 -
049c96
 ip/ipaddress.c | 13 -------------
049c96
 ip/iplink.c    | 35 -----------------------------------
049c96
 3 files changed, 49 deletions(-)
049c96
049c96
diff --git a/ip/ip_common.h b/ip/ip_common.h
049c96
index 286f61f..42eda66 100644
049c96
--- a/ip/ip_common.h
049c96
+++ b/ip/ip_common.h
049c96
@@ -56,7 +56,6 @@ extern int do_ipl2tp(int argc, char **argv);
049c96
 extern int do_tcp_metrics(int argc, char **argv);
049c96
 extern int do_ipnetconf(int argc, char **argv);
049c96
 extern int do_iptoken(int argc, char **argv);
049c96
-extern int iplink_get(unsigned int flags, char *name, __u32 filt_mask);
049c96
 
049c96
 static inline int rtm_get_table(struct rtmsg *r, struct rtattr **tb)
049c96
 {
049c96
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
049c96
index 112c34b..97a8f2f 100644
049c96
--- a/ip/ipaddress.c
049c96
+++ b/ip/ipaddress.c
049c96
@@ -1400,19 +1400,6 @@ static int ipaddr_list_flush_or_save(int argc, char **argv, int action)
049c96
 		exit(0);
049c96
 	}
049c96
 
049c96
-	/*
049c96
-	 * If only filter_dev present and none of the other
049c96
-	 * link filters are present, use RTM_GETLINK to get
049c96
-	 * the link device
049c96
-	 */
049c96
-	if (filter_dev && filter.group == -1 && do_link == 1) {
049c96
-		if (iplink_get(0, filter_dev, RTEXT_FILTER_VF) < 0) {
049c96
-			perror("Cannot send link get request");
049c96
-			exit(1);
049c96
-		}
049c96
-		exit(0);
049c96
-	}
049c96
-
049c96
 	if (rtnl_wilddump_request(&rth, preferred_family, RTM_GETLINK) < 0) {
049c96
 		perror("Cannot send dump request");
049c96
 		exit(1);
049c96
diff --git a/ip/iplink.c b/ip/iplink.c
049c96
index f49b32e..3dac893 100644
049c96
--- a/ip/iplink.c
049c96
+++ b/ip/iplink.c
049c96
@@ -827,41 +827,6 @@ static int iplink_modify(int cmd, unsigned int flags, int argc, char **argv)
049c96
 	return 0;
049c96
 }
049c96
 
049c96
-int iplink_get(unsigned int flags, char *name, __u32 filt_mask)
049c96
-{
049c96
-	int len;
049c96
-	struct iplink_req req;
049c96
-	struct {
049c96
-		struct nlmsghdr n;
049c96
-		char buf[16384];
049c96
-	} answer;
049c96
-
049c96
-	memset(&req, 0, sizeof(req));
049c96
-
049c96
-	req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg));
049c96
-	req.n.nlmsg_flags = NLM_F_REQUEST|flags;
049c96
-	req.n.nlmsg_type = RTM_GETLINK;
049c96
-	req.i.ifi_family = preferred_family;
049c96
-
049c96
-	if (name) {
049c96
-		len = strlen(name) + 1;
049c96
-		if (len == 1)
049c96
-			invarg("\"\" is not a valid device identifier\n",
049c96
-				   "name");
049c96
-		if (len > IFNAMSIZ)
049c96
-			invarg("\"name\" too long\n", name);
049c96
-		addattr_l(&req.n, sizeof(req), IFLA_IFNAME, name, len);
049c96
-	}
049c96
-	addattr32(&req.n, sizeof(req), IFLA_EXT_MASK, filt_mask);
049c96
-
049c96
-	if (rtnl_talk(&rth, &req.n, &answer.n, sizeof(answer)) < 0)
049c96
-		return -2;
049c96
-
049c96
-	print_linkinfo(NULL, &answer.n, stdout);
049c96
-
049c96
-	return 0;
049c96
-}
049c96
-
049c96
 #if IPLINK_IOCTL_COMPAT
049c96
 static int get_ctl_fd(void)
049c96
 {
049c96
-- 
049c96
1.8.3.1
049c96