History

sunrpc: add netlink upcall for the auth.unix.ip cache

Add netlink-based cache upcall support for the ip_map (auth.unix.ip) cache, using the sunrpc generic netlink family. Add ip-map attribute-set (seqno, class, addr, domain, negative, expiry), ip-map-reqs wrapper, and ip-map-get-reqs / ip-map-set-reqs operations to the sunrpc_cache YAML spec and generated headers. Implement sunrpc_nl_ip_map_get_reqs_dumpit() which snapshots pending ip_map cache requests and sends each entry's seqno, class name, and IP address over netlink. Implement sunrpc_nl_ip_map_set_reqs_doit() which parses ip_map cache responses from userspace (class, addr, expiry, and domain name or negative flag) and updates the cache via __ip_map_lookup() / __ip_map_update(). Wire up ip_map_notify() callback in ip_map_cache_template so cache misses trigger SUNRPC_CMD_CACHE_NOTIFY multicast events with SUNRPC_CACHE_TYPE_IP_MAP.

Jeff Layton committed 7 months ago

Commit 712bdbb1 parent af81cb25 files · +356 −0Browse files

Showing the changes to include/uapi (1 of 5 files). Show all

Unified · Split

include/uapi/linux/sunrpc_netlink.h+21−0
@@ -22,8 +22,29 @@ enum { · 21 unmodified lines
22 SUNRPC_A_CACHE_NOTIFY_MAX = (__SUNRPC_A_CACHE_NOTIFY_MAX - 1)22 SUNRPC_A_CACHE_NOTIFY_MAX = (__SUNRPC_A_CACHE_NOTIFY_MAX - 1)
23};23};
24 24
25enum {
26 SUNRPC_A_IP_MAP_SEQNO = 1,
27 SUNRPC_A_IP_MAP_CLASS,
28 SUNRPC_A_IP_MAP_ADDR,
29 SUNRPC_A_IP_MAP_DOMAIN,
30 SUNRPC_A_IP_MAP_NEGATIVE,
31 SUNRPC_A_IP_MAP_EXPIRY,
32
33 __SUNRPC_A_IP_MAP_MAX,
34 SUNRPC_A_IP_MAP_MAX = (__SUNRPC_A_IP_MAP_MAX - 1)
35};
36
37enum {
38 SUNRPC_A_IP_MAP_REQS_REQUESTS = 1,
39
40 __SUNRPC_A_IP_MAP_REQS_MAX,
41 SUNRPC_A_IP_MAP_REQS_MAX = (__SUNRPC_A_IP_MAP_REQS_MAX - 1)
42};
43
25enum {44enum {
26 SUNRPC_CMD_CACHE_NOTIFY = 1,45 SUNRPC_CMD_CACHE_NOTIFY = 1,
46 SUNRPC_CMD_IP_MAP_GET_REQS,
47 SUNRPC_CMD_IP_MAP_SET_REQS,
27 48
28 __SUNRPC_CMD_MAX,49 __SUNRPC_CMD_MAX,
29 SUNRPC_CMD_MAX = (__SUNRPC_CMD_MAX - 1)50 SUNRPC_CMD_MAX = (__SUNRPC_CMD_MAX - 1)