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
2222 SUNRPC_A_CACHE_NOTIFY_MAX = (__SUNRPC_A_CACHE_NOTIFY_MAX - 1)
2323 };
2424
25+enum {
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+
37+enum {
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+
2544 enum {
2645 SUNRPC_CMD_CACHE_NOTIFY = 1,
46+ SUNRPC_CMD_IP_MAP_GET_REQS,
47+ SUNRPC_CMD_IP_MAP_SET_REQS,
2748
2849 __SUNRPC_CMD_MAX,
2950 SUNRPC_CMD_MAX = (__SUNRPC_CMD_MAX - 1)