route: remove unnecessary include of private linux/if.h 39/205239/1 accepted/tizen/unified/20190503.040749 submit/tizen/20190502.123334
authorDavid Chappelle <dchappelle@topologyinc.com>
Tue, 30 Apr 2019 14:02:30 +0000 (19:32 +0530)
committerNishant Chaprana <n.chaprana@samsung.com>
Tue, 30 Apr 2019 14:02:30 +0000 (19:32 +0530)
Including linux/if.h in netlink/route/link.h causes issues
in cases where libnl is used in conjuntion with other third
party libraries that include net/if.h. Seems to be a long
checkered history of symbol collisions between these two
files. As it turns out, including linux/if.h from within
netlink/route/link.h is actually unecessary. I resurrected
a forgotten path from this thread:

    http://lists.infradead.org/pipermail/libnl/2012-April/000525.html

By removing the include as the patch suggests we can get
around the nuissance of the symbol collisions.

https://github.com/thom311/libnl/pull/73

Note: This patch is backported from
http://git.infradead.org/users/tgr/libnl.git/patch/50a76998ac36ace3716d3c979b352fac73cfc80a

Change-Id: I6651c84e55870963825180c2732de581e6bb0ab6
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
include/netlink/route/link.h
src/nl-link-set.c

index 321a80d..ef863f9 100644 (file)
@@ -15,7 +15,6 @@
 #include <netlink/netlink.h>
 #include <netlink/cache.h>
 #include <netlink/addr.h>
-#include <linux/if.h>
 
 #ifdef __cplusplus
 extern "C" {
index 3178a98..42d5fa1 100644 (file)
@@ -9,6 +9,7 @@
  * Copyright (c) 2003-2010 Thomas Graf <tgraf@suug.ch>
  */
 
+#include <linux/if.h>
 #include <netlink/cli/utils.h>
 #include <netlink/cli/link.h>