[08/12] gtp-rtnl: real_ifname is not long needed, remove it

Submitted by Andreas Schultz on April 11, 2016, 2:10 p.m.

Details

Message ID 1460383806-17772-9-git-send-email-aschultz@tpip.net
State New
Series "GTP kernel support"
Delegated to: laforge
Headers show

Commit Message

Andreas Schultz April 11, 2016, 2:10 p.m.
Signed-off-by: Andreas Schultz <aschultz@tpip.net>
---
 libgtnl/include/libgtpnl/gtpnl.h | 3 +--
 libgtnl/src/gtp-rtnl.c           | 4 +---
 libgtnl/tools/gtp-link-add.c     | 5 ++---
 3 files changed, 4 insertions(+), 8 deletions(-)

Patch hide | download patch | download mbox

diff --git a/libgtnl/include/libgtpnl/gtpnl.h b/libgtnl/include/libgtpnl/gtpnl.h
index 3d3fd73..49ba03d 100644
--- a/libgtnl/include/libgtpnl/gtpnl.h
+++ b/libgtnl/include/libgtpnl/gtpnl.h
@@ -16,8 +16,7 @@  int genl_lookup_family(struct mnl_socket *nl, const char *family);
 
 struct in_addr;
 
-int gtp_dev_create(int dest_ns, const char *gtp_ifname, const char *real_ifname,
-		   int fd0, int fd1);
+int gtp_dev_create(int dest_ns, const char *gtp_ifname, int fd0, int fd1);
 int gtp_dev_config(const char *iface, struct in_addr *net, uint32_t prefix);
 int gtp_dev_destroy(const char *gtp_ifname);
 
diff --git a/libgtnl/src/gtp-rtnl.c b/libgtnl/src/gtp-rtnl.c
index 76e2021..527015b 100644
--- a/libgtnl/src/gtp-rtnl.c
+++ b/libgtnl/src/gtp-rtnl.c
@@ -104,8 +104,7 @@  static int gtp_dev_talk(struct nlmsghdr *nlh, uint32_t seq)
 	return ret;
 }
 
-int gtp_dev_create(int dest_ns, const char *gtp_ifname, const char *real_ifname,
-		   int fd0, int fd1)
+int gtp_dev_create(int dest_ns, const char *gtp_ifname, int fd0, int fd1)
 {
 	char buf[MNL_SOCKET_BUFFER_SIZE];
 	struct nlmsghdr *nlh;
@@ -122,7 +121,6 @@  int gtp_dev_create(int dest_ns, const char *gtp_ifname, const char *real_ifname,
 
 	if (dest_ns >= 0)
 		mnl_attr_put_u32(nlh, IFLA_NET_NS_FD, dest_ns);
-	mnl_attr_put_u32(nlh, IFLA_LINK, if_nametoindex(real_ifname));
 	mnl_attr_put_str(nlh, IFLA_IFNAME, gtp_ifname);
 	nest = mnl_attr_nest_start(nlh, IFLA_LINKINFO);
 	mnl_attr_put_str(nlh, IFLA_INFO_KIND, "gtp");
diff --git a/libgtnl/tools/gtp-link-add.c b/libgtnl/tools/gtp-link-add.c
index 3d893eb..4ef025e 100644
--- a/libgtnl/tools/gtp-link-add.c
+++ b/libgtnl/tools/gtp-link-add.c
@@ -43,8 +43,8 @@  int main(int argc, char *argv[])
 	unsigned int seq, portid, change = 0, flags = 0;
 	struct nlattr *nest, *nest2;
 
-	if (argc != 2) {
-		printf("Usage: %s [ifname]\n", argv[0]);
+	if (argc != 1) {
+		printf("Usage: %s\n", argv[0]);
 		exit(EXIT_FAILURE);
 	}
 
@@ -62,7 +62,6 @@  int main(int argc, char *argv[])
 	int fd1 = socket(AF_INET, SOCK_DGRAM, 0);
 	int fd2 = socket(AF_INET, SOCK_DGRAM, 0);
 
-	mnl_attr_put_u32(nlh, IFLA_LINK, if_nametoindex(argv[1]));
 	mnl_attr_put_str(nlh, IFLA_IFNAME, "gtp0");
 	nest = mnl_attr_nest_start(nlh, IFLA_LINKINFO);
 	mnl_attr_put_str(nlh, IFLA_INFO_KIND, "gtp");