diff --git a/tests/netlink_route.c b/tests/netlink_route.c index 2b20d339..64fc73ad 100644 --- a/tests/netlink_route.c +++ b/tests/netlink_route.c @@ -31,6 +31,7 @@ #include #include #include +#include #include "test_netlink.h" #ifdef HAVE_LINUX_DCBNL_H # include @@ -45,6 +46,7 @@ # include #endif #include +#include #include #ifdef HAVE_LINUX_NEIGHBOUR_H # include @@ -429,6 +431,22 @@ test_rtnl_netconf(const int fd) } #endif +#ifdef HAVE_STRUCT_BR_PORT_MSG +static void +test_rtnl_mdb(const int fd) +{ + void *const nlh0 = tail_alloc(NLMSG_HDRLEN); + const struct br_port_msg msg = { + .family = AF_UNIX, + .ifindex = IFINDEX_LO + }; + + TEST_NL_ROUTE(fd, nlh0, RTM_GETMDB, msg, + printf("{family=AF_UNIX"), + printf(", ifindex=if_nametoindex(\"lo\")}")); +} +#endif + int main(void) { skip_if_unavailable("/proc/self/fd/"); @@ -458,6 +476,9 @@ int main(void) #ifdef HAVE_STRUCT_NETCONFMSG test_rtnl_netconf(fd); #endif +#ifdef HAVE_STRUCT_BR_PORT_MSG + test_rtnl_mdb(fd); +#endif printf("+++ exited with 0 +++\n");