summaryrefslogtreecommitdiff
path: root/zebra/if_netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/if_netlink.c')
-rw-r--r--zebra/if_netlink.c55
1 files changed, 45 insertions, 10 deletions
diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c
index be7a5ac78d..660fad6530 100644
--- a/zebra/if_netlink.c
+++ b/zebra/if_netlink.c
@@ -38,6 +38,7 @@
#include "vrf.h"
#include "mpls.h"
+#include "vty.h"
#include "zebra/zserv.h"
#include "zebra/zebra_ns.h"
#include "zebra/zebra_vrf.h"
@@ -172,6 +173,48 @@ netlink_to_zebra_link_type (unsigned int hwt)
}
}
+
+//Temporary Assignments to compile on older platforms.
+#ifndef IFLA_BR_MAX
+#define IFLA_BR_MAX 39
+#endif
+
+#ifndef IFLA_VXLAN_ID
+#define IFLA_VXLAN_ID 1
+#endif
+
+#ifndef IFLA_VXLAN_LOCAL
+#define IFLA_VXLAN_LOCAL 4
+#endif
+
+#ifndef IFLA_VXLAN_MAX
+#define IFLA_VXLAN_MAX 26
+#endif
+
+#ifndef IFLA_BRIDGE_MAX
+#define IFLA_BRIDGE_MAX 2
+#endif
+
+#ifndef IFLA_BRIDGE_VLAN_INFO
+#define IFLA_BRIDGE_VLAN_INFO 2
+#endif
+
+#ifndef BRIDGE_VLAN_INFO_PVID
+#define BRIDGE_VLAN_INFO_PVID (1<<1)
+#endif
+
+#ifndef RTEXT_FILTER_BRVLAN
+#define RTEXT_FILTER_BRVLAN (1<<1)
+#endif
+
+#ifndef NTF_SELF
+#define NTF_SELF 0x02
+#endif
+
+#ifndef IFLA_BR_VLAN_FILTERING
+#define IFLA_BR_VLAN_FILTERING 7
+#endif
+
#define parse_rtattr_nested(tb, max, rta) \
netlink_parse_rtattr((tb), (max), RTA_DATA(rta), RTA_PAYLOAD(rta))
@@ -372,7 +415,6 @@ interface_lookup_netlink (struct zebra_ns *zns)
if (ret < 0)
return ret;
-#ifdef HAVE_IPV6
/* Get IPv6 address of the interfaces. */
ret = netlink_request (AF_INET6, RTM_GETADDR, &zns->netlink_cmd);
if (ret < 0)
@@ -380,7 +422,6 @@ interface_lookup_netlink (struct zebra_ns *zns)
ret = netlink_parse_info (netlink_interface_addr, &zns->netlink_cmd, zns, 0);
if (ret < 0)
return ret;
-#endif /* HAVE_IPV6 */
return 0;
}
@@ -434,7 +475,7 @@ netlink_address (int cmd, int family, struct interface *ifp,
addattr_l (&req.n, sizeof req, IFA_LABEL, ifc->label,
strlen (ifc->label) + 1);
- return netlink_talk (&req.n, &zns->netlink_cmd, zns);
+ return netlink_talk (netlink_talk_filter, &req.n, &zns->netlink_cmd, zns);
}
int
@@ -466,11 +507,7 @@ netlink_interface_addr (struct sockaddr_nl *snl, struct nlmsghdr *h,
zns = zebra_ns_lookup (ns_id);
ifa = NLMSG_DATA (h);
- if (ifa->ifa_family != AF_INET
-#ifdef HAVE_IPV6
- && ifa->ifa_family != AF_INET6
-#endif /* HAVE_IPV6 */
- )
+ if (ifa->ifa_family != AF_INET && ifa->ifa_family != AF_INET6)
return 0;
if (h->nlmsg_type != RTM_NEWADDR && h->nlmsg_type != RTM_DELADDR)
@@ -570,7 +607,6 @@ netlink_interface_addr (struct sockaddr_nl *snl, struct nlmsghdr *h,
(struct in_addr *) addr, ifa->ifa_prefixlen,
(struct in_addr *) broad);
}
-#ifdef HAVE_IPV6
if (ifa->ifa_family == AF_INET6)
{
if (h->nlmsg_type == RTM_NEWADDR)
@@ -588,7 +624,6 @@ netlink_interface_addr (struct sockaddr_nl *snl, struct nlmsghdr *h,
(struct in6_addr *) addr, ifa->ifa_prefixlen,
(struct in6_addr *) broad);
}
-#endif /* HAVE_IPV6 */
return 0;
}