[PATCH] lib/route: Export correct ipgre functionality

Jef Oliver jef.oliver at intel.com
Wed Oct 5 13:20:35 PDT 2016


* Rename rtnl_link_get_pmtudisc to rtnl_link_ipgre_get_pmtudisc
  in ipgre.c, making the function correctly match the exported
  functionality in ipgre.h. This fixes an error when trying to
  use the function, returning an incorrect type usage due to the
  link module already having a function of the same name.

* Export rtnl_link_is_[ipgre/ipgretap] allowing for usage per
  documentation.

Reported-by: Sharada Shiddibhavi <sharada.shiddibhavi at intel.com>
Signed-off-by: Jef Oliver <jef.oliver at intel.com>
---
 include/netlink/route/link/ipgre.h | 3 +++
 lib/route/link/ipgre.c             | 2 +-
 libnl-route-3.sym                  | 2 ++
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/netlink/route/link/ipgre.h b/include/netlink/route/link/ipgre.h
index 647c3cf..4c5f86b 100644
--- a/include/netlink/route/link/ipgre.h
+++ b/include/netlink/route/link/ipgre.h
@@ -19,6 +19,9 @@
 extern "C" {
 #endif
 
+	extern int rtnl_link_is_ipgre(struct rtnl_link *link);
+	extern int rtnl_link_is_ipgretap(struct rtnl_link *link);
+
 	extern struct rtnl_link *rtnl_link_ipgre_alloc(void);
 	extern struct rtnl_link *rtnl_link_ipgretap_alloc(void);
 	extern int rtnl_link_ipgre_add(struct nl_sock *sk, const char *name);
diff --git a/lib/route/link/ipgre.c b/lib/route/link/ipgre.c
index 7dca4d5..184f37a 100644
--- a/lib/route/link/ipgre.c
+++ b/lib/route/link/ipgre.c
@@ -809,7 +809,7 @@ int rtnl_link_ipgre_set_pmtudisc(struct rtnl_link *link, uint8_t pmtudisc)
  *
  * @return pmtudisc value
  */
-uint8_t rtnl_link_get_pmtudisc(struct rtnl_link *link)
+uint8_t rtnl_link_ipgre_get_pmtudisc(struct rtnl_link *link)
 {
 	struct ipgre_info *ipgre = link->l_info;
 
diff --git a/libnl-route-3.sym b/libnl-route-3.sym
index 448a617..a56828f 100644
--- a/libnl-route-3.sym
+++ b/libnl-route-3.sym
@@ -956,6 +956,8 @@ global:
 	rtnl_link_bridge_set_hwmode;
 	rtnl_link_bridge_hwmode2str;
 	rtnl_link_bridge_str2hwmode;
+	rtnl_link_ipgre_get_pmtudisc;
+	rtnl_link_is_ipgretap;
 	rtnl_link_macvlan_add_macaddr;
 	rtnl_link_macvlan_count_macaddr;
 	rtnl_link_macvlan_del_macaddr;
-- 
2.10.0




More information about the libnl mailing list