summaryrefslogtreecommitdiffstats
path: root/net/tipc/netlink.c
diff options
context:
space:
mode:
authorRichard Alpe <richard.alpe@ericsson.com>2016-08-26 10:52:56 +0200
committerDavid S. Miller <davem@davemloft.net>2016-08-26 21:38:41 -0700
commit832629ca5c313e122b22b8e73a6d80f111b1a1ae (patch)
treed493c51cbc2bdf880e452f4a21430fbc47ee128e /net/tipc/netlink.c
parentfdb3accc2c15fabc2b687b2819da9167027c61b6 (diff)
downloadlinux-832629ca5c313e122b22b8e73a6d80f111b1a1ae.tar.bz2
tipc: add UDP remoteip dump to netlink API
When using replicast a UDP bearer can have an arbitrary amount of remote ip addresses associated with it. This means we cannot simply add all remote ip addresses to an existing bearer data message as it might fill the message, leaving us with a truncated message that we can't safely resume. To handle this we introduce the new netlink command TIPC_NL_UDP_GET_REMOTEIP. This command is intended to be called when the bearer data message has the TIPC_NLA_UDP_MULTI_REMOTEIP flag set, indicating there are more than one remote ip (replicast). Signed-off-by: Richard Alpe <richard.alpe@ericsson.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/netlink.c')
-rw-r--r--net/tipc/netlink.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/net/tipc/netlink.c b/net/tipc/netlink.c
index 3122f21ca979..3200059d14b2 100644
--- a/net/tipc/netlink.c
+++ b/net/tipc/netlink.c
@@ -41,6 +41,7 @@
#include "link.h"
#include "node.h"
#include "net.h"
+#include "udp_media.h"
#include <net/genetlink.h>
static const struct nla_policy tipc_nl_policy[TIPC_NLA_MAX + 1] = {
@@ -247,7 +248,14 @@ static const struct genl_ops tipc_genl_v2_ops[] = {
.cmd = TIPC_NL_PEER_REMOVE,
.doit = tipc_nl_peer_rm,
.policy = tipc_nl_policy,
- }
+ },
+#ifdef CONFIG_TIPC_MEDIA_UDP
+ {
+ .cmd = TIPC_NL_UDP_GET_REMOTEIP,
+ .dumpit = tipc_udp_nl_dump_remoteip,
+ .policy = tipc_nl_policy,
+ },
+#endif
};
int tipc_nlmsg_parse(const struct nlmsghdr *nlh, struct nlattr ***attr)