[13/16] gtp-rtnl: real_ifname is not long needed, remove it
diff mbox

Message ID 1447686417-3979-14-git-send-email-aschultz@tpip.net
State Changes Requested
Delegated to: Pablo Neira
Headers show

Commit Message

Andreas Schultz Nov. 16, 2015, 3:06 p.m. UTC
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(-)

Comments

Neels Hofmeyr Nov. 19, 2015, 12:41 p.m. UTC | #1
log message: "no longer needed" ?

~Neels
Pablo Neira Ayuso Nov. 19, 2015, 4:38 p.m. UTC | #2
On Thu, Nov 19, 2015 at 01:41:05PM +0100, Neels Hofmeyr wrote:
> log message: "no longer needed" ?

Please, no more English description corrections. This is good enough
to understand the intention. Thank you.
Neels Hofmeyr Nov. 23, 2015, 10:35 a.m. UTC | #3
On Thu, Nov 19, 2015 at 05:38:16PM +0100, Pablo Neira Ayuso wrote:
> On Thu, Nov 19, 2015 at 01:41:05PM +0100, Neels Hofmeyr wrote:
> > log message: "no longer needed" ?
> 
> Please, no more English description corrections. This is good enough
> to understand the intention. Thank you.

Acknowledged.

Please do correct my own comments/log typos, if you find any.

Thanks!

~Neels

Patch
diff 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 db54653..0999aa3 100644
--- a/libgtnl/src/gtp-rtnl.c
+++ b/libgtnl/src/gtp-rtnl.c
@@ -108,8 +108,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;
@@ -126,7 +125,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");