]> git.ipfire.org Git - thirdparty/libnl.git/commitdiff
route: add libnl name prefix to global variable link_policy
authorThomas Haller <thaller@redhat.com>
Thu, 2 Jan 2014 10:00:31 +0000 (11:00 +0100)
committerThomas Haller <thaller@redhat.com>
Thu, 2 Jan 2014 10:56:56 +0000 (11:56 +0100)
Public names should be prefixed with a libnl specific
prefix to avoid name collisions. Rename link_policy to
rtln_link_policy.

Related bugs:
  https://github.com/thom311/libnl/issues/52
  https://bugzilla.gnome.org/show_bug.cgi?id=720902
  https://bugs.gentoo.org/show_bug.cgi?id=494986
  https://bugs.gentoo.org/show_bug.cgi?id=494890

Signed-off-by: Thomas Haller <thaller@redhat.com>
include/netlink/route/link.h
lib/route/link.c
lib/route/link/veth.c

index 29a5df9ba568e7b2d8f7ffc0ce6b1398558054d3..334578734bd76b77e921d8edf70433e65d217b73 100644 (file)
@@ -98,7 +98,7 @@ typedef enum {
 
 #define RTNL_LINK_STATS_MAX (__RTNL_LINK_STATS_MAX - 1)
 
-extern struct nla_policy link_policy[];
+extern struct nla_policy rtln_link_policy[];
 
 extern struct rtnl_link *rtnl_link_alloc(void);
 extern void    rtnl_link_put(struct rtnl_link *);
index 4bcf61546330a91ff8e0f9e21dd96a5d252419a3..9979b5b191ce86790fa4cd680d97ac12952854ee 100644 (file)
@@ -262,7 +262,7 @@ static int link_clone(struct nl_object *_dst, struct nl_object *_src)
        return 0;
 }
 
-struct nla_policy link_policy[IFLA_MAX+1] = {
+struct nla_policy rtln_link_policy[IFLA_MAX+1] = {
        [IFLA_IFNAME]           = { .type = NLA_STRING,
                                    .maxlen = IFNAMSIZ },
        [IFLA_MTU]              = { .type = NLA_U32 },
@@ -481,7 +481,7 @@ static int link_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who,
        int err, family;
        struct nla_policy real_link_policy[IFLA_MAX+1];
 
-       memcpy(&real_link_policy, link_policy, sizeof(link_policy));
+       memcpy(&real_link_policy, rtln_link_policy, sizeof(rtln_link_policy));
 
        link = rtnl_link_alloc();
        if (link == NULL) {
index d5c1926fba378a18ae6e66b31cdb54488c78b631..4ce1f10c7846c0e81c381817c36188af3189e12f 100644 (file)
@@ -65,7 +65,7 @@ static int veth_parse(struct rtnl_link *link, struct nlattr *data,
                err = nla_parse(peer_tb, IFLA_MAX,
                                nla_data(nla_peer) + sizeof(struct ifinfomsg),
                                nla_len(nla_peer) - sizeof(struct ifinfomsg),
-                               link_policy);
+                               rtln_link_policy);
                if (err < 0)
                        goto errout;