Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: nfnetlink: extended ACK reporting

Pass down struct netlink_ext_ack as parameter to all of our nfnetlink
subsystem callbacks, so we can work on follow up patches to provide
finer grain error reporting using the new infrastructure that
2d4bc93368f5 ("netlink: extended ACK reporting") provides.

No functional change, just pass down this new object to callbacks.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

+152 -76
+6 -4
include/linux/netfilter/nfnetlink.h
··· 1 1 #ifndef _NFNETLINK_H 2 2 #define _NFNETLINK_H 3 3 4 - 5 4 #include <linux/netlink.h> 6 5 #include <linux/capability.h> 7 6 #include <net/netlink.h> ··· 9 10 struct nfnl_callback { 10 11 int (*call)(struct net *net, struct sock *nl, struct sk_buff *skb, 11 12 const struct nlmsghdr *nlh, 12 - const struct nlattr * const cda[]); 13 + const struct nlattr * const cda[], 14 + struct netlink_ext_ack *extack); 13 15 int (*call_rcu)(struct net *net, struct sock *nl, struct sk_buff *skb, 14 16 const struct nlmsghdr *nlh, 15 - const struct nlattr * const cda[]); 17 + const struct nlattr * const cda[], 18 + struct netlink_ext_ack *extack); 16 19 int (*call_batch)(struct net *net, struct sock *nl, struct sk_buff *skb, 17 20 const struct nlmsghdr *nlh, 18 - const struct nlattr * const cda[]); 21 + const struct nlattr * const cda[], 22 + struct netlink_ext_ack *extack); 19 23 const struct nla_policy *policy; /* netlink attribute policy */ 20 24 const u_int16_t attr_count; /* number of nlattr's */ 21 25 };
+26 -13
net/netfilter/ipset/ip_set_core.c
··· 841 841 842 842 static int ip_set_none(struct net *net, struct sock *ctnl, struct sk_buff *skb, 843 843 const struct nlmsghdr *nlh, 844 - const struct nlattr * const attr[]) 844 + const struct nlattr * const attr[], 845 + struct netlink_ext_ack *extack) 845 846 { 846 847 return -EOPNOTSUPP; 847 848 } 848 849 849 850 static int ip_set_create(struct net *net, struct sock *ctnl, 850 851 struct sk_buff *skb, const struct nlmsghdr *nlh, 851 - const struct nlattr * const attr[]) 852 + const struct nlattr * const attr[], 853 + struct netlink_ext_ack *extack) 852 854 { 853 855 struct ip_set_net *inst = ip_set_pernet(net); 854 856 struct ip_set *set, *clash = NULL; ··· 991 989 992 990 static int ip_set_destroy(struct net *net, struct sock *ctnl, 993 991 struct sk_buff *skb, const struct nlmsghdr *nlh, 994 - const struct nlattr * const attr[]) 992 + const struct nlattr * const attr[], 993 + struct netlink_ext_ack *extack) 995 994 { 996 995 struct ip_set_net *inst = ip_set_pernet(net); 997 996 struct ip_set *s; ··· 1070 1067 1071 1068 static int ip_set_flush(struct net *net, struct sock *ctnl, struct sk_buff *skb, 1072 1069 const struct nlmsghdr *nlh, 1073 - const struct nlattr * const attr[]) 1070 + const struct nlattr * const attr[], 1071 + struct netlink_ext_ack *extack) 1074 1072 { 1075 1073 struct ip_set_net *inst = ip_set_pernet(net); 1076 1074 struct ip_set *s; ··· 1110 1106 1111 1107 static int ip_set_rename(struct net *net, struct sock *ctnl, 1112 1108 struct sk_buff *skb, const struct nlmsghdr *nlh, 1113 - const struct nlattr * const attr[]) 1109 + const struct nlattr * const attr[], 1110 + struct netlink_ext_ack *extack) 1114 1111 { 1115 1112 struct ip_set_net *inst = ip_set_pernet(net); 1116 1113 struct ip_set *set, *s; ··· 1160 1155 1161 1156 static int ip_set_swap(struct net *net, struct sock *ctnl, struct sk_buff *skb, 1162 1157 const struct nlmsghdr *nlh, 1163 - const struct nlattr * const attr[]) 1158 + const struct nlattr * const attr[], 1159 + struct netlink_ext_ack *extack) 1164 1160 { 1165 1161 struct ip_set_net *inst = ip_set_pernet(net); 1166 1162 struct ip_set *from, *to; ··· 1434 1428 1435 1429 static int ip_set_dump(struct net *net, struct sock *ctnl, struct sk_buff *skb, 1436 1430 const struct nlmsghdr *nlh, 1437 - const struct nlattr * const attr[]) 1431 + const struct nlattr * const attr[], 1432 + struct netlink_ext_ack *extack) 1438 1433 { 1439 1434 if (unlikely(protocol_failed(attr))) 1440 1435 return -IPSET_ERR_PROTOCOL; ··· 1520 1513 1521 1514 static int ip_set_uadd(struct net *net, struct sock *ctnl, struct sk_buff *skb, 1522 1515 const struct nlmsghdr *nlh, 1523 - const struct nlattr * const attr[]) 1516 + const struct nlattr * const attr[], 1517 + struct netlink_ext_ack *extack) 1524 1518 { 1525 1519 struct ip_set_net *inst = ip_set_pernet(net); 1526 1520 struct ip_set *set; ··· 1575 1567 1576 1568 static int ip_set_udel(struct net *net, struct sock *ctnl, struct sk_buff *skb, 1577 1569 const struct nlmsghdr *nlh, 1578 - const struct nlattr * const attr[]) 1570 + const struct nlattr * const attr[], 1571 + struct netlink_ext_ack *extack) 1579 1572 { 1580 1573 struct ip_set_net *inst = ip_set_pernet(net); 1581 1574 struct ip_set *set; ··· 1630 1621 1631 1622 static int ip_set_utest(struct net *net, struct sock *ctnl, struct sk_buff *skb, 1632 1623 const struct nlmsghdr *nlh, 1633 - const struct nlattr * const attr[]) 1624 + const struct nlattr * const attr[], 1625 + struct netlink_ext_ack *extack) 1634 1626 { 1635 1627 struct ip_set_net *inst = ip_set_pernet(net); 1636 1628 struct ip_set *set; ··· 1666 1656 1667 1657 static int ip_set_header(struct net *net, struct sock *ctnl, 1668 1658 struct sk_buff *skb, const struct nlmsghdr *nlh, 1669 - const struct nlattr * const attr[]) 1659 + const struct nlattr * const attr[], 1660 + struct netlink_ext_ack *extack) 1670 1661 { 1671 1662 struct ip_set_net *inst = ip_set_pernet(net); 1672 1663 const struct ip_set *set; ··· 1723 1712 1724 1713 static int ip_set_type(struct net *net, struct sock *ctnl, struct sk_buff *skb, 1725 1714 const struct nlmsghdr *nlh, 1726 - const struct nlattr * const attr[]) 1715 + const struct nlattr * const attr[], 1716 + struct netlink_ext_ack *extack) 1727 1717 { 1728 1718 struct sk_buff *skb2; 1729 1719 struct nlmsghdr *nlh2; ··· 1782 1770 1783 1771 static int ip_set_protocol(struct net *net, struct sock *ctnl, 1784 1772 struct sk_buff *skb, const struct nlmsghdr *nlh, 1785 - const struct nlattr * const attr[]) 1773 + const struct nlattr * const attr[], 1774 + struct netlink_ext_ack *extack) 1786 1775 { 1787 1776 struct sk_buff *skb2; 1788 1777 struct nlmsghdr *nlh2;
+26 -13
net/netfilter/nf_conntrack_netlink.c
··· 1127 1127 static int ctnetlink_del_conntrack(struct net *net, struct sock *ctnl, 1128 1128 struct sk_buff *skb, 1129 1129 const struct nlmsghdr *nlh, 1130 - const struct nlattr * const cda[]) 1130 + const struct nlattr * const cda[], 1131 + struct netlink_ext_ack *extack) 1131 1132 { 1132 1133 struct nf_conntrack_tuple_hash *h; 1133 1134 struct nf_conntrack_tuple tuple; ··· 1180 1179 static int ctnetlink_get_conntrack(struct net *net, struct sock *ctnl, 1181 1180 struct sk_buff *skb, 1182 1181 const struct nlmsghdr *nlh, 1183 - const struct nlattr * const cda[]) 1182 + const struct nlattr * const cda[], 1183 + struct netlink_ext_ack *extack) 1184 1184 { 1185 1185 struct nf_conntrack_tuple_hash *h; 1186 1186 struct nf_conntrack_tuple tuple; ··· 1342 1340 static int ctnetlink_get_ct_dying(struct net *net, struct sock *ctnl, 1343 1341 struct sk_buff *skb, 1344 1342 const struct nlmsghdr *nlh, 1345 - const struct nlattr * const cda[]) 1343 + const struct nlattr * const cda[], 1344 + struct netlink_ext_ack *extack) 1346 1345 { 1347 1346 if (nlh->nlmsg_flags & NLM_F_DUMP) { 1348 1347 struct netlink_dump_control c = { ··· 1365 1362 static int ctnetlink_get_ct_unconfirmed(struct net *net, struct sock *ctnl, 1366 1363 struct sk_buff *skb, 1367 1364 const struct nlmsghdr *nlh, 1368 - const struct nlattr * const cda[]) 1365 + const struct nlattr * const cda[], 1366 + struct netlink_ext_ack *extack) 1369 1367 { 1370 1368 if (nlh->nlmsg_flags & NLM_F_DUMP) { 1371 1369 struct netlink_dump_control c = { ··· 1905 1901 static int ctnetlink_new_conntrack(struct net *net, struct sock *ctnl, 1906 1902 struct sk_buff *skb, 1907 1903 const struct nlmsghdr *nlh, 1908 - const struct nlattr * const cda[]) 1904 + const struct nlattr * const cda[], 1905 + struct netlink_ext_ack *extack) 1909 1906 { 1910 1907 struct nf_conntrack_tuple otuple, rtuple; 1911 1908 struct nf_conntrack_tuple_hash *h = NULL; ··· 2071 2066 static int ctnetlink_stat_ct_cpu(struct net *net, struct sock *ctnl, 2072 2067 struct sk_buff *skb, 2073 2068 const struct nlmsghdr *nlh, 2074 - const struct nlattr * const cda[]) 2069 + const struct nlattr * const cda[], 2070 + struct netlink_ext_ack *extack) 2075 2071 { 2076 2072 if (nlh->nlmsg_flags & NLM_F_DUMP) { 2077 2073 struct netlink_dump_control c = { ··· 2117 2111 2118 2112 static int ctnetlink_stat_ct(struct net *net, struct sock *ctnl, 2119 2113 struct sk_buff *skb, const struct nlmsghdr *nlh, 2120 - const struct nlattr * const cda[]) 2114 + const struct nlattr * const cda[], 2115 + struct netlink_ext_ack *extack) 2121 2116 { 2122 2117 struct sk_buff *skb2; 2123 2118 int err; ··· 2780 2773 static int ctnetlink_dump_exp_ct(struct net *net, struct sock *ctnl, 2781 2774 struct sk_buff *skb, 2782 2775 const struct nlmsghdr *nlh, 2783 - const struct nlattr * const cda[]) 2776 + const struct nlattr * const cda[], 2777 + struct netlink_ext_ack *extack) 2784 2778 { 2785 2779 int err; 2786 2780 struct nfgenmsg *nfmsg = nlmsg_data(nlh); ··· 2825 2817 2826 2818 static int ctnetlink_get_expect(struct net *net, struct sock *ctnl, 2827 2819 struct sk_buff *skb, const struct nlmsghdr *nlh, 2828 - const struct nlattr * const cda[]) 2820 + const struct nlattr * const cda[], 2821 + struct netlink_ext_ack *extack) 2829 2822 { 2830 2823 struct nf_conntrack_tuple tuple; 2831 2824 struct nf_conntrack_expect *exp; ··· 2838 2829 2839 2830 if (nlh->nlmsg_flags & NLM_F_DUMP) { 2840 2831 if (cda[CTA_EXPECT_MASTER]) 2841 - return ctnetlink_dump_exp_ct(net, ctnl, skb, nlh, cda); 2832 + return ctnetlink_dump_exp_ct(net, ctnl, skb, nlh, cda, 2833 + extack); 2842 2834 else { 2843 2835 struct netlink_dump_control c = { 2844 2836 .dump = ctnetlink_exp_dump_table, ··· 2907 2897 2908 2898 static int ctnetlink_del_expect(struct net *net, struct sock *ctnl, 2909 2899 struct sk_buff *skb, const struct nlmsghdr *nlh, 2910 - const struct nlattr * const cda[]) 2900 + const struct nlattr * const cda[], 2901 + struct netlink_ext_ack *extack) 2911 2902 { 2912 2903 struct nf_conntrack_expect *exp; 2913 2904 struct nf_conntrack_tuple tuple; ··· 3196 3185 3197 3186 static int ctnetlink_new_expect(struct net *net, struct sock *ctnl, 3198 3187 struct sk_buff *skb, const struct nlmsghdr *nlh, 3199 - const struct nlattr * const cda[]) 3188 + const struct nlattr * const cda[], 3189 + struct netlink_ext_ack *extack) 3200 3190 { 3201 3191 struct nf_conntrack_tuple tuple; 3202 3192 struct nf_conntrack_expect *exp; ··· 3303 3291 static int ctnetlink_stat_exp_cpu(struct net *net, struct sock *ctnl, 3304 3292 struct sk_buff *skb, 3305 3293 const struct nlmsghdr *nlh, 3306 - const struct nlattr * const cda[]) 3294 + const struct nlattr * const cda[], 3295 + struct netlink_ext_ack *extack) 3307 3296 { 3308 3297 if (nlh->nlmsg_flags & NLM_F_DUMP) { 3309 3298 struct netlink_dump_control c = {
+39 -20
net/netfilter/nf_tables_api.c
··· 535 535 536 536 static int nf_tables_gettable(struct net *net, struct sock *nlsk, 537 537 struct sk_buff *skb, const struct nlmsghdr *nlh, 538 - const struct nlattr * const nla[]) 538 + const struct nlattr * const nla[], 539 + struct netlink_ext_ack *extack) 539 540 { 540 541 const struct nfgenmsg *nfmsg = nlmsg_data(nlh); 541 542 u8 genmask = nft_genmask_cur(net); ··· 679 678 680 679 static int nf_tables_newtable(struct net *net, struct sock *nlsk, 681 680 struct sk_buff *skb, const struct nlmsghdr *nlh, 682 - const struct nlattr * const nla[]) 681 + const struct nlattr * const nla[], 682 + struct netlink_ext_ack *extack) 683 683 { 684 684 const struct nfgenmsg *nfmsg = nlmsg_data(nlh); 685 685 u8 genmask = nft_genmask_next(net); ··· 833 831 834 832 static int nf_tables_deltable(struct net *net, struct sock *nlsk, 835 833 struct sk_buff *skb, const struct nlmsghdr *nlh, 836 - const struct nlattr * const nla[]) 834 + const struct nlattr * const nla[], 835 + struct netlink_ext_ack *extack) 837 836 { 838 837 const struct nfgenmsg *nfmsg = nlmsg_data(nlh); 839 838 u8 genmask = nft_genmask_next(net); ··· 1130 1127 1131 1128 static int nf_tables_getchain(struct net *net, struct sock *nlsk, 1132 1129 struct sk_buff *skb, const struct nlmsghdr *nlh, 1133 - const struct nlattr * const nla[]) 1130 + const struct nlattr * const nla[], 1131 + struct netlink_ext_ack *extack) 1134 1132 { 1135 1133 const struct nfgenmsg *nfmsg = nlmsg_data(nlh); 1136 1134 u8 genmask = nft_genmask_cur(net); ··· 1327 1323 1328 1324 static int nf_tables_newchain(struct net *net, struct sock *nlsk, 1329 1325 struct sk_buff *skb, const struct nlmsghdr *nlh, 1330 - const struct nlattr * const nla[]) 1326 + const struct nlattr * const nla[], 1327 + struct netlink_ext_ack *extack) 1331 1328 { 1332 1329 const struct nfgenmsg *nfmsg = nlmsg_data(nlh); 1333 1330 const struct nlattr * uninitialized_var(name); ··· 1566 1561 1567 1562 static int nf_tables_delchain(struct net *net, struct sock *nlsk, 1568 1563 struct sk_buff *skb, const struct nlmsghdr *nlh, 1569 - const struct nlattr * const nla[]) 1564 + const struct nlattr * const nla[], 1565 + struct netlink_ext_ack *extack) 1570 1566 { 1571 1567 const struct nfgenmsg *nfmsg = nlmsg_data(nlh); 1572 1568 u8 genmask = nft_genmask_next(net); ··· 2048 2042 2049 2043 static int nf_tables_getrule(struct net *net, struct sock *nlsk, 2050 2044 struct sk_buff *skb, const struct nlmsghdr *nlh, 2051 - const struct nlattr * const nla[]) 2045 + const struct nlattr * const nla[], 2046 + struct netlink_ext_ack *extack) 2052 2047 { 2053 2048 const struct nfgenmsg *nfmsg = nlmsg_data(nlh); 2054 2049 u8 genmask = nft_genmask_cur(net); ··· 2142 2135 2143 2136 static int nf_tables_newrule(struct net *net, struct sock *nlsk, 2144 2137 struct sk_buff *skb, const struct nlmsghdr *nlh, 2145 - const struct nlattr * const nla[]) 2138 + const struct nlattr * const nla[], 2139 + struct netlink_ext_ack *extack) 2146 2140 { 2147 2141 const struct nfgenmsg *nfmsg = nlmsg_data(nlh); 2148 2142 u8 genmask = nft_genmask_next(net); ··· 2325 2317 2326 2318 static int nf_tables_delrule(struct net *net, struct sock *nlsk, 2327 2319 struct sk_buff *skb, const struct nlmsghdr *nlh, 2328 - const struct nlattr * const nla[]) 2320 + const struct nlattr * const nla[], 2321 + struct netlink_ext_ack *extack) 2329 2322 { 2330 2323 const struct nfgenmsg *nfmsg = nlmsg_data(nlh); 2331 2324 u8 genmask = nft_genmask_next(net); ··· 2842 2833 2843 2834 static int nf_tables_getset(struct net *net, struct sock *nlsk, 2844 2835 struct sk_buff *skb, const struct nlmsghdr *nlh, 2845 - const struct nlattr * const nla[]) 2836 + const struct nlattr * const nla[], 2837 + struct netlink_ext_ack *extack) 2846 2838 { 2847 2839 u8 genmask = nft_genmask_cur(net); 2848 2840 const struct nft_set *set; ··· 2919 2909 2920 2910 static int nf_tables_newset(struct net *net, struct sock *nlsk, 2921 2911 struct sk_buff *skb, const struct nlmsghdr *nlh, 2922 - const struct nlattr * const nla[]) 2912 + const struct nlattr * const nla[], 2913 + struct netlink_ext_ack *extack) 2923 2914 { 2924 2915 const struct nfgenmsg *nfmsg = nlmsg_data(nlh); 2925 2916 u8 genmask = nft_genmask_next(net); ··· 3138 3127 3139 3128 static int nf_tables_delset(struct net *net, struct sock *nlsk, 3140 3129 struct sk_buff *skb, const struct nlmsghdr *nlh, 3141 - const struct nlattr * const nla[]) 3130 + const struct nlattr * const nla[], 3131 + struct netlink_ext_ack *extack) 3142 3132 { 3143 3133 const struct nfgenmsg *nfmsg = nlmsg_data(nlh); 3144 3134 u8 genmask = nft_genmask_next(net); ··· 3499 3487 3500 3488 static int nf_tables_getsetelem(struct net *net, struct sock *nlsk, 3501 3489 struct sk_buff *skb, const struct nlmsghdr *nlh, 3502 - const struct nlattr * const nla[]) 3490 + const struct nlattr * const nla[], 3491 + struct netlink_ext_ack *extack) 3503 3492 { 3504 3493 u8 genmask = nft_genmask_cur(net); 3505 3494 const struct nft_set *set; ··· 3901 3888 3902 3889 static int nf_tables_newsetelem(struct net *net, struct sock *nlsk, 3903 3890 struct sk_buff *skb, const struct nlmsghdr *nlh, 3904 - const struct nlattr * const nla[]) 3891 + const struct nlattr * const nla[], 3892 + struct netlink_ext_ack *extack) 3905 3893 { 3906 3894 u8 genmask = nft_genmask_next(net); 3907 3895 const struct nlattr *attr; ··· 4099 4085 4100 4086 static int nf_tables_delsetelem(struct net *net, struct sock *nlsk, 4101 4087 struct sk_buff *skb, const struct nlmsghdr *nlh, 4102 - const struct nlattr * const nla[]) 4088 + const struct nlattr * const nla[], 4089 + struct netlink_ext_ack *extack) 4103 4090 { 4104 4091 u8 genmask = nft_genmask_next(net); 4105 4092 const struct nlattr *attr; ··· 4310 4295 4311 4296 static int nf_tables_newobj(struct net *net, struct sock *nlsk, 4312 4297 struct sk_buff *skb, const struct nlmsghdr *nlh, 4313 - const struct nlattr * const nla[]) 4298 + const struct nlattr * const nla[], 4299 + struct netlink_ext_ack *extack) 4314 4300 { 4315 4301 const struct nfgenmsg *nfmsg = nlmsg_data(nlh); 4316 4302 const struct nft_object_type *type; ··· 4505 4489 4506 4490 static int nf_tables_getobj(struct net *net, struct sock *nlsk, 4507 4491 struct sk_buff *skb, const struct nlmsghdr *nlh, 4508 - const struct nlattr * const nla[]) 4492 + const struct nlattr * const nla[], 4493 + struct netlink_ext_ack *extack) 4509 4494 { 4510 4495 const struct nfgenmsg *nfmsg = nlmsg_data(nlh); 4511 4496 u8 genmask = nft_genmask_cur(net); ··· 4584 4567 } 4585 4568 4586 4569 static int nf_tables_delobj(struct net *net, struct sock *nlsk, 4587 - struct sk_buff *skb, const struct nlmsghdr *nlh, 4588 - const struct nlattr * const nla[]) 4570 + struct sk_buff *skb, const struct nlmsghdr *nlh, 4571 + const struct nlattr * const nla[], 4572 + struct netlink_ext_ack *extack) 4589 4573 { 4590 4574 const struct nfgenmsg *nfmsg = nlmsg_data(nlh); 4591 4575 u8 genmask = nft_genmask_next(net); ··· 4716 4698 4717 4699 static int nf_tables_getgen(struct net *net, struct sock *nlsk, 4718 4700 struct sk_buff *skb, const struct nlmsghdr *nlh, 4719 - const struct nlattr * const nla[]) 4701 + const struct nlattr * const nla[], 4702 + struct netlink_ext_ack *extack) 4720 4703 { 4721 4704 struct sk_buff *skb2; 4722 4705 int err;
+15 -6
net/netfilter/nfnetlink.c
··· 201 201 202 202 if (nc->call_rcu) { 203 203 err = nc->call_rcu(net, net->nfnl, skb, nlh, 204 - (const struct nlattr **)cda); 204 + (const struct nlattr **)cda, 205 + extack); 205 206 rcu_read_unlock(); 206 207 } else { 207 208 rcu_read_unlock(); ··· 212 211 err = -EAGAIN; 213 212 else if (nc->call) 214 213 err = nc->call(net, net->nfnl, skb, nlh, 215 - (const struct nlattr **)cda); 214 + (const struct nlattr **)cda, 215 + extack); 216 216 else 217 217 err = -EINVAL; 218 218 nfnl_unlock(subsys_id); ··· 228 226 struct list_head head; 229 227 struct nlmsghdr *nlh; 230 228 int err; 229 + struct netlink_ext_ack extack; 231 230 }; 232 231 233 - static int nfnl_err_add(struct list_head *list, struct nlmsghdr *nlh, int err) 232 + static int nfnl_err_add(struct list_head *list, struct nlmsghdr *nlh, int err, 233 + const struct netlink_ext_ack *extack) 234 234 { 235 235 struct nfnl_err *nfnl_err; 236 236 ··· 242 238 243 239 nfnl_err->nlh = nlh; 244 240 nfnl_err->err = err; 241 + nfnl_err->extack = *extack; 245 242 list_add_tail(&nfnl_err->head, list); 246 243 247 244 return 0; ··· 267 262 struct nfnl_err *nfnl_err, *next; 268 263 269 264 list_for_each_entry_safe(nfnl_err, next, err_list, head) { 270 - netlink_ack(skb, nfnl_err->nlh, nfnl_err->err, NULL); 265 + netlink_ack(skb, nfnl_err->nlh, nfnl_err->err, 266 + &nfnl_err->extack); 271 267 nfnl_err_del(nfnl_err); 272 268 } 273 269 } ··· 286 280 struct net *net = sock_net(skb->sk); 287 281 const struct nfnetlink_subsystem *ss; 288 282 const struct nfnl_callback *nc; 283 + struct netlink_ext_ack extack; 289 284 LIST_HEAD(err_list); 290 285 u32 status; 291 286 int err; ··· 332 325 while (skb->len >= nlmsg_total_size(0)) { 333 326 int msglen, type; 334 327 328 + memset(&extack, 0, sizeof(extack)); 335 329 nlh = nlmsg_hdr(skb); 336 330 err = 0; 337 331 ··· 392 384 393 385 if (nc->call_batch) { 394 386 err = nc->call_batch(net, net->nfnl, skb, nlh, 395 - (const struct nlattr **)cda); 387 + (const struct nlattr **)cda, 388 + &extack); 396 389 } 397 390 398 391 /* The lock was released to autoload some module, we ··· 411 402 * processed, this avoids that the same error is 412 403 * reported several times when replaying the batch. 413 404 */ 414 - if (nfnl_err_add(&err_list, nlh, err) < 0) { 405 + if (nfnl_err_add(&err_list, nlh, err, &extack) < 0) { 415 406 /* We failed to enqueue an error, reset the 416 407 * list of errors and send OOM to userspace 417 408 * pointing to the batch header.
+2 -1
net/netfilter/nft_compat.c
··· 530 530 531 531 static int nfnl_compat_get(struct net *net, struct sock *nfnl, 532 532 struct sk_buff *skb, const struct nlmsghdr *nlh, 533 - const struct nlattr * const tb[]) 533 + const struct nlattr * const tb[], 534 + struct netlink_ext_ack *extack) 534 535 { 535 536 int ret = 0, target; 536 537 struct nfgenmsg *nfmsg;
+4 -2
net/netfilter/xt_osf.c
··· 63 63 64 64 static int xt_osf_add_callback(struct net *net, struct sock *ctnl, 65 65 struct sk_buff *skb, const struct nlmsghdr *nlh, 66 - const struct nlattr * const osf_attrs[]) 66 + const struct nlattr * const osf_attrs[], 67 + struct netlink_ext_ack *extack) 67 68 { 68 69 struct xt_osf_user_finger *f; 69 70 struct xt_osf_finger *kf = NULL, *sf; ··· 108 107 static int xt_osf_remove_callback(struct net *net, struct sock *ctnl, 109 108 struct sk_buff *skb, 110 109 const struct nlmsghdr *nlh, 111 - const struct nlattr * const osf_attrs[]) 110 + const struct nlattr * const osf_attrs[], 111 + struct netlink_ext_ack *extack) 112 112 { 113 113 struct xt_osf_user_finger *f; 114 114 struct xt_osf_finger *sf;