ovpn: notify userspace on client float event
Subsystems (5)
PATCH v2 1/1 ovpn: notify userspace on client float event
Send a netlink notification when a client updates its remote UDP endpoint. The notification includes the new IP address, port, and scope ID (for IPv6).
Signed-off-by Ralf Lici <[email protected]...>
Signed-off-by Antonio Quartulli <[email protected]...>
---
Changes since v1:
- correctly set return value for unsupported AF in ovpn_nl_peer_float_notify
Documentation/netlink/specs/ovpn.yaml | 6 ++ drivers/net/ovpn/netlink.c | 82 +++++++++++++++++++++ drivers/net/ovpn/netlink.h | 2 + drivers/net/ovpn/peer.c | 2 + include/uapi/linux/ovpn.h | 1 + tools/testing/selftests/net/ovpn/ovpn-cli.c | 3 + 6 files changed, 96 insertions(+)
Documentation/netlink/specs/ovpn.yaml +6 -0
@@ -502,6 +502,12 @@ operations: - ifindex - keyconf + - + name: peer-float-ntf + doc: Notification about a peer floating (changing its remote UDP endpoint) + notify: peer-get + mcgrp: peers + mcast-groups: list: -
drivers/net/ovpn/netlink.c +82 -0
88 lines not on this page · raw message
drivers/net/ovpn/netlink.h +2 -0
@@ -13,6 +13,8 @@ int ovpn_nl_register(void);void ovpn_nl_unregister (void );int ovpn_nl_peer_del_notify (struct ovpn_peer *peer); +int ovpn_nl_peer_float_notify (struct ovpn_peer *peer, +const struct sockaddr_storage *ss);int ovpn_nl_key_swap_notify (struct ovpn_peer *peer,u8 key_id);#endif /* _NET_OVPN_NETLINK_H_ */
drivers/net/ovpn/peer.c +2 -0
@@ -287,6 +287,8 @@ void ovpn_peer_endpoints_update(struct ovpn_peer *peer, struct sk_buff *skb)spin_unlock_bh (&peer->lock); +ovpn_nl_peer_float_notify (peer, &ss); +/* rehashing is required only in MP mode as P2P has one peer * only and thus there is no hashtable */
include/uapi/linux/ovpn.h +1 -0
@@ -99,6 +99,7 @@ enum {OVPN_CMD_KEY_SWAP ,OVPN_CMD_KEY_SWAP_NTF ,OVPN_CMD_KEY_DEL , +OVPN_CMD_PEER_FLOAT_NTF , __OVPN_CMD_MAX,OVPN_CMD_MAX = (__OVPN_CMD_MAX -1 )
tools/testing/selftests/net/ovpn/ovpn-cli.c +3 -0
@@ -1516,6 +1516,9 @@ static int ovpn_handle_msg(struct nl_msg *msg, void *arg)case OVPN_CMD_PEER_DEL_NTF :fprintf (stdout,"received CMD_PEER_DEL_NTF\n" );break ; +case OVPN_CMD_PEER_FLOAT_NTF : +fprintf (stdout,"received CMD_PEER_FLOAT_NTF\n" ); +break ;case OVPN_CMD_KEY_SWAP_NTF :fprintf (stdout,"received CMD_KEY_SWAP_NTF\n" );break ;
Signature · 1 line
2.51.1
Quoted 11 lines · Ralf Lici
Send a netlink notification when a client updates its remote UDP endpoint. The notification includes the new IP address, port, and scope ID (for IPv6).
Signed-off-by Ralf Lici <[email protected]...>Signed-off-by Antonio Quartulli <[email protected]...>---
Changes since v1:
- correctly set return value for unsupported AF inovpn_nl_peer_float_notify
Quoted 7 lines
Documentation/netlink/specs/ovpn.yaml | 6 ++ drivers/net/ovpn/netlink.c | 82 +++++++++++++++++++++ drivers/net/ovpn/netlink.h | 2 + drivers/net/ovpn/peer.c | 2 + include/uapi/linux/ovpn.h | 1 + tools/testing/selftests/net/ovpn/ovpn-cli.c | 3 + 6 files changed, 96 insertions(+)
Reviewed-by Sabrina Dubroca <[email protected]...>
Signature · 1 line
Sabrina