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

netlink: pass extended ACK struct to parsing functions

Pass the new extended ACK reporting struct to all of the generic
netlink parsing functions. For now, pass NULL in almost all callers
(except for some in the core.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Johannes Berg and committed by
David S. Miller
fceb6435 ba0dc5f6

+477 -391
+1 -1
crypto/crypto_user.c
··· 523 523 } 524 524 525 525 err = nlmsg_parse(nlh, crypto_msg_min[type], attrs, CRYPTOCFGA_MAX, 526 - crypto_policy); 526 + crypto_policy, NULL); 527 527 if (err < 0) 528 528 return err; 529 529
+1 -1
drivers/block/drbd/drbd_nla.c
··· 34 34 35 35 err = drbd_nla_check_mandatory(maxtype, nla); 36 36 if (!err) 37 - err = nla_parse_nested(tb, maxtype, nla, policy); 37 + err = nla_parse_nested(tb, maxtype, nla, policy, NULL); 38 38 39 39 return err; 40 40 }
+1 -1
drivers/infiniband/core/addr.c
··· 88 88 return false; 89 89 90 90 ret = nla_parse(tb, LS_NLA_TYPE_MAX - 1, nlmsg_data(nlh), 91 - nlmsg_len(nlh), ib_nl_addr_policy); 91 + nlmsg_len(nlh), ib_nl_addr_policy, NULL); 92 92 if (ret) 93 93 return false; 94 94
+4 -2
drivers/infiniband/core/iwpm_util.c
··· 472 472 int ret; 473 473 const char *err_str = ""; 474 474 475 - ret = nlmsg_validate(cb->nlh, nlh_len, policy_max-1, nlmsg_policy); 475 + ret = nlmsg_validate(cb->nlh, nlh_len, policy_max - 1, nlmsg_policy, 476 + NULL); 476 477 if (ret) { 477 478 err_str = "Invalid attribute"; 478 479 goto parse_nlmsg_error; 479 480 } 480 - ret = nlmsg_parse(cb->nlh, nlh_len, nltb, policy_max-1, nlmsg_policy); 481 + ret = nlmsg_parse(cb->nlh, nlh_len, nltb, policy_max - 1, 482 + nlmsg_policy, NULL); 481 483 if (ret) { 482 484 err_str = "Unable to parse the nlmsg"; 483 485 goto parse_nlmsg_error;
+2 -2
drivers/infiniband/core/sa_query.c
··· 808 808 return -EPERM; 809 809 810 810 ret = nla_parse(tb, LS_NLA_TYPE_MAX - 1, nlmsg_data(nlh), 811 - nlmsg_len(nlh), ib_nl_policy); 811 + nlmsg_len(nlh), ib_nl_policy, NULL); 812 812 attr = (const struct nlattr *)tb[LS_NLA_TYPE_TIMEOUT]; 813 813 if (ret || !attr) 814 814 goto settimeout_out; ··· 860 860 return 0; 861 861 862 862 ret = nla_parse(tb, LS_NLA_TYPE_MAX - 1, nlmsg_data(nlh), 863 - nlmsg_len(nlh), ib_nl_policy); 863 + nlmsg_len(nlh), ib_nl_policy, NULL); 864 864 if (ret) 865 865 return 0; 866 866
+6 -4
drivers/net/macsec.c
··· 1590 1590 if (!attrs[MACSEC_ATTR_SA_CONFIG]) 1591 1591 return -EINVAL; 1592 1592 1593 - if (nla_parse_nested(tb_sa, MACSEC_SA_ATTR_MAX, attrs[MACSEC_ATTR_SA_CONFIG], 1594 - macsec_genl_sa_policy)) 1593 + if (nla_parse_nested(tb_sa, MACSEC_SA_ATTR_MAX, 1594 + attrs[MACSEC_ATTR_SA_CONFIG], 1595 + macsec_genl_sa_policy, NULL)) 1595 1596 return -EINVAL; 1596 1597 1597 1598 return 0; ··· 1603 1602 if (!attrs[MACSEC_ATTR_RXSC_CONFIG]) 1604 1603 return -EINVAL; 1605 1604 1606 - if (nla_parse_nested(tb_rxsc, MACSEC_RXSC_ATTR_MAX, attrs[MACSEC_ATTR_RXSC_CONFIG], 1607 - macsec_genl_rxsc_policy)) 1605 + if (nla_parse_nested(tb_rxsc, MACSEC_RXSC_ATTR_MAX, 1606 + attrs[MACSEC_ATTR_RXSC_CONFIG], 1607 + macsec_genl_rxsc_policy, NULL)) 1608 1608 return -EINVAL; 1609 1609 1610 1610 return 0;
+1 -1
drivers/net/team/team.c
··· 2471 2471 goto team_put; 2472 2472 } 2473 2473 err = nla_parse_nested(opt_attrs, TEAM_ATTR_OPTION_MAX, 2474 - nl_option, team_nl_option_policy); 2474 + nl_option, team_nl_option_policy, NULL); 2475 2475 if (err) 2476 2476 goto team_put; 2477 2477 if (!opt_attrs[TEAM_ATTR_OPTION_NAME] ||
+2 -1
drivers/net/veth.c
··· 368 368 ifmp = nla_data(nla_peer); 369 369 err = rtnl_nla_parse_ifla(peer_tb, 370 370 nla_data(nla_peer) + sizeof(struct ifinfomsg), 371 - nla_len(nla_peer) - sizeof(struct ifinfomsg)); 371 + nla_len(nla_peer) - sizeof(struct ifinfomsg), 372 + NULL); 372 373 if (err < 0) 373 374 return err; 374 375
+2 -2
drivers/net/wireless/ath/ath10k/testmode.c
··· 420 420 struct nlattr *tb[ATH10K_TM_ATTR_MAX + 1]; 421 421 int ret; 422 422 423 - ret = nla_parse(tb, ATH10K_TM_ATTR_MAX, data, len, 424 - ath10k_tm_policy); 423 + ret = nla_parse(tb, ATH10K_TM_ATTR_MAX, data, len, ath10k_tm_policy, 424 + NULL); 425 425 if (ret) 426 426 return ret; 427 427
+2 -2
drivers/net/wireless/ath/ath6kl/testmode.c
··· 74 74 int err, buf_len; 75 75 void *buf; 76 76 77 - err = nla_parse(tb, ATH6KL_TM_ATTR_MAX, data, len, 78 - ath6kl_tm_policy); 77 + err = nla_parse(tb, ATH6KL_TM_ATTR_MAX, data, len, ath6kl_tm_policy, 78 + NULL); 79 79 if (err) 80 80 return err; 81 81
+2 -1
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
··· 3711 3711 int err; 3712 3712 u32 noa_duration; 3713 3713 3714 - err = nla_parse(tb, IWL_MVM_TM_ATTR_MAX, data, len, iwl_mvm_tm_policy); 3714 + err = nla_parse(tb, IWL_MVM_TM_ATTR_MAX, data, len, iwl_mvm_tm_policy, 3715 + NULL); 3715 3716 if (err) 3716 3717 return err; 3717 3718
+2 -2
drivers/net/wireless/mac80211_hwsim.c
··· 389 389 u32 val; 390 390 391 391 err = nla_parse(tb, QCA_WLAN_VENDOR_ATTR_MAX, data, data_len, 392 - hwsim_vendor_test_policy); 392 + hwsim_vendor_test_policy, NULL); 393 393 if (err) 394 394 return err; 395 395 if (!tb[QCA_WLAN_VENDOR_ATTR_TEST]) ··· 1852 1852 int err, ps; 1853 1853 1854 1854 err = nla_parse(tb, HWSIM_TM_ATTR_MAX, data, len, 1855 - hwsim_testmode_policy); 1855 + hwsim_testmode_policy, NULL); 1856 1856 if (err) 1857 1857 return err; 1858 1858
+2 -2
drivers/net/wireless/marvell/mwifiex/cfg80211.c
··· 4016 4016 if (!priv) 4017 4017 return -EINVAL; 4018 4018 4019 - err = nla_parse(tb, MWIFIEX_TM_ATTR_MAX, data, len, 4020 - mwifiex_tm_policy); 4019 + err = nla_parse(tb, MWIFIEX_TM_ATTR_MAX, data, len, mwifiex_tm_policy, 4020 + NULL); 4021 4021 if (err) 4022 4022 return err; 4023 4023
+2 -1
drivers/net/wireless/ti/wlcore/testmode.c
··· 366 366 u32 nla_cmd; 367 367 int err; 368 368 369 - err = nla_parse(tb, WL1271_TM_ATTR_MAX, data, len, wl1271_tm_policy); 369 + err = nla_parse(tb, WL1271_TM_ATTR_MAX, data, len, wl1271_tm_policy, 370 + NULL); 370 371 if (err) 371 372 return err; 372 373
+2 -2
drivers/net/wireless/ti/wlcore/vendor_cmd.c
··· 41 41 return -EINVAL; 42 42 43 43 ret = nla_parse(tb, MAX_WLCORE_VENDOR_ATTR, data, data_len, 44 - wlcore_vendor_attr_policy); 44 + wlcore_vendor_attr_policy, NULL); 45 45 if (ret) 46 46 return ret; 47 47 ··· 116 116 return -EINVAL; 117 117 118 118 ret = nla_parse(tb, MAX_WLCORE_VENDOR_ATTR, data, data_len, 119 - wlcore_vendor_attr_policy); 119 + wlcore_vendor_attr_policy, NULL); 120 120 if (ret) 121 121 return ret; 122 122
+5 -3
include/net/genetlink.h
··· 174 174 * @tb: destination array with maxtype+1 elements 175 175 * @maxtype: maximum attribute type to be expected 176 176 * @policy: validation policy 177 - * */ 177 + * @extack: extended ACK report struct 178 + */ 178 179 static inline int genlmsg_parse(const struct nlmsghdr *nlh, 179 180 const struct genl_family *family, 180 181 struct nlattr *tb[], int maxtype, 181 - const struct nla_policy *policy) 182 + const struct nla_policy *policy, 183 + struct netlink_ext_ack *extack) 182 184 { 183 185 return nlmsg_parse(nlh, family->hdrsize + GENL_HDRLEN, tb, maxtype, 184 - policy); 186 + policy, extack); 185 187 } 186 188 187 189 /**
+23 -10
include/net/netlink.h
··· 239 239 unsigned int group, int report, gfp_t flags); 240 240 241 241 int nla_validate(const struct nlattr *head, int len, int maxtype, 242 - const struct nla_policy *policy); 242 + const struct nla_policy *policy, 243 + struct netlink_ext_ack *extack); 243 244 int nla_parse(struct nlattr **tb, int maxtype, const struct nlattr *head, 244 - int len, const struct nla_policy *policy); 245 + int len, const struct nla_policy *policy, 246 + struct netlink_ext_ack *extack); 245 247 int nla_policy_len(const struct nla_policy *, int); 246 248 struct nlattr *nla_find(const struct nlattr *head, int len, int attrtype); 247 249 size_t nla_strlcpy(char *dst, const struct nlattr *nla, size_t dstsize); ··· 377 375 * @tb: destination array with maxtype+1 elements 378 376 * @maxtype: maximum attribute type to be expected 379 377 * @policy: validation policy 378 + * @extack: extended ACK report struct 380 379 * 381 380 * See nla_parse() 382 381 */ 383 382 static inline int nlmsg_parse(const struct nlmsghdr *nlh, int hdrlen, 384 383 struct nlattr *tb[], int maxtype, 385 - const struct nla_policy *policy) 384 + const struct nla_policy *policy, 385 + struct netlink_ext_ack *extack) 386 386 { 387 387 if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) 388 388 return -EINVAL; 389 389 390 390 return nla_parse(tb, maxtype, nlmsg_attrdata(nlh, hdrlen), 391 - nlmsg_attrlen(nlh, hdrlen), policy); 391 + nlmsg_attrlen(nlh, hdrlen), policy, extack); 392 392 } 393 393 394 394 /** ··· 414 410 * @hdrlen: length of familiy specific header 415 411 * @maxtype: maximum attribute type to be expected 416 412 * @policy: validation policy 413 + * @extack: extended ACK report struct 417 414 */ 418 415 static inline int nlmsg_validate(const struct nlmsghdr *nlh, 419 416 int hdrlen, int maxtype, 420 - const struct nla_policy *policy) 417 + const struct nla_policy *policy, 418 + struct netlink_ext_ack *extack) 421 419 { 422 420 if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) 423 421 return -EINVAL; 424 422 425 423 return nla_validate(nlmsg_attrdata(nlh, hdrlen), 426 - nlmsg_attrlen(nlh, hdrlen), maxtype, policy); 424 + nlmsg_attrlen(nlh, hdrlen), maxtype, policy, 425 + extack); 427 426 } 428 427 429 428 /** ··· 747 740 * @maxtype: maximum attribute type to be expected 748 741 * @nla: attribute containing the nested attributes 749 742 * @policy: validation policy 743 + * @extack: extended ACK report struct 750 744 * 751 745 * See nla_parse() 752 746 */ 753 747 static inline int nla_parse_nested(struct nlattr *tb[], int maxtype, 754 748 const struct nlattr *nla, 755 - const struct nla_policy *policy) 749 + const struct nla_policy *policy, 750 + struct netlink_ext_ack *extack) 756 751 { 757 - return nla_parse(tb, maxtype, nla_data(nla), nla_len(nla), policy); 752 + return nla_parse(tb, maxtype, nla_data(nla), nla_len(nla), policy, 753 + extack); 758 754 } 759 755 760 756 /** ··· 1263 1253 * @start: container attribute 1264 1254 * @maxtype: maximum attribute type to be expected 1265 1255 * @policy: validation policy 1256 + * @extack: extended ACK report struct 1266 1257 * 1267 1258 * Validates all attributes in the nested attribute stream against the 1268 1259 * specified policy. Attributes with a type exceeding maxtype will be ··· 1272 1261 * Returns 0 on success or a negative error code. 1273 1262 */ 1274 1263 static inline int nla_validate_nested(const struct nlattr *start, int maxtype, 1275 - const struct nla_policy *policy) 1264 + const struct nla_policy *policy, 1265 + struct netlink_ext_ack *extack) 1276 1266 { 1277 - return nla_validate(nla_data(start), nla_len(start), maxtype, policy); 1267 + return nla_validate(nla_data(start), nla_len(start), maxtype, policy, 1268 + extack); 1278 1269 } 1279 1270 1280 1271 /**
+2 -1
include/net/rtnetlink.h
··· 158 158 int rtnl_delete_link(struct net_device *dev); 159 159 int rtnl_configure_link(struct net_device *dev, const struct ifinfomsg *ifm); 160 160 161 - int rtnl_nla_parse_ifla(struct nlattr **tb, const struct nlattr *head, int len); 161 + int rtnl_nla_parse_ifla(struct nlattr **tb, const struct nlattr *head, int len, 162 + struct netlink_ext_ack *exterr); 162 163 163 164 #define MODULE_ALIAS_RTNL_LINK(kind) MODULE_ALIAS("rtnl-link-" kind) 164 165
+18 -10
lib/nlattr.c
··· 112 112 * @len: length of attribute stream 113 113 * @maxtype: maximum attribute type to be expected 114 114 * @policy: validation policy 115 + * @extack: extended ACK report struct 115 116 * 116 117 * Validates all attributes in the specified attribute stream against the 117 118 * specified policy. Attributes with a type exceeding maxtype will be ··· 121 120 * Returns 0 on success or a negative error code. 122 121 */ 123 122 int nla_validate(const struct nlattr *head, int len, int maxtype, 124 - const struct nla_policy *policy) 123 + const struct nla_policy *policy, 124 + struct netlink_ext_ack *extack) 125 125 { 126 126 const struct nlattr *nla; 127 - int rem, err; 127 + int rem; 128 128 129 129 nla_for_each_attr(nla, head, len, rem) { 130 - err = validate_nla(nla, maxtype, policy); 131 - if (err < 0) 132 - goto errout; 130 + int err = validate_nla(nla, maxtype, policy); 131 + 132 + if (err < 0) { 133 + if (extack) 134 + extack->bad_attr = nla; 135 + return err; 136 + } 133 137 } 134 138 135 - err = 0; 136 - errout: 137 - return err; 139 + return 0; 138 140 } 139 141 EXPORT_SYMBOL(nla_validate); 140 142 ··· 184 180 * Returns 0 on success or a negative error code. 185 181 */ 186 182 int nla_parse(struct nlattr **tb, int maxtype, const struct nlattr *head, 187 - int len, const struct nla_policy *policy) 183 + int len, const struct nla_policy *policy, 184 + struct netlink_ext_ack *extack) 188 185 { 189 186 const struct nlattr *nla; 190 187 int rem, err; ··· 198 193 if (type > 0 && type <= maxtype) { 199 194 if (policy) { 200 195 err = validate_nla(nla, maxtype, policy); 201 - if (err < 0) 196 + if (err < 0) { 197 + if (extack) 198 + extack->bad_attr = nla; 202 199 goto errout; 200 + } 203 201 } 204 202 205 203 tb[type] = (struct nlattr *)nla;
+2 -1
net/8021q/vlan_netlink.c
··· 35 35 { 36 36 if (!attr) 37 37 return 0; 38 - return nla_validate_nested(attr, IFLA_VLAN_QOS_MAX, vlan_map_policy); 38 + return nla_validate_nested(attr, IFLA_VLAN_QOS_MAX, vlan_map_policy, 39 + NULL); 39 40 } 40 41 41 42 static int vlan_validate(struct nlattr *tb[], struct nlattr *data[])
+2 -1
net/bridge/br_mdb.c
··· 464 464 struct net_device *dev; 465 465 int err; 466 466 467 - err = nlmsg_parse(nlh, sizeof(*bpm), tb, MDBA_SET_ENTRY_MAX, NULL); 467 + err = nlmsg_parse(nlh, sizeof(*bpm), tb, MDBA_SET_ENTRY_MAX, NULL, 468 + NULL); 468 469 if (err < 0) 469 470 return err; 470 471
+2 -2
net/bridge/br_netlink.c
··· 748 748 749 749 if (p && protinfo) { 750 750 if (protinfo->nla_type & NLA_F_NESTED) { 751 - err = nla_parse_nested(tb, IFLA_BRPORT_MAX, 752 - protinfo, br_port_policy); 751 + err = nla_parse_nested(tb, IFLA_BRPORT_MAX, protinfo, 752 + br_port_policy, NULL); 753 753 if (err) 754 754 return err; 755 755
+1 -1
net/can/gw.c
··· 641 641 memset(mod, 0, sizeof(*mod)); 642 642 643 643 err = nlmsg_parse(nlh, sizeof(struct rtcanmsg), tb, CGW_MAX, 644 - cgw_policy); 644 + cgw_policy, NULL); 645 645 if (err < 0) 646 646 return err; 647 647
+2 -2
net/core/fib_rules.c
··· 386 386 goto errout; 387 387 } 388 388 389 - err = nlmsg_parse(nlh, sizeof(*frh), tb, FRA_MAX, ops->policy); 389 + err = nlmsg_parse(nlh, sizeof(*frh), tb, FRA_MAX, ops->policy, NULL); 390 390 if (err < 0) 391 391 goto errout; 392 392 ··· 580 580 goto errout; 581 581 } 582 582 583 - err = nlmsg_parse(nlh, sizeof(*frh), tb, FRA_MAX, ops->policy); 583 + err = nlmsg_parse(nlh, sizeof(*frh), tb, FRA_MAX, ops->policy, NULL); 584 584 if (err < 0) 585 585 goto errout; 586 586
+3 -2
net/core/lwt_bpf.c
··· 209 209 int ret; 210 210 u32 fd; 211 211 212 - ret = nla_parse_nested(tb, LWT_BPF_PROG_MAX, attr, bpf_prog_policy); 212 + ret = nla_parse_nested(tb, LWT_BPF_PROG_MAX, attr, bpf_prog_policy, 213 + NULL); 213 214 if (ret < 0) 214 215 return ret; 215 216 ··· 250 249 if (family != AF_INET && family != AF_INET6) 251 250 return -EAFNOSUPPORT; 252 251 253 - ret = nla_parse_nested(tb, LWT_BPF_MAX, nla, bpf_nl_policy); 252 + ret = nla_parse_nested(tb, LWT_BPF_MAX, nla, bpf_nl_policy, NULL); 254 253 if (ret < 0) 255 254 return ret; 256 255
+4 -4
net/core/neighbour.c
··· 1661 1661 int err; 1662 1662 1663 1663 ASSERT_RTNL(); 1664 - err = nlmsg_parse(nlh, sizeof(*ndm), tb, NDA_MAX, NULL); 1664 + err = nlmsg_parse(nlh, sizeof(*ndm), tb, NDA_MAX, NULL, NULL); 1665 1665 if (err < 0) 1666 1666 goto out; 1667 1667 ··· 1946 1946 int err, tidx; 1947 1947 1948 1948 err = nlmsg_parse(nlh, sizeof(*ndtmsg), tb, NDTA_MAX, 1949 - nl_neightbl_policy); 1949 + nl_neightbl_policy, NULL); 1950 1950 if (err < 0) 1951 1951 goto errout; 1952 1952 ··· 1984 1984 int i, ifindex = 0; 1985 1985 1986 1986 err = nla_parse_nested(tbp, NDTPA_MAX, tb[NDTA_PARMS], 1987 - nl_ntbl_parm_policy); 1987 + nl_ntbl_parm_policy, NULL); 1988 1988 if (err < 0) 1989 1989 goto errout_tbl_lock; 1990 1990 ··· 2275 2275 unsigned int flags = NLM_F_MULTI; 2276 2276 int err; 2277 2277 2278 - err = nlmsg_parse(nlh, sizeof(struct ndmsg), tb, NDA_MAX, NULL); 2278 + err = nlmsg_parse(nlh, sizeof(struct ndmsg), tb, NDA_MAX, NULL, NULL); 2279 2279 if (!err) { 2280 2280 if (tb[NDA_IFINDEX]) 2281 2281 filter_idx = nla_get_u32(tb[NDA_IFINDEX]);
+2 -2
net/core/net_namespace.c
··· 579 579 int nsid, err; 580 580 581 581 err = nlmsg_parse(nlh, sizeof(struct rtgenmsg), tb, NETNSA_MAX, 582 - rtnl_net_policy); 582 + rtnl_net_policy, NULL); 583 583 if (err < 0) 584 584 return err; 585 585 if (!tb[NETNSA_NSID]) ··· 653 653 int err, id; 654 654 655 655 err = nlmsg_parse(nlh, sizeof(struct rtgenmsg), tb, NETNSA_MAX, 656 - rtnl_net_policy); 656 + rtnl_net_policy, NULL); 657 657 if (err < 0) 658 658 return err; 659 659 if (tb[NETNSA_PID])
+26 -21
net/core/rtnetlink.c
··· 1515 1515 const struct rtnl_link_ops *ops = NULL; 1516 1516 struct nlattr *linfo[IFLA_INFO_MAX + 1]; 1517 1517 1518 - if (nla_parse_nested(linfo, IFLA_INFO_MAX, nla, ifla_info_policy) < 0) 1518 + if (nla_parse_nested(linfo, IFLA_INFO_MAX, nla, 1519 + ifla_info_policy, NULL) < 0) 1519 1520 return NULL; 1520 1521 1521 1522 if (linfo[IFLA_INFO_KIND]) { ··· 1593 1592 hdrlen = nlmsg_len(cb->nlh) < sizeof(struct ifinfomsg) ? 1594 1593 sizeof(struct rtgenmsg) : sizeof(struct ifinfomsg); 1595 1594 1596 - if (nlmsg_parse(cb->nlh, hdrlen, tb, IFLA_MAX, ifla_policy) >= 0) { 1597 - 1595 + if (nlmsg_parse(cb->nlh, hdrlen, tb, IFLA_MAX, 1596 + ifla_policy, NULL) >= 0) { 1598 1597 if (tb[IFLA_EXT_MASK]) 1599 1598 ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]); 1600 1599 ··· 1641 1640 return skb->len; 1642 1641 } 1643 1642 1644 - int rtnl_nla_parse_ifla(struct nlattr **tb, const struct nlattr *head, int len) 1643 + int rtnl_nla_parse_ifla(struct nlattr **tb, const struct nlattr *head, int len, 1644 + struct netlink_ext_ack *exterr) 1645 1645 { 1646 - return nla_parse(tb, IFLA_MAX, head, len, ifla_policy); 1646 + return nla_parse(tb, IFLA_MAX, head, len, ifla_policy, exterr); 1647 1647 } 1648 1648 EXPORT_SYMBOL(rtnl_nla_parse_ifla); 1649 1649 ··· 2080 2078 goto errout; 2081 2079 } 2082 2080 err = nla_parse_nested(vfinfo, IFLA_VF_MAX, attr, 2083 - ifla_vf_policy); 2081 + ifla_vf_policy, NULL); 2084 2082 if (err < 0) 2085 2083 goto errout; 2086 2084 err = do_setvfinfo(dev, vfinfo); ··· 2108 2106 goto errout; 2109 2107 } 2110 2108 err = nla_parse_nested(port, IFLA_PORT_MAX, attr, 2111 - ifla_port_policy); 2109 + ifla_port_policy, NULL); 2112 2110 if (err < 0) 2113 2111 goto errout; 2114 2112 if (!port[IFLA_PORT_VF]) { ··· 2128 2126 struct nlattr *port[IFLA_PORT_MAX+1]; 2129 2127 2130 2128 err = nla_parse_nested(port, IFLA_PORT_MAX, 2131 - tb[IFLA_PORT_SELF], ifla_port_policy); 2129 + tb[IFLA_PORT_SELF], ifla_port_policy, 2130 + NULL); 2132 2131 if (err < 0) 2133 2132 goto errout; 2134 2133 ··· 2173 2170 u32 xdp_flags = 0; 2174 2171 2175 2172 err = nla_parse_nested(xdp, IFLA_XDP_MAX, tb[IFLA_XDP], 2176 - ifla_xdp_policy); 2173 + ifla_xdp_policy, NULL); 2177 2174 if (err < 0) 2178 2175 goto errout; 2179 2176 ··· 2222 2219 struct nlattr *tb[IFLA_MAX+1]; 2223 2220 char ifname[IFNAMSIZ]; 2224 2221 2225 - err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy); 2222 + err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy, NULL); 2226 2223 if (err < 0) 2227 2224 goto errout; 2228 2225 ··· 2315 2312 struct nlattr *tb[IFLA_MAX+1]; 2316 2313 int err; 2317 2314 2318 - err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy); 2315 + err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy, NULL); 2319 2316 if (err < 0) 2320 2317 return err; 2321 2318 ··· 2444 2441 #ifdef CONFIG_MODULES 2445 2442 replay: 2446 2443 #endif 2447 - err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy); 2444 + err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy, NULL); 2448 2445 if (err < 0) 2449 2446 return err; 2450 2447 ··· 2475 2472 2476 2473 if (tb[IFLA_LINKINFO]) { 2477 2474 err = nla_parse_nested(linkinfo, IFLA_INFO_MAX, 2478 - tb[IFLA_LINKINFO], ifla_info_policy); 2475 + tb[IFLA_LINKINFO], ifla_info_policy, 2476 + NULL); 2479 2477 if (err < 0) 2480 2478 return err; 2481 2479 } else ··· 2501 2497 if (ops->maxtype && linkinfo[IFLA_INFO_DATA]) { 2502 2498 err = nla_parse_nested(attr, ops->maxtype, 2503 2499 linkinfo[IFLA_INFO_DATA], 2504 - ops->policy); 2500 + ops->policy, NULL); 2505 2501 if (err < 0) 2506 2502 return err; 2507 2503 data = attr; ··· 2519 2515 err = nla_parse_nested(slave_attr, 2520 2516 m_ops->slave_maxtype, 2521 2517 linkinfo[IFLA_INFO_SLAVE_DATA], 2522 - m_ops->slave_policy); 2518 + m_ops->slave_policy, 2519 + NULL); 2523 2520 if (err < 0) 2524 2521 return err; 2525 2522 slave_data = slave_attr; ··· 2689 2684 int err; 2690 2685 u32 ext_filter_mask = 0; 2691 2686 2692 - err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy); 2687 + err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy, NULL); 2693 2688 if (err < 0) 2694 2689 return err; 2695 2690 ··· 2739 2734 hdrlen = nlmsg_len(nlh) < sizeof(struct ifinfomsg) ? 2740 2735 sizeof(struct rtgenmsg) : sizeof(struct ifinfomsg); 2741 2736 2742 - if (nlmsg_parse(nlh, hdrlen, tb, IFLA_MAX, ifla_policy) >= 0) { 2737 + if (nlmsg_parse(nlh, hdrlen, tb, IFLA_MAX, ifla_policy, NULL) >= 0) { 2743 2738 if (tb[IFLA_EXT_MASK]) 2744 2739 ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]); 2745 2740 } ··· 2970 2965 u16 vid; 2971 2966 int err; 2972 2967 2973 - err = nlmsg_parse(nlh, sizeof(*ndm), tb, NDA_MAX, NULL); 2968 + err = nlmsg_parse(nlh, sizeof(*ndm), tb, NDA_MAX, NULL, NULL); 2974 2969 if (err < 0) 2975 2970 return err; 2976 2971 ··· 3073 3068 if (!netlink_capable(skb, CAP_NET_ADMIN)) 3074 3069 return -EPERM; 3075 3070 3076 - err = nlmsg_parse(nlh, sizeof(*ndm), tb, NDA_MAX, NULL); 3071 + err = nlmsg_parse(nlh, sizeof(*ndm), tb, NDA_MAX, NULL, NULL); 3077 3072 if (err < 0) 3078 3073 return err; 3079 3074 ··· 3208 3203 int err = 0; 3209 3204 int fidx = 0; 3210 3205 3211 - if (nlmsg_parse(cb->nlh, sizeof(struct ifinfomsg), tb, IFLA_MAX, 3212 - ifla_policy) == 0) { 3206 + if (nlmsg_parse(cb->nlh, sizeof(struct ifinfomsg), tb, 3207 + IFLA_MAX, ifla_policy, NULL) == 0) { 3213 3208 if (tb[IFLA_MASTER]) 3214 3209 br_idx = nla_get_u32(tb[IFLA_MASTER]); 3215 3210 }
+27 -30
net/dcb/dcbnl.c
··· 245 245 return -EOPNOTSUPP; 246 246 247 247 ret = nla_parse_nested(data, DCB_PFC_UP_ATTR_MAX, 248 - tb[DCB_ATTR_PFC_CFG], 249 - dcbnl_pfc_up_nest); 248 + tb[DCB_ATTR_PFC_CFG], dcbnl_pfc_up_nest, NULL); 250 249 if (ret) 251 250 return ret; 252 251 ··· 303 304 return -EOPNOTSUPP; 304 305 305 306 ret = nla_parse_nested(data, DCB_CAP_ATTR_MAX, tb[DCB_ATTR_CAP], 306 - dcbnl_cap_nest); 307 + dcbnl_cap_nest, NULL); 307 308 if (ret) 308 309 return ret; 309 310 ··· 347 348 return -EOPNOTSUPP; 348 349 349 350 ret = nla_parse_nested(data, DCB_NUMTCS_ATTR_MAX, tb[DCB_ATTR_NUMTCS], 350 - dcbnl_numtcs_nest); 351 + dcbnl_numtcs_nest, NULL); 351 352 if (ret) 352 353 return ret; 353 354 ··· 392 393 return -EOPNOTSUPP; 393 394 394 395 ret = nla_parse_nested(data, DCB_NUMTCS_ATTR_MAX, tb[DCB_ATTR_NUMTCS], 395 - dcbnl_numtcs_nest); 396 + dcbnl_numtcs_nest, NULL); 396 397 if (ret) 397 398 return ret; 398 399 ··· 451 452 return -EINVAL; 452 453 453 454 ret = nla_parse_nested(app_tb, DCB_APP_ATTR_MAX, tb[DCB_ATTR_APP], 454 - dcbnl_app_nest); 455 + dcbnl_app_nest, NULL); 455 456 if (ret) 456 457 return ret; 457 458 ··· 519 520 return -EINVAL; 520 521 521 522 ret = nla_parse_nested(app_tb, DCB_APP_ATTR_MAX, tb[DCB_ATTR_APP], 522 - dcbnl_app_nest); 523 + dcbnl_app_nest, NULL); 523 524 if (ret) 524 525 return ret; 525 526 ··· 576 577 !netdev->dcbnl_ops->getpgbwgcfgrx) 577 578 return -EOPNOTSUPP; 578 579 579 - ret = nla_parse_nested(pg_tb, DCB_PG_ATTR_MAX, 580 - tb[DCB_ATTR_PG_CFG], dcbnl_pg_nest); 580 + ret = nla_parse_nested(pg_tb, DCB_PG_ATTR_MAX, tb[DCB_ATTR_PG_CFG], 581 + dcbnl_pg_nest, NULL); 581 582 if (ret) 582 583 return ret; 583 584 ··· 596 597 data = pg_tb[DCB_PG_ATTR_TC_ALL]; 597 598 else 598 599 data = pg_tb[i]; 599 - ret = nla_parse_nested(param_tb, DCB_TC_ATTR_PARAM_MAX, 600 - data, dcbnl_tc_param_nest); 600 + ret = nla_parse_nested(param_tb, DCB_TC_ATTR_PARAM_MAX, data, 601 + dcbnl_tc_param_nest, NULL); 601 602 if (ret) 602 603 goto err_pg; 603 604 ··· 734 735 return -EOPNOTSUPP; 735 736 736 737 ret = nla_parse_nested(data, DCB_PFC_UP_ATTR_MAX, 737 - tb[DCB_ATTR_PFC_CFG], 738 - dcbnl_pfc_up_nest); 738 + tb[DCB_ATTR_PFC_CFG], dcbnl_pfc_up_nest, NULL); 739 739 if (ret) 740 740 return ret; 741 741 ··· 789 791 !netdev->dcbnl_ops->setpgbwgcfgrx) 790 792 return -EOPNOTSUPP; 791 793 792 - ret = nla_parse_nested(pg_tb, DCB_PG_ATTR_MAX, 793 - tb[DCB_ATTR_PG_CFG], dcbnl_pg_nest); 794 + ret = nla_parse_nested(pg_tb, DCB_PG_ATTR_MAX, tb[DCB_ATTR_PG_CFG], 795 + dcbnl_pg_nest, NULL); 794 796 if (ret) 795 797 return ret; 796 798 ··· 799 801 continue; 800 802 801 803 ret = nla_parse_nested(param_tb, DCB_TC_ATTR_PARAM_MAX, 802 - pg_tb[i], dcbnl_tc_param_nest); 804 + pg_tb[i], dcbnl_tc_param_nest, NULL); 803 805 if (ret) 804 806 return ret; 805 807 ··· 887 889 !netdev->dcbnl_ops->getbcncfg) 888 890 return -EOPNOTSUPP; 889 891 890 - ret = nla_parse_nested(bcn_tb, DCB_BCN_ATTR_MAX, 891 - tb[DCB_ATTR_BCN], dcbnl_bcn_nest); 892 + ret = nla_parse_nested(bcn_tb, DCB_BCN_ATTR_MAX, tb[DCB_ATTR_BCN], 893 + dcbnl_bcn_nest, NULL); 892 894 if (ret) 893 895 return ret; 894 896 ··· 946 948 !netdev->dcbnl_ops->setbcnrp) 947 949 return -EOPNOTSUPP; 948 950 949 - ret = nla_parse_nested(data, DCB_BCN_ATTR_MAX, 950 - tb[DCB_ATTR_BCN], 951 - dcbnl_pfc_up_nest); 951 + ret = nla_parse_nested(data, DCB_BCN_ATTR_MAX, tb[DCB_ATTR_BCN], 952 + dcbnl_pfc_up_nest, NULL); 952 953 if (ret) 953 954 return ret; 954 955 ··· 1421 1424 if (!tb[DCB_ATTR_IEEE]) 1422 1425 return -EINVAL; 1423 1426 1424 - err = nla_parse_nested(ieee, DCB_ATTR_IEEE_MAX, 1425 - tb[DCB_ATTR_IEEE], dcbnl_ieee_policy); 1427 + err = nla_parse_nested(ieee, DCB_ATTR_IEEE_MAX, tb[DCB_ATTR_IEEE], 1428 + dcbnl_ieee_policy, NULL); 1426 1429 if (err) 1427 1430 return err; 1428 1431 ··· 1505 1508 if (!tb[DCB_ATTR_IEEE]) 1506 1509 return -EINVAL; 1507 1510 1508 - err = nla_parse_nested(ieee, DCB_ATTR_IEEE_MAX, 1509 - tb[DCB_ATTR_IEEE], dcbnl_ieee_policy); 1511 + err = nla_parse_nested(ieee, DCB_ATTR_IEEE_MAX, tb[DCB_ATTR_IEEE], 1512 + dcbnl_ieee_policy, NULL); 1510 1513 if (err) 1511 1514 return err; 1512 1515 ··· 1578 1581 if (!tb[DCB_ATTR_FEATCFG]) 1579 1582 return -EINVAL; 1580 1583 1581 - ret = nla_parse_nested(data, DCB_FEATCFG_ATTR_MAX, tb[DCB_ATTR_FEATCFG], 1582 - dcbnl_featcfg_nest); 1584 + ret = nla_parse_nested(data, DCB_FEATCFG_ATTR_MAX, 1585 + tb[DCB_ATTR_FEATCFG], dcbnl_featcfg_nest, NULL); 1583 1586 if (ret) 1584 1587 return ret; 1585 1588 ··· 1622 1625 if (!tb[DCB_ATTR_FEATCFG]) 1623 1626 return -EINVAL; 1624 1627 1625 - ret = nla_parse_nested(data, DCB_FEATCFG_ATTR_MAX, tb[DCB_ATTR_FEATCFG], 1626 - dcbnl_featcfg_nest); 1628 + ret = nla_parse_nested(data, DCB_FEATCFG_ATTR_MAX, 1629 + tb[DCB_ATTR_FEATCFG], dcbnl_featcfg_nest, NULL); 1627 1630 1628 1631 if (ret) 1629 1632 goto err; ··· 1712 1715 return -EPERM; 1713 1716 1714 1717 ret = nlmsg_parse(nlh, sizeof(*dcb), tb, DCB_ATTR_MAX, 1715 - dcbnl_rtnl_policy); 1718 + dcbnl_rtnl_policy, NULL); 1716 1719 if (ret < 0) 1717 1720 return ret; 1718 1721
+2 -2
net/decnet/dn_dev.c
··· 581 581 if (!net_eq(net, &init_net)) 582 582 goto errout; 583 583 584 - err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, dn_ifa_policy); 584 + err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, dn_ifa_policy, NULL); 585 585 if (err < 0) 586 586 goto errout; 587 587 ··· 625 625 if (!net_eq(net, &init_net)) 626 626 return -EINVAL; 627 627 628 - err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, dn_ifa_policy); 628 + err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, dn_ifa_policy, NULL); 629 629 if (err < 0) 630 630 return err; 631 631
+4 -2
net/decnet/dn_fib.c
··· 515 515 if (!net_eq(net, &init_net)) 516 516 return -EINVAL; 517 517 518 - err = nlmsg_parse(nlh, sizeof(*r), attrs, RTA_MAX, rtm_dn_policy); 518 + err = nlmsg_parse(nlh, sizeof(*r), attrs, RTA_MAX, rtm_dn_policy, 519 + NULL); 519 520 if (err < 0) 520 521 return err; 521 522 ··· 541 540 if (!net_eq(net, &init_net)) 542 541 return -EINVAL; 543 542 544 - err = nlmsg_parse(nlh, sizeof(*r), attrs, RTA_MAX, rtm_dn_policy); 543 + err = nlmsg_parse(nlh, sizeof(*r), attrs, RTA_MAX, rtm_dn_policy, 544 + NULL); 545 545 if (err < 0) 546 546 return err; 547 547
+1 -1
net/decnet/dn_route.c
··· 1654 1654 if (!net_eq(net, &init_net)) 1655 1655 return -EINVAL; 1656 1656 1657 - err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_dn_policy); 1657 + err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_dn_policy, NULL); 1658 1658 if (err < 0) 1659 1659 return err; 1660 1660
+14 -15
net/ieee802154/nl802154.c
··· 249 249 if (!cb->args[0]) { 250 250 err = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl802154_fam.hdrsize, 251 251 genl_family_attrbuf(&nl802154_fam), 252 - nl802154_fam.maxattr, 253 - nl802154_policy); 252 + nl802154_fam.maxattr, nl802154_policy, NULL); 254 253 if (err) 255 254 goto out_unlock; 256 255 ··· 561 562 struct nl802154_dump_wpan_phy_state *state) 562 563 { 563 564 struct nlattr **tb = genl_family_attrbuf(&nl802154_fam); 564 - int ret = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl802154_fam.hdrsize, 565 - tb, nl802154_fam.maxattr, nl802154_policy); 565 + int ret = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl802154_fam.hdrsize, tb, 566 + nl802154_fam.maxattr, nl802154_policy, NULL); 566 567 567 568 /* TODO check if we can handle error here, 568 569 * we have no backward compatibility ··· 1307 1308 struct nlattr *attrs[NL802154_DEV_ADDR_ATTR_MAX + 1]; 1308 1309 1309 1310 if (!nla || nla_parse_nested(attrs, NL802154_DEV_ADDR_ATTR_MAX, nla, 1310 - nl802154_dev_addr_policy)) 1311 + nl802154_dev_addr_policy, NULL)) 1311 1312 return -EINVAL; 1312 1313 1313 1314 if (!attrs[NL802154_DEV_ADDR_ATTR_PAN_ID] || ··· 1347 1348 struct nlattr *attrs[NL802154_KEY_ID_ATTR_MAX + 1]; 1348 1349 1349 1350 if (!nla || nla_parse_nested(attrs, NL802154_KEY_ID_ATTR_MAX, nla, 1350 - nl802154_key_id_policy)) 1351 + nl802154_key_id_policy, NULL)) 1351 1352 return -EINVAL; 1352 1353 1353 1354 if (!attrs[NL802154_KEY_ID_ATTR_MODE]) ··· 1564 1565 1565 1566 if (nla_parse_nested(attrs, NL802154_KEY_ATTR_MAX, 1566 1567 info->attrs[NL802154_ATTR_SEC_KEY], 1567 - nl802154_key_policy)) 1568 + nl802154_key_policy, NULL)) 1568 1569 return -EINVAL; 1569 1570 1570 1571 if (!attrs[NL802154_KEY_ATTR_USAGE_FRAMES] || ··· 1614 1615 1615 1616 if (nla_parse_nested(attrs, NL802154_KEY_ATTR_MAX, 1616 1617 info->attrs[NL802154_ATTR_SEC_KEY], 1617 - nl802154_key_policy)) 1618 + nl802154_key_policy, NULL)) 1618 1619 return -EINVAL; 1619 1620 1620 1621 if (ieee802154_llsec_parse_key_id(attrs[NL802154_KEY_ATTR_ID], &id) < 0) ··· 1728 1729 { 1729 1730 struct nlattr *attrs[NL802154_DEV_ATTR_MAX + 1]; 1730 1731 1731 - if (!nla || nla_parse_nested(attrs, NL802154_DEV_ATTR_MAX, nla, 1732 - nl802154_dev_policy)) 1732 + if (!nla || nla_parse_nested(attrs, NL802154_DEV_ATTR_MAX, 1733 + nla, nl802154_dev_policy, NULL)) 1733 1734 return -EINVAL; 1734 1735 1735 1736 memset(dev, 0, sizeof(*dev)); ··· 1782 1783 1783 1784 if (nla_parse_nested(attrs, NL802154_DEV_ATTR_MAX, 1784 1785 info->attrs[NL802154_ATTR_SEC_DEVICE], 1785 - nl802154_dev_policy)) 1786 + nl802154_dev_policy, NULL)) 1786 1787 return -EINVAL; 1787 1788 1788 1789 if (!attrs[NL802154_DEV_ATTR_EXTENDED_ADDR]) ··· 1910 1911 if (!info->attrs[NL802154_ATTR_SEC_DEVKEY] || 1911 1912 nla_parse_nested(attrs, NL802154_DEVKEY_ATTR_MAX, 1912 1913 info->attrs[NL802154_ATTR_SEC_DEVKEY], 1913 - nl802154_devkey_policy) < 0) 1914 + nl802154_devkey_policy, NULL) < 0) 1914 1915 return -EINVAL; 1915 1916 1916 1917 if (!attrs[NL802154_DEVKEY_ATTR_FRAME_COUNTER] || ··· 1942 1943 1943 1944 if (nla_parse_nested(attrs, NL802154_DEVKEY_ATTR_MAX, 1944 1945 info->attrs[NL802154_ATTR_SEC_DEVKEY], 1945 - nl802154_devkey_policy)) 1946 + nl802154_devkey_policy, NULL)) 1946 1947 return -EINVAL; 1947 1948 1948 1949 if (!attrs[NL802154_DEVKEY_ATTR_EXTENDED_ADDR]) ··· 2062 2063 { 2063 2064 struct nlattr *attrs[NL802154_SECLEVEL_ATTR_MAX + 1]; 2064 2065 2065 - if (!nla || nla_parse_nested(attrs, NL802154_SECLEVEL_ATTR_MAX, nla, 2066 - nl802154_seclevel_policy)) 2066 + if (!nla || nla_parse_nested(attrs, NL802154_SECLEVEL_ATTR_MAX, 2067 + nla, nl802154_seclevel_policy, NULL)) 2067 2068 return -EINVAL; 2068 2069 2069 2070 memset(sl, 0, sizeof(*sl));
+7 -5
net/ipv4/devinet.c
··· 582 582 583 583 ASSERT_RTNL(); 584 584 585 - err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, ifa_ipv4_policy); 585 + err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, ifa_ipv4_policy, 586 + NULL); 586 587 if (err < 0) 587 588 goto errout; 588 589 ··· 753 752 struct in_device *in_dev; 754 753 int err; 755 754 756 - err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, ifa_ipv4_policy); 755 + err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, ifa_ipv4_policy, 756 + NULL); 757 757 if (err < 0) 758 758 goto errout; 759 759 ··· 1719 1717 if (dev && !__in_dev_get_rtnl(dev)) 1720 1718 return -EAFNOSUPPORT; 1721 1719 1722 - err = nla_parse_nested(tb, IFLA_INET_MAX, nla, inet_af_policy); 1720 + err = nla_parse_nested(tb, IFLA_INET_MAX, nla, inet_af_policy, NULL); 1723 1721 if (err < 0) 1724 1722 return err; 1725 1723 ··· 1747 1745 if (!in_dev) 1748 1746 return -EAFNOSUPPORT; 1749 1747 1750 - if (nla_parse_nested(tb, IFLA_INET_MAX, nla, NULL) < 0) 1748 + if (nla_parse_nested(tb, IFLA_INET_MAX, nla, NULL, NULL) < 0) 1751 1749 BUG(); 1752 1750 1753 1751 if (tb[IFLA_INET_CONF]) { ··· 1884 1882 int err; 1885 1883 1886 1884 err = nlmsg_parse(nlh, sizeof(*ncm), tb, NETCONFA_MAX, 1887 - devconf_ipv4_policy); 1885 + devconf_ipv4_policy, NULL); 1888 1886 if (err < 0) 1889 1887 goto errout; 1890 1888
+2 -1
net/ipv4/fib_frontend.c
··· 632 632 int err, remaining; 633 633 struct rtmsg *rtm; 634 634 635 - err = nlmsg_validate(nlh, sizeof(*rtm), RTA_MAX, rtm_ipv4_policy); 635 + err = nlmsg_validate(nlh, sizeof(*rtm), RTA_MAX, rtm_ipv4_policy, 636 + NULL); 636 637 if (err < 0) 637 638 goto errout; 638 639
+3 -2
net/ipv4/ip_tunnel_core.c
··· 235 235 struct nlattr *tb[LWTUNNEL_IP_MAX + 1]; 236 236 int err; 237 237 238 - err = nla_parse_nested(tb, LWTUNNEL_IP_MAX, attr, ip_tun_policy); 238 + err = nla_parse_nested(tb, LWTUNNEL_IP_MAX, attr, ip_tun_policy, NULL); 239 239 if (err < 0) 240 240 return err; 241 241 ··· 332 332 struct nlattr *tb[LWTUNNEL_IP6_MAX + 1]; 333 333 int err; 334 334 335 - err = nla_parse_nested(tb, LWTUNNEL_IP6_MAX, attr, ip6_tun_policy); 335 + err = nla_parse_nested(tb, LWTUNNEL_IP6_MAX, attr, ip6_tun_policy, 336 + NULL); 336 337 if (err < 0) 337 338 return err; 338 339
+2 -1
net/ipv4/ipmr.c
··· 2439 2439 struct rtmsg *rtm; 2440 2440 int ret, rem; 2441 2441 2442 - ret = nlmsg_validate(nlh, sizeof(*rtm), RTA_MAX, rtm_ipmr_policy); 2442 + ret = nlmsg_validate(nlh, sizeof(*rtm), RTA_MAX, rtm_ipmr_policy, 2443 + NULL); 2443 2444 if (ret < 0) 2444 2445 goto out; 2445 2446 rtm = nlmsg_data(nlh);
+2 -1
net/ipv4/route.c
··· 2645 2645 u32 table_id = RT_TABLE_MAIN; 2646 2646 kuid_t uid; 2647 2647 2648 - err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_ipv4_policy); 2648 + err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_ipv4_policy, 2649 + NULL); 2649 2650 if (err < 0) 2650 2651 goto errout; 2651 2652
+10 -6
net/ipv6/addrconf.c
··· 624 624 int err; 625 625 626 626 err = nlmsg_parse(nlh, sizeof(*ncm), tb, NETCONFA_MAX, 627 - devconf_ipv6_policy); 627 + devconf_ipv6_policy, NULL); 628 628 if (err < 0) 629 629 goto errout; 630 630 ··· 4408 4408 u32 ifa_flags; 4409 4409 int err; 4410 4410 4411 - err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, ifa_ipv6_policy); 4411 + err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, ifa_ipv6_policy, 4412 + NULL); 4412 4413 if (err < 0) 4413 4414 return err; 4414 4415 ··· 4521 4520 u32 ifa_flags; 4522 4521 int err; 4523 4522 4524 - err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, ifa_ipv6_policy); 4523 + err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, ifa_ipv6_policy, 4524 + NULL); 4525 4525 if (err < 0) 4526 4526 return err; 4527 4527 ··· 4883 4881 struct sk_buff *skb; 4884 4882 int err; 4885 4883 4886 - err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, ifa_ipv6_policy); 4884 + err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, ifa_ipv6_policy, 4885 + NULL); 4887 4886 if (err < 0) 4888 4887 goto errout; 4889 4888 ··· 5254 5251 if (dev && !__in6_dev_get(dev)) 5255 5252 return -EAFNOSUPPORT; 5256 5253 5257 - return nla_parse_nested(tb, IFLA_INET6_MAX, nla, inet6_af_policy); 5254 + return nla_parse_nested(tb, IFLA_INET6_MAX, nla, inet6_af_policy, 5255 + NULL); 5258 5256 } 5259 5257 5260 5258 static int check_addr_gen_mode(int mode) ··· 5287 5283 if (!idev) 5288 5284 return -EAFNOSUPPORT; 5289 5285 5290 - if (nla_parse_nested(tb, IFLA_INET6_MAX, nla, NULL) < 0) 5286 + if (nla_parse_nested(tb, IFLA_INET6_MAX, nla, NULL, NULL) < 0) 5291 5287 BUG(); 5292 5288 5293 5289 if (tb[IFLA_INET6_TOKEN]) {
+2 -2
net/ipv6/addrlabel.c
··· 413 413 u32 label; 414 414 int err = 0; 415 415 416 - err = nlmsg_parse(nlh, sizeof(*ifal), tb, IFAL_MAX, ifal_policy); 416 + err = nlmsg_parse(nlh, sizeof(*ifal), tb, IFAL_MAX, ifal_policy, NULL); 417 417 if (err < 0) 418 418 return err; 419 419 ··· 532 532 struct ip6addrlbl_entry *p; 533 533 struct sk_buff *skb; 534 534 535 - err = nlmsg_parse(nlh, sizeof(*ifal), tb, IFAL_MAX, ifal_policy); 535 + err = nlmsg_parse(nlh, sizeof(*ifal), tb, IFAL_MAX, ifal_policy, NULL); 536 536 if (err < 0) 537 537 return err; 538 538
+1 -2
net/ipv6/ila/ila_lwt.c
··· 146 146 return -EINVAL; 147 147 } 148 148 149 - ret = nla_parse_nested(tb, ILA_ATTR_MAX, nla, 150 - ila_nl_policy); 149 + ret = nla_parse_nested(tb, ILA_ATTR_MAX, nla, ila_nl_policy, NULL); 151 150 if (ret < 0) 152 151 return ret; 153 152
+4 -2
net/ipv6/route.c
··· 2906 2906 unsigned int pref; 2907 2907 int err; 2908 2908 2909 - err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_ipv6_policy); 2909 + err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_ipv6_policy, 2910 + NULL); 2910 2911 if (err < 0) 2911 2912 goto errout; 2912 2913 ··· 3575 3574 struct flowi6 fl6; 3576 3575 int err, iif = 0, oif = 0; 3577 3576 3578 - err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_ipv6_policy); 3577 + err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_ipv6_policy, 3578 + NULL); 3579 3579 if (err < 0) 3580 3580 goto errout; 3581 3581
+1 -1
net/ipv6/seg6_iptunnel.c
··· 328 328 int err; 329 329 330 330 err = nla_parse_nested(tb, SEG6_IPTUNNEL_MAX, nla, 331 - seg6_iptunnel_policy); 331 + seg6_iptunnel_policy, NULL); 332 332 333 333 if (err < 0) 334 334 return err;
+3 -2
net/mpls/af_mpls.c
··· 1122 1122 int err; 1123 1123 1124 1124 err = nlmsg_parse(nlh, sizeof(*ncm), tb, NETCONFA_MAX, 1125 - devconf_mpls_policy); 1125 + devconf_mpls_policy, NULL); 1126 1126 if (err < 0) 1127 1127 goto errout; 1128 1128 ··· 1643 1643 int index; 1644 1644 int err; 1645 1645 1646 - err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_mpls_policy); 1646 + err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_mpls_policy, 1647 + NULL); 1647 1648 if (err < 0) 1648 1649 goto errout; 1649 1650
+1 -1
net/mpls/mpls_iptunnel.c
··· 168 168 int ret; 169 169 170 170 ret = nla_parse_nested(tb, MPLS_IPTUNNEL_MAX, nla, 171 - mpls_iptunnel_policy); 171 + mpls_iptunnel_policy, NULL); 172 172 if (ret < 0) 173 173 return ret; 174 174
+14 -13
net/netfilter/ipset/ip_set_core.c
··· 295 295 296 296 if (unlikely(!flag_nested(nla))) 297 297 return -IPSET_ERR_PROTOCOL; 298 - if (nla_parse_nested(tb, IPSET_ATTR_IPADDR_MAX, nla, ipaddr_policy)) 298 + if (nla_parse_nested(tb, IPSET_ATTR_IPADDR_MAX, nla, 299 + ipaddr_policy, NULL)) 299 300 return -IPSET_ERR_PROTOCOL; 300 301 if (unlikely(!ip_set_attr_netorder(tb, IPSET_ATTR_IPADDR_IPV4))) 301 302 return -IPSET_ERR_PROTOCOL; ··· 314 313 if (unlikely(!flag_nested(nla))) 315 314 return -IPSET_ERR_PROTOCOL; 316 315 317 - if (nla_parse_nested(tb, IPSET_ATTR_IPADDR_MAX, nla, ipaddr_policy)) 316 + if (nla_parse_nested(tb, IPSET_ATTR_IPADDR_MAX, nla, 317 + ipaddr_policy, NULL)) 318 318 return -IPSET_ERR_PROTOCOL; 319 319 if (unlikely(!ip_set_attr_netorder(tb, IPSET_ATTR_IPADDR_IPV6))) 320 320 return -IPSET_ERR_PROTOCOL; ··· 908 906 /* Without holding any locks, create private part. */ 909 907 if (attr[IPSET_ATTR_DATA] && 910 908 nla_parse_nested(tb, IPSET_ATTR_CREATE_MAX, attr[IPSET_ATTR_DATA], 911 - set->type->create_policy)) { 909 + set->type->create_policy, NULL)) { 912 910 ret = -IPSET_ERR_PROTOCOL; 913 911 goto put_out; 914 912 } ··· 1259 1257 ip_set_id_t index; 1260 1258 1261 1259 /* Second pass, so parser can't fail */ 1262 - nla_parse(cda, IPSET_ATTR_CMD_MAX, 1263 - attr, nlh->nlmsg_len - min_len, ip_set_setname_policy); 1260 + nla_parse(cda, IPSET_ATTR_CMD_MAX, attr, nlh->nlmsg_len - min_len, 1261 + ip_set_setname_policy, NULL); 1264 1262 1265 1263 if (cda[IPSET_ATTR_SETNAME]) { 1266 1264 struct ip_set *set; ··· 1503 1501 memcpy(&errmsg->msg, nlh, nlh->nlmsg_len); 1504 1502 cmdattr = (void *)&errmsg->msg + min_len; 1505 1503 1506 - nla_parse(cda, IPSET_ATTR_CMD_MAX, 1507 - cmdattr, nlh->nlmsg_len - min_len, 1508 - ip_set_adt_policy); 1504 + nla_parse(cda, IPSET_ATTR_CMD_MAX, cmdattr, 1505 + nlh->nlmsg_len - min_len, ip_set_adt_policy, NULL); 1509 1506 1510 1507 errline = nla_data(cda[IPSET_ATTR_LINENO]); 1511 1508 ··· 1550 1549 if (attr[IPSET_ATTR_DATA]) { 1551 1550 if (nla_parse_nested(tb, IPSET_ATTR_ADT_MAX, 1552 1551 attr[IPSET_ATTR_DATA], 1553 - set->type->adt_policy)) 1552 + set->type->adt_policy, NULL)) 1554 1553 return -IPSET_ERR_PROTOCOL; 1555 1554 ret = call_ad(ctnl, skb, set, tb, IPSET_ADD, flags, 1556 1555 use_lineno); ··· 1562 1561 if (nla_type(nla) != IPSET_ATTR_DATA || 1563 1562 !flag_nested(nla) || 1564 1563 nla_parse_nested(tb, IPSET_ATTR_ADT_MAX, nla, 1565 - set->type->adt_policy)) 1564 + set->type->adt_policy, NULL)) 1566 1565 return -IPSET_ERR_PROTOCOL; 1567 1566 ret = call_ad(ctnl, skb, set, tb, IPSET_ADD, 1568 1567 flags, use_lineno); ··· 1604 1603 if (attr[IPSET_ATTR_DATA]) { 1605 1604 if (nla_parse_nested(tb, IPSET_ATTR_ADT_MAX, 1606 1605 attr[IPSET_ATTR_DATA], 1607 - set->type->adt_policy)) 1606 + set->type->adt_policy, NULL)) 1608 1607 return -IPSET_ERR_PROTOCOL; 1609 1608 ret = call_ad(ctnl, skb, set, tb, IPSET_DEL, flags, 1610 1609 use_lineno); ··· 1616 1615 if (nla_type(nla) != IPSET_ATTR_DATA || 1617 1616 !flag_nested(nla) || 1618 1617 nla_parse_nested(tb, IPSET_ATTR_ADT_MAX, nla, 1619 - set->type->adt_policy)) 1618 + set->type->adt_policy, NULL)) 1620 1619 return -IPSET_ERR_PROTOCOL; 1621 1620 ret = call_ad(ctnl, skb, set, tb, IPSET_DEL, 1622 1621 flags, use_lineno); ··· 1647 1646 return -ENOENT; 1648 1647 1649 1648 if (nla_parse_nested(tb, IPSET_ATTR_ADT_MAX, attr[IPSET_ATTR_DATA], 1650 - set->type->adt_policy)) 1649 + set->type->adt_policy, NULL)) 1651 1650 return -IPSET_ERR_PROTOCOL; 1652 1651 1653 1652 rcu_read_lock_bh();
+7 -5
net/netfilter/ipvs/ip_vs_ctl.c
··· 3089 3089 3090 3090 /* Parse mandatory identifying service fields first */ 3091 3091 if (nla == NULL || 3092 - nla_parse_nested(attrs, IPVS_SVC_ATTR_MAX, nla, ip_vs_svc_policy)) 3092 + nla_parse_nested(attrs, IPVS_SVC_ATTR_MAX, nla, 3093 + ip_vs_svc_policy, NULL)) 3093 3094 return -EINVAL; 3094 3095 3095 3096 nla_af = attrs[IPVS_SVC_ATTR_AF]; ··· 3252 3251 mutex_lock(&__ip_vs_mutex); 3253 3252 3254 3253 /* Try to find the service for which to dump destinations */ 3255 - if (nlmsg_parse(cb->nlh, GENL_HDRLEN, attrs, 3256 - IPVS_CMD_ATTR_MAX, ip_vs_cmd_policy)) 3254 + if (nlmsg_parse(cb->nlh, GENL_HDRLEN, attrs, IPVS_CMD_ATTR_MAX, 3255 + ip_vs_cmd_policy, NULL)) 3257 3256 goto out_err; 3258 3257 3259 3258 ··· 3289 3288 3290 3289 /* Parse mandatory identifying destination fields first */ 3291 3290 if (nla == NULL || 3292 - nla_parse_nested(attrs, IPVS_DEST_ATTR_MAX, nla, ip_vs_dest_policy)) 3291 + nla_parse_nested(attrs, IPVS_DEST_ATTR_MAX, nla, 3292 + ip_vs_dest_policy, NULL)) 3293 3293 return -EINVAL; 3294 3294 3295 3295 nla_addr = attrs[IPVS_DEST_ATTR_ADDR]; ··· 3532 3530 if (!info->attrs[IPVS_CMD_ATTR_DAEMON] || 3533 3531 nla_parse_nested(daemon_attrs, IPVS_DAEMON_ATTR_MAX, 3534 3532 info->attrs[IPVS_CMD_ATTR_DAEMON], 3535 - ip_vs_daemon_policy)) 3533 + ip_vs_daemon_policy, NULL)) 3536 3534 goto out; 3537 3535 3538 3536 if (cmd == IPVS_CMD_NEW_DAEMON)
+16 -11
net/netfilter/nf_conntrack_netlink.c
··· 908 908 struct nf_conntrack_l3proto *l3proto; 909 909 int ret = 0; 910 910 911 - ret = nla_parse_nested(tb, CTA_IP_MAX, attr, NULL); 911 + ret = nla_parse_nested(tb, CTA_IP_MAX, attr, NULL, NULL); 912 912 if (ret < 0) 913 913 return ret; 914 914 ··· 917 917 918 918 if (likely(l3proto->nlattr_to_tuple)) { 919 919 ret = nla_validate_nested(attr, CTA_IP_MAX, 920 - l3proto->nla_policy); 920 + l3proto->nla_policy, NULL); 921 921 if (ret == 0) 922 922 ret = l3proto->nlattr_to_tuple(tb, tuple); 923 923 } ··· 938 938 struct nf_conntrack_l4proto *l4proto; 939 939 int ret = 0; 940 940 941 - ret = nla_parse_nested(tb, CTA_PROTO_MAX, attr, proto_nla_policy); 941 + ret = nla_parse_nested(tb, CTA_PROTO_MAX, attr, proto_nla_policy, 942 + NULL); 942 943 if (ret < 0) 943 944 return ret; 944 945 ··· 952 951 953 952 if (likely(l4proto->nlattr_to_tuple)) { 954 953 ret = nla_validate_nested(attr, CTA_PROTO_MAX, 955 - l4proto->nla_policy); 954 + l4proto->nla_policy, NULL); 956 955 if (ret == 0) 957 956 ret = l4proto->nlattr_to_tuple(tb, tuple); 958 957 } ··· 1016 1015 1017 1016 memset(tuple, 0, sizeof(*tuple)); 1018 1017 1019 - err = nla_parse_nested(tb, CTA_TUPLE_MAX, cda[type], tuple_nla_policy); 1018 + err = nla_parse_nested(tb, CTA_TUPLE_MAX, cda[type], tuple_nla_policy, 1019 + NULL); 1020 1020 if (err < 0) 1021 1021 return err; 1022 1022 ··· 1067 1065 int err; 1068 1066 struct nlattr *tb[CTA_HELP_MAX+1]; 1069 1067 1070 - err = nla_parse_nested(tb, CTA_HELP_MAX, attr, help_nla_policy); 1068 + err = nla_parse_nested(tb, CTA_HELP_MAX, attr, help_nla_policy, NULL); 1071 1069 if (err < 0) 1072 1070 return err; 1073 1071 ··· 1568 1566 struct nf_conntrack_l4proto *l4proto; 1569 1567 int err = 0; 1570 1568 1571 - err = nla_parse_nested(tb, CTA_PROTOINFO_MAX, attr, protoinfo_policy); 1569 + err = nla_parse_nested(tb, CTA_PROTOINFO_MAX, attr, protoinfo_policy, 1570 + NULL); 1572 1571 if (err < 0) 1573 1572 return err; 1574 1573 ··· 1594 1591 int err; 1595 1592 struct nlattr *cda[CTA_SEQADJ_MAX+1]; 1596 1593 1597 - err = nla_parse_nested(cda, CTA_SEQADJ_MAX, attr, seqadj_policy); 1594 + err = nla_parse_nested(cda, CTA_SEQADJ_MAX, attr, seqadj_policy, NULL); 1598 1595 if (err < 0) 1599 1596 return err; 1600 1597 ··· 2351 2348 struct nlattr *cda[CTA_MAX+1]; 2352 2349 int ret; 2353 2350 2354 - ret = nla_parse_nested(cda, CTA_MAX, attr, ct_nla_policy); 2351 + ret = nla_parse_nested(cda, CTA_MAX, attr, ct_nla_policy, NULL); 2355 2352 if (ret < 0) 2356 2353 return ret; 2357 2354 ··· 2388 2385 struct nf_conntrack_expect *exp; 2389 2386 int err; 2390 2387 2391 - err = nla_parse_nested(cda, CTA_EXPECT_MAX, attr, exp_nla_policy); 2388 + err = nla_parse_nested(cda, CTA_EXPECT_MAX, attr, exp_nla_policy, 2389 + NULL); 2392 2390 if (err < 0) 2393 2391 return err; 2394 2392 ··· 3008 3004 struct nf_conntrack_tuple nat_tuple = {}; 3009 3005 int err; 3010 3006 3011 - err = nla_parse_nested(tb, CTA_EXPECT_NAT_MAX, attr, exp_nat_nla_policy); 3007 + err = nla_parse_nested(tb, CTA_EXPECT_NAT_MAX, attr, 3008 + exp_nat_nla_policy, NULL); 3012 3009 if (err < 0) 3013 3010 return err; 3014 3011
+1 -1
net/netfilter/nf_conntrack_proto_dccp.c
··· 665 665 return 0; 666 666 667 667 err = nla_parse_nested(tb, CTA_PROTOINFO_DCCP_MAX, attr, 668 - dccp_nla_policy); 668 + dccp_nla_policy, NULL); 669 669 if (err < 0) 670 670 return err; 671 671
+2 -4
net/netfilter/nf_conntrack_proto_sctp.c
··· 584 584 if (!attr) 585 585 return 0; 586 586 587 - err = nla_parse_nested(tb, 588 - CTA_PROTOINFO_SCTP_MAX, 589 - attr, 590 - sctp_nla_policy); 587 + err = nla_parse_nested(tb, CTA_PROTOINFO_SCTP_MAX, attr, 588 + sctp_nla_policy, NULL); 591 589 if (err < 0) 592 590 return err; 593 591
+2 -1
net/netfilter/nf_conntrack_proto_tcp.c
··· 1234 1234 if (!pattr) 1235 1235 return 0; 1236 1236 1237 - err = nla_parse_nested(tb, CTA_PROTOINFO_TCP_MAX, pattr, tcp_nla_policy); 1237 + err = nla_parse_nested(tb, CTA_PROTOINFO_TCP_MAX, pattr, 1238 + tcp_nla_policy, NULL); 1238 1239 if (err < 0) 1239 1240 return err; 1240 1241
+3 -2
net/netfilter/nf_nat_core.c
··· 751 751 const struct nf_nat_l4proto *l4proto; 752 752 int err; 753 753 754 - err = nla_parse_nested(tb, CTA_PROTONAT_MAX, attr, protonat_nla_policy); 754 + err = nla_parse_nested(tb, CTA_PROTONAT_MAX, attr, 755 + protonat_nla_policy, NULL); 755 756 if (err < 0) 756 757 return err; 757 758 ··· 781 780 782 781 memset(range, 0, sizeof(*range)); 783 782 784 - err = nla_parse_nested(tb, CTA_NAT_MAX, nat, nat_nla_policy); 783 + err = nla_parse_nested(tb, CTA_NAT_MAX, nat, nat_nla_policy, NULL); 785 784 if (err < 0) 786 785 return err; 787 786
+16 -11
net/netfilter/nf_tables_api.c
··· 1182 1182 struct nft_stats *stats; 1183 1183 int err; 1184 1184 1185 - err = nla_parse_nested(tb, NFTA_COUNTER_MAX, attr, nft_counter_policy); 1185 + err = nla_parse_nested(tb, NFTA_COUNTER_MAX, attr, nft_counter_policy, 1186 + NULL); 1186 1187 if (err < 0) 1187 1188 return ERR_PTR(err); 1188 1189 ··· 1258 1257 int err; 1259 1258 1260 1259 err = nla_parse_nested(ha, NFTA_HOOK_MAX, nla[NFTA_CHAIN_HOOK], 1261 - nft_hook_policy); 1260 + nft_hook_policy, NULL); 1262 1261 if (err < 0) 1263 1262 return err; 1264 1263 ··· 1725 1724 struct nlattr *tb[NFTA_EXPR_MAX + 1]; 1726 1725 int err; 1727 1726 1728 - err = nla_parse_nested(tb, NFTA_EXPR_MAX, nla, nft_expr_policy); 1727 + err = nla_parse_nested(tb, NFTA_EXPR_MAX, nla, nft_expr_policy, NULL); 1729 1728 if (err < 0) 1730 1729 return err; 1731 1730 ··· 1735 1734 1736 1735 if (tb[NFTA_EXPR_DATA]) { 1737 1736 err = nla_parse_nested(info->tb, type->maxattr, 1738 - tb[NFTA_EXPR_DATA], type->policy); 1737 + tb[NFTA_EXPR_DATA], type->policy, NULL); 1739 1738 if (err < 0) 1740 1739 goto err1; 1741 1740 } else ··· 2880 2879 struct nlattr *da[NFTA_SET_DESC_MAX + 1]; 2881 2880 int err; 2882 2881 2883 - err = nla_parse_nested(da, NFTA_SET_DESC_MAX, nla, nft_set_desc_policy); 2882 + err = nla_parse_nested(da, NFTA_SET_DESC_MAX, nla, 2883 + nft_set_desc_policy, NULL); 2884 2884 if (err < 0) 2885 2885 return err; 2886 2886 ··· 3383 3381 int event, err; 3384 3382 3385 3383 err = nlmsg_parse(cb->nlh, sizeof(struct nfgenmsg), nla, 3386 - NFTA_SET_ELEM_LIST_MAX, nft_set_elem_list_policy); 3384 + NFTA_SET_ELEM_LIST_MAX, nft_set_elem_list_policy, 3385 + NULL); 3387 3386 if (err < 0) 3388 3387 return err; 3389 3388 ··· 3643 3640 int err; 3644 3641 3645 3642 err = nla_parse_nested(nla, NFTA_SET_ELEM_MAX, attr, 3646 - nft_set_elem_policy); 3643 + nft_set_elem_policy, NULL); 3647 3644 if (err < 0) 3648 3645 return err; 3649 3646 ··· 3873 3870 int err; 3874 3871 3875 3872 err = nla_parse_nested(nla, NFTA_SET_ELEM_MAX, attr, 3876 - nft_set_elem_policy); 3873 + nft_set_elem_policy, NULL); 3877 3874 if (err < 0) 3878 3875 goto err1; 3879 3876 ··· 4104 4101 int err; 4105 4102 4106 4103 if (attr) { 4107 - err = nla_parse_nested(tb, type->maxattr, attr, type->policy); 4104 + err = nla_parse_nested(tb, type->maxattr, attr, type->policy, 4105 + NULL); 4108 4106 if (err < 0) 4109 4107 goto err1; 4110 4108 } else { ··· 5318 5314 struct nft_chain *chain; 5319 5315 int err; 5320 5316 5321 - err = nla_parse_nested(tb, NFTA_VERDICT_MAX, nla, nft_verdict_policy); 5317 + err = nla_parse_nested(tb, NFTA_VERDICT_MAX, nla, nft_verdict_policy, 5318 + NULL); 5322 5319 if (err < 0) 5323 5320 return err; 5324 5321 ··· 5449 5444 struct nlattr *tb[NFTA_DATA_MAX + 1]; 5450 5445 int err; 5451 5446 5452 - err = nla_parse_nested(tb, NFTA_DATA_MAX, nla, nft_data_policy); 5447 + err = nla_parse_nested(tb, NFTA_DATA_MAX, nla, nft_data_policy, NULL); 5453 5448 if (err < 0) 5454 5449 return err; 5455 5450
+6 -5
net/netfilter/nfnetlink.c
··· 192 192 int attrlen = nlh->nlmsg_len - min_len; 193 193 __u8 subsys_id = NFNL_SUBSYS_ID(type); 194 194 195 - err = nla_parse(cda, ss->cb[cb_id].attr_count, 196 - attr, attrlen, ss->cb[cb_id].policy); 195 + err = nla_parse(cda, ss->cb[cb_id].attr_count, attr, attrlen, 196 + ss->cb[cb_id].policy, NULL); 197 197 if (err < 0) { 198 198 rcu_read_unlock(); 199 199 return err; ··· 377 377 struct nlattr *attr = (void *)nlh + min_len; 378 378 int attrlen = nlh->nlmsg_len - min_len; 379 379 380 - err = nla_parse(cda, ss->cb[cb_id].attr_count, 381 - attr, attrlen, ss->cb[cb_id].policy); 380 + err = nla_parse(cda, ss->cb[cb_id].attr_count, attr, 381 + attrlen, ss->cb[cb_id].policy, NULL); 382 382 if (err < 0) 383 383 goto ack; 384 384 ··· 467 467 skb->len < NLMSG_HDRLEN + sizeof(struct nfgenmsg)) 468 468 return; 469 469 470 - err = nla_parse(cda, NFNL_BATCH_MAX, attr, attrlen, nfnl_batch_policy); 470 + err = nla_parse(cda, NFNL_BATCH_MAX, attr, attrlen, nfnl_batch_policy, 471 + NULL); 471 472 if (err < 0) { 472 473 netlink_ack(skb, nlh, err, NULL); 473 474 return;
+1 -1
net/netfilter/nft_compat.c
··· 200 200 int err; 201 201 202 202 err = nla_parse_nested(tb, NFTA_RULE_COMPAT_MAX, attr, 203 - nft_rule_compat_policy); 203 + nft_rule_compat_policy, NULL); 204 204 if (err < 0) 205 205 return err; 206 206
+10 -9
net/netlabel/netlabel_cipso_v4.c
··· 101 101 102 102 if (nla_validate_nested(info->attrs[NLBL_CIPSOV4_A_TAGLST], 103 103 NLBL_CIPSOV4_A_MAX, 104 - netlbl_cipsov4_genl_policy) != 0) 104 + netlbl_cipsov4_genl_policy, NULL) != 0) 105 105 return -EINVAL; 106 106 107 107 nla_for_each_nested(nla, info->attrs[NLBL_CIPSOV4_A_TAGLST], nla_rem) ··· 148 148 149 149 if (nla_validate_nested(info->attrs[NLBL_CIPSOV4_A_MLSLVLLST], 150 150 NLBL_CIPSOV4_A_MAX, 151 - netlbl_cipsov4_genl_policy) != 0) 151 + netlbl_cipsov4_genl_policy, NULL) != 0) 152 152 return -EINVAL; 153 153 154 154 doi_def = kmalloc(sizeof(*doi_def), GFP_KERNEL); ··· 170 170 info->attrs[NLBL_CIPSOV4_A_MLSLVLLST], 171 171 nla_a_rem) 172 172 if (nla_type(nla_a) == NLBL_CIPSOV4_A_MLSLVL) { 173 - if (nla_validate_nested(nla_a, 174 - NLBL_CIPSOV4_A_MAX, 175 - netlbl_cipsov4_genl_policy) != 0) 176 - goto add_std_failure; 173 + if (nla_validate_nested(nla_a, NLBL_CIPSOV4_A_MAX, 174 + netlbl_cipsov4_genl_policy, 175 + NULL) != 0) 176 + goto add_std_failure; 177 177 nla_for_each_nested(nla_b, nla_a, nla_b_rem) 178 178 switch (nla_type(nla_b)) { 179 179 case NLBL_CIPSOV4_A_MLSLVLLOC: ··· 236 236 if (info->attrs[NLBL_CIPSOV4_A_MLSCATLST]) { 237 237 if (nla_validate_nested(info->attrs[NLBL_CIPSOV4_A_MLSCATLST], 238 238 NLBL_CIPSOV4_A_MAX, 239 - netlbl_cipsov4_genl_policy) != 0) 239 + netlbl_cipsov4_genl_policy, NULL) != 0) 240 240 goto add_std_failure; 241 241 242 242 nla_for_each_nested(nla_a, ··· 244 244 nla_a_rem) 245 245 if (nla_type(nla_a) == NLBL_CIPSOV4_A_MLSCAT) { 246 246 if (nla_validate_nested(nla_a, 247 - NLBL_CIPSOV4_A_MAX, 248 - netlbl_cipsov4_genl_policy) != 0) 247 + NLBL_CIPSOV4_A_MAX, 248 + netlbl_cipsov4_genl_policy, 249 + NULL) != 0) 249 250 goto add_std_failure; 250 251 nla_for_each_nested(nla_b, nla_a, nla_b_rem) 251 252 switch (nla_type(nla_b)) {
+1 -1
net/netlink/genetlink.c
··· 574 574 575 575 if (attrbuf) { 576 576 err = nlmsg_parse(nlh, hdrlen, attrbuf, family->maxattr, 577 - ops->policy); 577 + ops->policy, NULL); 578 578 if (err < 0) 579 579 goto out; 580 580 }
+3 -2
net/nfc/netlink.c
··· 119 119 u32 idx; 120 120 121 121 rc = nlmsg_parse(cb->nlh, GENL_HDRLEN + nfc_genl_family.hdrsize, 122 - attrbuf, nfc_genl_family.maxattr, nfc_genl_policy); 122 + attrbuf, nfc_genl_family.maxattr, nfc_genl_policy, 123 + NULL); 123 124 if (rc < 0) 124 125 return ERR_PTR(rc); 125 126 ··· 1162 1161 1163 1162 nla_for_each_nested(attr, info->attrs[NFC_ATTR_LLC_SDP], rem) { 1164 1163 rc = nla_parse_nested(sdp_attrs, NFC_SDP_ATTR_MAX, attr, 1165 - nfc_sdp_genl_policy); 1164 + nfc_sdp_genl_policy, NULL); 1166 1165 1167 1166 if (rc != 0) { 1168 1167 rc = -EINVAL;
+1 -1
net/openvswitch/datapath.c
··· 1353 1353 int err; 1354 1354 1355 1355 err = genlmsg_parse(cb->nlh, &dp_flow_genl_family, a, 1356 - OVS_FLOW_ATTR_MAX, flow_policy); 1356 + OVS_FLOW_ATTR_MAX, flow_policy, NULL); 1357 1357 if (err) 1358 1358 return err; 1359 1359 ufid_flags = ovs_nla_get_ufid_flags(a[OVS_FLOW_ATTR_UFID_FLAGS]);
+2 -2
net/openvswitch/flow_netlink.c
··· 2427 2427 struct nlattr *a[OVS_USERSPACE_ATTR_MAX + 1]; 2428 2428 int error; 2429 2429 2430 - error = nla_parse_nested(a, OVS_USERSPACE_ATTR_MAX, 2431 - attr, userspace_policy); 2430 + error = nla_parse_nested(a, OVS_USERSPACE_ATTR_MAX, attr, 2431 + userspace_policy, NULL); 2432 2432 if (error) 2433 2433 return error; 2434 2434
+2 -1
net/openvswitch/vport-vxlan.c
··· 70 70 if (nla_len(attr) < sizeof(struct nlattr)) 71 71 return -EINVAL; 72 72 73 - err = nla_parse_nested(exts, OVS_VXLAN_EXT_MAX, attr, exts_policy); 73 + err = nla_parse_nested(exts, OVS_VXLAN_EXT_MAX, attr, exts_policy, 74 + NULL); 74 75 if (err < 0) 75 76 return err; 76 77
+4 -2
net/phonet/pn_netlink.c
··· 78 78 79 79 ASSERT_RTNL(); 80 80 81 - err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, ifa_phonet_policy); 81 + err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, ifa_phonet_policy, 82 + NULL); 82 83 if (err < 0) 83 84 return err; 84 85 ··· 244 243 245 244 ASSERT_RTNL(); 246 245 247 - err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_phonet_policy); 246 + err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_phonet_policy, 247 + NULL); 248 248 if (err < 0) 249 249 return err; 250 250
+1 -1
net/qrtr/qrtr.c
··· 957 957 958 958 ASSERT_RTNL(); 959 959 960 - rc = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, qrtr_policy); 960 + rc = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, qrtr_policy, NULL); 961 961 if (rc < 0) 962 962 return rc; 963 963
+11 -9
net/sched/act_api.c
··· 557 557 int err; 558 558 559 559 if (name == NULL) { 560 - err = nla_parse_nested(tb, TCA_ACT_MAX, nla, NULL); 560 + err = nla_parse_nested(tb, TCA_ACT_MAX, nla, NULL, NULL); 561 561 if (err < 0) 562 562 goto err_out; 563 563 err = -EINVAL; ··· 654 654 int err; 655 655 int i; 656 656 657 - err = nla_parse_nested(tb, TCA_ACT_MAX_PRIO, nla, NULL); 657 + err = nla_parse_nested(tb, TCA_ACT_MAX_PRIO, nla, NULL, NULL); 658 658 if (err < 0) 659 659 return err; 660 660 ··· 786 786 int index; 787 787 int err; 788 788 789 - err = nla_parse_nested(tb, TCA_ACT_MAX, nla, NULL); 789 + err = nla_parse_nested(tb, TCA_ACT_MAX, nla, NULL, NULL); 790 790 if (err < 0) 791 791 goto err_out; 792 792 ··· 835 835 836 836 b = skb_tail_pointer(skb); 837 837 838 - err = nla_parse_nested(tb, TCA_ACT_MAX, nla, NULL); 838 + err = nla_parse_nested(tb, TCA_ACT_MAX, nla, NULL, NULL); 839 839 if (err < 0) 840 840 goto err_out; 841 841 ··· 921 921 struct tc_action *act; 922 922 LIST_HEAD(actions); 923 923 924 - ret = nla_parse_nested(tb, TCA_ACT_MAX_PRIO, nla, NULL); 924 + ret = nla_parse_nested(tb, TCA_ACT_MAX_PRIO, nla, NULL, NULL); 925 925 if (ret < 0) 926 926 return ret; 927 927 ··· 1004 1004 !netlink_capable(skb, CAP_NET_ADMIN)) 1005 1005 return -EPERM; 1006 1006 1007 - ret = nlmsg_parse(n, sizeof(struct tcamsg), tca, TCA_ACT_MAX, NULL); 1007 + ret = nlmsg_parse(n, sizeof(struct tcamsg), tca, TCA_ACT_MAX, NULL, 1008 + NULL); 1008 1009 if (ret < 0) 1009 1010 return ret; 1010 1011 ··· 1052 1051 struct nlattr *nla[TCAA_MAX + 1]; 1053 1052 struct nlattr *kind; 1054 1053 1055 - if (nlmsg_parse(n, sizeof(struct tcamsg), nla, TCAA_MAX, NULL) < 0) 1054 + if (nlmsg_parse(n, sizeof(struct tcamsg), nla, TCAA_MAX, 1055 + NULL, NULL) < 0) 1056 1056 return NULL; 1057 1057 tb1 = nla[TCA_ACT_TAB]; 1058 1058 if (tb1 == NULL) 1059 1059 return NULL; 1060 1060 1061 1061 if (nla_parse(tb, TCA_ACT_MAX_PRIO, nla_data(tb1), 1062 - NLMSG_ALIGN(nla_len(tb1)), NULL) < 0) 1062 + NLMSG_ALIGN(nla_len(tb1)), NULL, NULL) < 0) 1063 1063 return NULL; 1064 1064 1065 1065 if (tb[1] == NULL) 1066 1066 return NULL; 1067 - if (nla_parse_nested(tb2, TCA_ACT_MAX, tb[1], NULL) < 0) 1067 + if (nla_parse_nested(tb2, TCA_ACT_MAX, tb[1], NULL, NULL) < 0) 1068 1068 return NULL; 1069 1069 kind = tb2[TCA_ACT_KIND]; 1070 1070
+1 -1
net/sched/act_bpf.c
··· 283 283 if (!nla) 284 284 return -EINVAL; 285 285 286 - ret = nla_parse_nested(tb, TCA_ACT_BPF_MAX, nla, act_bpf_policy); 286 + ret = nla_parse_nested(tb, TCA_ACT_BPF_MAX, nla, act_bpf_policy, NULL); 287 287 if (ret < 0) 288 288 return ret; 289 289
+2 -1
net/sched/act_connmark.c
··· 109 109 if (!nla) 110 110 return -EINVAL; 111 111 112 - ret = nla_parse_nested(tb, TCA_CONNMARK_MAX, nla, connmark_policy); 112 + ret = nla_parse_nested(tb, TCA_CONNMARK_MAX, nla, connmark_policy, 113 + NULL); 113 114 if (ret < 0) 114 115 return ret; 115 116
+1 -1
net/sched/act_csum.c
··· 59 59 if (nla == NULL) 60 60 return -EINVAL; 61 61 62 - err = nla_parse_nested(tb, TCA_CSUM_MAX, nla, csum_policy); 62 + err = nla_parse_nested(tb, TCA_CSUM_MAX, nla, csum_policy, NULL); 63 63 if (err < 0) 64 64 return err; 65 65
+1 -1
net/sched/act_gact.c
··· 73 73 if (nla == NULL) 74 74 return -EINVAL; 75 75 76 - err = nla_parse_nested(tb, TCA_GACT_MAX, nla, gact_policy); 76 + err = nla_parse_nested(tb, TCA_GACT_MAX, nla, gact_policy, NULL); 77 77 if (err < 0) 78 78 return err; 79 79
+2 -2
net/sched/act_ife.c
··· 443 443 int ret = 0; 444 444 int err; 445 445 446 - err = nla_parse_nested(tb, TCA_IFE_MAX, nla, ife_policy); 446 + err = nla_parse_nested(tb, TCA_IFE_MAX, nla, ife_policy, NULL); 447 447 if (err < 0) 448 448 return err; 449 449 ··· 514 514 515 515 if (tb[TCA_IFE_METALST]) { 516 516 err = nla_parse_nested(tb2, IFE_META_MAX, tb[TCA_IFE_METALST], 517 - NULL); 517 + NULL, NULL); 518 518 if (err) { 519 519 metadata_parse_err: 520 520 if (exists)
+1 -1
net/sched/act_ipt.c
··· 107 107 if (nla == NULL) 108 108 return -EINVAL; 109 109 110 - err = nla_parse_nested(tb, TCA_IPT_MAX, nla, ipt_policy); 110 + err = nla_parse_nested(tb, TCA_IPT_MAX, nla, ipt_policy, NULL); 111 111 if (err < 0) 112 112 return err; 113 113
+1 -1
net/sched/act_mirred.c
··· 87 87 88 88 if (nla == NULL) 89 89 return -EINVAL; 90 - ret = nla_parse_nested(tb, TCA_MIRRED_MAX, nla, mirred_policy); 90 + ret = nla_parse_nested(tb, TCA_MIRRED_MAX, nla, mirred_policy, NULL); 91 91 if (ret < 0) 92 92 return ret; 93 93 if (tb[TCA_MIRRED_PARMS] == NULL)
+1 -1
net/sched/act_nat.c
··· 50 50 if (nla == NULL) 51 51 return -EINVAL; 52 52 53 - err = nla_parse_nested(tb, TCA_NAT_MAX, nla, nat_policy); 53 + err = nla_parse_nested(tb, TCA_NAT_MAX, nla, nat_policy, NULL); 54 54 if (err < 0) 55 55 return err; 56 56
+2 -2
net/sched/act_pedit.c
··· 72 72 } 73 73 74 74 err = nla_parse_nested(tb, TCA_PEDIT_KEY_EX_MAX, ka, 75 - pedit_key_ex_policy); 75 + pedit_key_ex_policy, NULL); 76 76 if (err) 77 77 goto err_out; 78 78 ··· 147 147 if (nla == NULL) 148 148 return -EINVAL; 149 149 150 - err = nla_parse_nested(tb, TCA_PEDIT_MAX, nla, pedit_policy); 150 + err = nla_parse_nested(tb, TCA_PEDIT_MAX, nla, pedit_policy, NULL); 151 151 if (err < 0) 152 152 return err; 153 153
+1 -1
net/sched/act_police.c
··· 90 90 if (nla == NULL) 91 91 return -EINVAL; 92 92 93 - err = nla_parse_nested(tb, TCA_POLICE_MAX, nla, police_policy); 93 + err = nla_parse_nested(tb, TCA_POLICE_MAX, nla, police_policy, NULL); 94 94 if (err < 0) 95 95 return err; 96 96
+1 -1
net/sched/act_sample.c
··· 50 50 51 51 if (!nla) 52 52 return -EINVAL; 53 - ret = nla_parse_nested(tb, TCA_SAMPLE_MAX, nla, sample_policy); 53 + ret = nla_parse_nested(tb, TCA_SAMPLE_MAX, nla, sample_policy, NULL); 54 54 if (ret < 0) 55 55 return ret; 56 56 if (!tb[TCA_SAMPLE_PARMS] || !tb[TCA_SAMPLE_RATE] ||
+1 -1
net/sched/act_simple.c
··· 94 94 if (nla == NULL) 95 95 return -EINVAL; 96 96 97 - err = nla_parse_nested(tb, TCA_DEF_MAX, nla, simple_policy); 97 + err = nla_parse_nested(tb, TCA_DEF_MAX, nla, simple_policy, NULL); 98 98 if (err < 0) 99 99 return err; 100 100
+1 -1
net/sched/act_skbedit.c
··· 82 82 if (nla == NULL) 83 83 return -EINVAL; 84 84 85 - err = nla_parse_nested(tb, TCA_SKBEDIT_MAX, nla, skbedit_policy); 85 + err = nla_parse_nested(tb, TCA_SKBEDIT_MAX, nla, skbedit_policy, NULL); 86 86 if (err < 0) 87 87 return err; 88 88
+1 -1
net/sched/act_skbmod.c
··· 103 103 if (!nla) 104 104 return -EINVAL; 105 105 106 - err = nla_parse_nested(tb, TCA_SKBMOD_MAX, nla, skbmod_policy); 106 + err = nla_parse_nested(tb, TCA_SKBMOD_MAX, nla, skbmod_policy, NULL); 107 107 if (err < 0) 108 108 return err; 109 109
+2 -1
net/sched/act_tunnel_key.c
··· 89 89 if (!nla) 90 90 return -EINVAL; 91 91 92 - err = nla_parse_nested(tb, TCA_TUNNEL_KEY_MAX, nla, tunnel_key_policy); 92 + err = nla_parse_nested(tb, TCA_TUNNEL_KEY_MAX, nla, tunnel_key_policy, 93 + NULL); 93 94 if (err < 0) 94 95 return err; 95 96
+1 -1
net/sched/act_vlan.c
··· 121 121 if (!nla) 122 122 return -EINVAL; 123 123 124 - err = nla_parse_nested(tb, TCA_VLAN_MAX, nla, vlan_policy); 124 + err = nla_parse_nested(tb, TCA_VLAN_MAX, nla, vlan_policy, NULL); 125 125 if (err < 0) 126 126 return err; 127 127
+1 -1
net/sched/cls_api.c
··· 229 229 replay: 230 230 tp_created = 0; 231 231 232 - err = nlmsg_parse(n, sizeof(*t), tca, TCA_MAX, NULL); 232 + err = nlmsg_parse(n, sizeof(*t), tca, TCA_MAX, NULL, NULL); 233 233 if (err < 0) 234 234 return err; 235 235
+1 -1
net/sched/cls_basic.c
··· 174 174 return -EINVAL; 175 175 176 176 err = nla_parse_nested(tb, TCA_BASIC_MAX, tca[TCA_OPTIONS], 177 - basic_policy); 177 + basic_policy, NULL); 178 178 if (err < 0) 179 179 return err; 180 180
+2 -1
net/sched/cls_bpf.c
··· 478 478 if (tca[TCA_OPTIONS] == NULL) 479 479 return -EINVAL; 480 480 481 - ret = nla_parse_nested(tb, TCA_BPF_MAX, tca[TCA_OPTIONS], bpf_policy); 481 + ret = nla_parse_nested(tb, TCA_BPF_MAX, tca[TCA_OPTIONS], bpf_policy, 482 + NULL); 482 483 if (ret < 0) 483 484 return ret; 484 485
+1 -1
net/sched/cls_cgroup.c
··· 99 99 new->handle = handle; 100 100 new->tp = tp; 101 101 err = nla_parse_nested(tb, TCA_CGROUP_MAX, tca[TCA_OPTIONS], 102 - cgroup_policy); 102 + cgroup_policy, NULL); 103 103 if (err < 0) 104 104 goto errout; 105 105
+1 -1
net/sched/cls_flow.c
··· 400 400 if (opt == NULL) 401 401 return -EINVAL; 402 402 403 - err = nla_parse_nested(tb, TCA_FLOW_MAX, opt, flow_policy); 403 + err = nla_parse_nested(tb, TCA_FLOW_MAX, opt, flow_policy, NULL); 404 404 if (err < 0) 405 405 return err; 406 406
+2 -1
net/sched/cls_flower.c
··· 848 848 if (!tb) 849 849 return -ENOBUFS; 850 850 851 - err = nla_parse_nested(tb, TCA_FLOWER_MAX, tca[TCA_OPTIONS], fl_policy); 851 + err = nla_parse_nested(tb, TCA_FLOWER_MAX, tca[TCA_OPTIONS], 852 + fl_policy, NULL); 852 853 if (err < 0) 853 854 goto errout_tb; 854 855
+1 -1
net/sched/cls_fw.c
··· 250 250 if (!opt) 251 251 return handle ? -EINVAL : 0; /* Succeed if it is old method. */ 252 252 253 - err = nla_parse_nested(tb, TCA_FW_MAX, opt, fw_policy); 253 + err = nla_parse_nested(tb, TCA_FW_MAX, opt, fw_policy, NULL); 254 254 if (err < 0) 255 255 return err; 256 256
+2 -2
net/sched/cls_matchall.c
··· 161 161 if (head) 162 162 return -EEXIST; 163 163 164 - err = nla_parse_nested(tb, TCA_MATCHALL_MAX, 165 - tca[TCA_OPTIONS], mall_policy); 164 + err = nla_parse_nested(tb, TCA_MATCHALL_MAX, tca[TCA_OPTIONS], 165 + mall_policy, NULL); 166 166 if (err < 0) 167 167 return err; 168 168
+1 -1
net/sched/cls_route.c
··· 489 489 if (opt == NULL) 490 490 return handle ? -EINVAL : 0; 491 491 492 - err = nla_parse_nested(tb, TCA_ROUTE4_MAX, opt, route4_policy); 492 + err = nla_parse_nested(tb, TCA_ROUTE4_MAX, opt, route4_policy, NULL); 493 493 if (err < 0) 494 494 return err; 495 495
+1 -1
net/sched/cls_rsvp.h
··· 484 484 if (opt == NULL) 485 485 return handle ? -EINVAL : 0; 486 486 487 - err = nla_parse_nested(tb, TCA_RSVP_MAX, opt, rsvp_policy); 487 + err = nla_parse_nested(tb, TCA_RSVP_MAX, opt, rsvp_policy, NULL); 488 488 if (err < 0) 489 489 return err; 490 490
+1 -1
net/sched/cls_tcindex.c
··· 482 482 if (!opt) 483 483 return 0; 484 484 485 - err = nla_parse_nested(tb, TCA_TCINDEX_MAX, opt, tcindex_policy); 485 + err = nla_parse_nested(tb, TCA_TCINDEX_MAX, opt, tcindex_policy, NULL); 486 486 if (err < 0) 487 487 return err; 488 488
+1 -1
net/sched/cls_u32.c
··· 860 860 if (opt == NULL) 861 861 return handle ? -EINVAL : 0; 862 862 863 - err = nla_parse_nested(tb, TCA_U32_MAX, opt, u32_policy); 863 + err = nla_parse_nested(tb, TCA_U32_MAX, opt, u32_policy, NULL); 864 864 if (err < 0) 865 865 return err; 866 866
+1 -1
net/sched/em_meta.c
··· 912 912 struct tcf_meta_hdr *hdr; 913 913 struct meta_match *meta = NULL; 914 914 915 - err = nla_parse(tb, TCA_EM_META_MAX, data, len, meta_policy); 915 + err = nla_parse(tb, TCA_EM_META_MAX, data, len, meta_policy, NULL); 916 916 if (err < 0) 917 917 goto errout; 918 918
+1 -1
net/sched/ematch.c
··· 314 314 if (!nla) 315 315 return 0; 316 316 317 - err = nla_parse_nested(tb, TCA_EMATCH_TREE_MAX, nla, em_policy); 317 + err = nla_parse_nested(tb, TCA_EMATCH_TREE_MAX, nla, em_policy, NULL); 318 318 if (err < 0) 319 319 goto errout; 320 320
+5 -5
net/sched/sch_api.c
··· 457 457 u16 *tab = NULL; 458 458 int err; 459 459 460 - err = nla_parse_nested(tb, TCA_STAB_MAX, opt, stab_policy); 460 + err = nla_parse_nested(tb, TCA_STAB_MAX, opt, stab_policy, NULL); 461 461 if (err < 0) 462 462 return ERR_PTR(err); 463 463 if (!tb[TCA_STAB_BASE]) ··· 1131 1131 !netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)) 1132 1132 return -EPERM; 1133 1133 1134 - err = nlmsg_parse(n, sizeof(*tcm), tca, TCA_MAX, NULL); 1134 + err = nlmsg_parse(n, sizeof(*tcm), tca, TCA_MAX, NULL, NULL); 1135 1135 if (err < 0) 1136 1136 return err; 1137 1137 ··· 1200 1200 1201 1201 replay: 1202 1202 /* Reinit, just in case something touches this. */ 1203 - err = nlmsg_parse(n, sizeof(*tcm), tca, TCA_MAX, NULL); 1203 + err = nlmsg_parse(n, sizeof(*tcm), tca, TCA_MAX, NULL, NULL); 1204 1204 if (err < 0) 1205 1205 return err; 1206 1206 ··· 1515 1515 idx = 0; 1516 1516 ASSERT_RTNL(); 1517 1517 1518 - err = nlmsg_parse(nlh, sizeof(*tcm), tca, TCA_MAX, NULL); 1518 + err = nlmsg_parse(nlh, sizeof(*tcm), tca, TCA_MAX, NULL, NULL); 1519 1519 if (err < 0) 1520 1520 return err; 1521 1521 ··· 1577 1577 !netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)) 1578 1578 return -EPERM; 1579 1579 1580 - err = nlmsg_parse(n, sizeof(*tcm), tca, TCA_MAX, NULL); 1580 + err = nlmsg_parse(n, sizeof(*tcm), tca, TCA_MAX, NULL, NULL); 1581 1581 if (err < 0) 1582 1582 return err; 1583 1583
+1 -1
net/sched/sch_atm.c
··· 214 214 if (opt == NULL) 215 215 return -EINVAL; 216 216 217 - error = nla_parse_nested(tb, TCA_ATM_MAX, opt, atm_policy); 217 + error = nla_parse_nested(tb, TCA_ATM_MAX, opt, atm_policy, NULL); 218 218 if (error < 0) 219 219 return error; 220 220
+2 -2
net/sched/sch_cbq.c
··· 1137 1137 struct tc_ratespec *r; 1138 1138 int err; 1139 1139 1140 - err = nla_parse_nested(tb, TCA_CBQ_MAX, opt, cbq_policy); 1140 + err = nla_parse_nested(tb, TCA_CBQ_MAX, opt, cbq_policy, NULL); 1141 1141 if (err < 0) 1142 1142 return err; 1143 1143 ··· 1474 1474 if (opt == NULL) 1475 1475 return -EINVAL; 1476 1476 1477 - err = nla_parse_nested(tb, TCA_CBQ_MAX, opt, cbq_policy); 1477 + err = nla_parse_nested(tb, TCA_CBQ_MAX, opt, cbq_policy, NULL); 1478 1478 if (err < 0) 1479 1479 return err; 1480 1480
+1 -1
net/sched/sch_choke.c
··· 357 357 if (opt == NULL) 358 358 return -EINVAL; 359 359 360 - err = nla_parse_nested(tb, TCA_CHOKE_MAX, opt, choke_policy); 360 + err = nla_parse_nested(tb, TCA_CHOKE_MAX, opt, choke_policy, NULL); 361 361 if (err < 0) 362 362 return err; 363 363
+1 -1
net/sched/sch_codel.c
··· 140 140 if (!opt) 141 141 return -EINVAL; 142 142 143 - err = nla_parse_nested(tb, TCA_CODEL_MAX, opt, codel_policy); 143 + err = nla_parse_nested(tb, TCA_CODEL_MAX, opt, codel_policy, NULL); 144 144 if (err < 0) 145 145 return err; 146 146
+1 -1
net/sched/sch_drr.c
··· 76 76 if (!opt) 77 77 return -EINVAL; 78 78 79 - err = nla_parse_nested(tb, TCA_DRR_MAX, opt, drr_policy); 79 + err = nla_parse_nested(tb, TCA_DRR_MAX, opt, drr_policy, NULL); 80 80 if (err < 0) 81 81 return err; 82 82
+2 -2
net/sched/sch_dsmark.c
··· 129 129 if (!opt) 130 130 goto errout; 131 131 132 - err = nla_parse_nested(tb, TCA_DSMARK_MAX, opt, dsmark_policy); 132 + err = nla_parse_nested(tb, TCA_DSMARK_MAX, opt, dsmark_policy, NULL); 133 133 if (err < 0) 134 134 goto errout; 135 135 ··· 342 342 if (!opt) 343 343 goto errout; 344 344 345 - err = nla_parse_nested(tb, TCA_DSMARK_MAX, opt, dsmark_policy); 345 + err = nla_parse_nested(tb, TCA_DSMARK_MAX, opt, dsmark_policy, NULL); 346 346 if (err < 0) 347 347 goto errout; 348 348
+1 -1
net/sched/sch_fq.c
··· 698 698 if (!opt) 699 699 return -EINVAL; 700 700 701 - err = nla_parse_nested(tb, TCA_FQ_MAX, opt, fq_policy); 701 + err = nla_parse_nested(tb, TCA_FQ_MAX, opt, fq_policy, NULL); 702 702 if (err < 0) 703 703 return err; 704 704
+2 -1
net/sched/sch_fq_codel.c
··· 383 383 if (!opt) 384 384 return -EINVAL; 385 385 386 - err = nla_parse_nested(tb, TCA_FQ_CODEL_MAX, opt, fq_codel_policy); 386 + err = nla_parse_nested(tb, TCA_FQ_CODEL_MAX, opt, fq_codel_policy, 387 + NULL); 387 388 if (err < 0) 388 389 return err; 389 390 if (tb[TCA_FQ_CODEL_FLOWS]) {
+2 -2
net/sched/sch_gred.c
··· 401 401 if (opt == NULL) 402 402 return -EINVAL; 403 403 404 - err = nla_parse_nested(tb, TCA_GRED_MAX, opt, gred_policy); 404 + err = nla_parse_nested(tb, TCA_GRED_MAX, opt, gred_policy, NULL); 405 405 if (err < 0) 406 406 return err; 407 407 ··· 470 470 if (opt == NULL) 471 471 return -EINVAL; 472 472 473 - err = nla_parse_nested(tb, TCA_GRED_MAX, opt, gred_policy); 473 + err = nla_parse_nested(tb, TCA_GRED_MAX, opt, gred_policy, NULL); 474 474 if (err < 0) 475 475 return err; 476 476
+1 -1
net/sched/sch_hfsc.c
··· 957 957 if (opt == NULL) 958 958 return -EINVAL; 959 959 960 - err = nla_parse_nested(tb, TCA_HFSC_MAX, opt, hfsc_policy); 960 + err = nla_parse_nested(tb, TCA_HFSC_MAX, opt, hfsc_policy, NULL); 961 961 if (err < 0) 962 962 return err; 963 963
+1 -1
net/sched/sch_hhf.c
··· 529 529 if (!opt) 530 530 return -EINVAL; 531 531 532 - err = nla_parse_nested(tb, TCA_HHF_MAX, opt, hhf_policy); 532 + err = nla_parse_nested(tb, TCA_HHF_MAX, opt, hhf_policy, NULL); 533 533 if (err < 0) 534 534 return err; 535 535
+2 -2
net/sched/sch_htb.c
··· 1017 1017 if (!opt) 1018 1018 return -EINVAL; 1019 1019 1020 - err = nla_parse_nested(tb, TCA_HTB_MAX, opt, htb_policy); 1020 + err = nla_parse_nested(tb, TCA_HTB_MAX, opt, htb_policy, NULL); 1021 1021 if (err < 0) 1022 1022 return err; 1023 1023 ··· 1342 1342 if (!opt) 1343 1343 goto failure; 1344 1344 1345 - err = nla_parse_nested(tb, TCA_HTB_MAX, opt, htb_policy); 1345 + err = nla_parse_nested(tb, TCA_HTB_MAX, opt, htb_policy, NULL); 1346 1346 if (err < 0) 1347 1347 goto failure; 1348 1348
+1 -1
net/sched/sch_netem.c
··· 843 843 844 844 if (nested_len >= nla_attr_size(0)) 845 845 return nla_parse(tb, maxtype, nla_data(nla) + NLA_ALIGN(len), 846 - nested_len, policy); 846 + nested_len, policy, NULL); 847 847 848 848 memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1)); 849 849 return 0;
+1 -1
net/sched/sch_pie.c
··· 190 190 if (!opt) 191 191 return -EINVAL; 192 192 193 - err = nla_parse_nested(tb, TCA_PIE_MAX, opt, pie_policy); 193 + err = nla_parse_nested(tb, TCA_PIE_MAX, opt, pie_policy, NULL); 194 194 if (err < 0) 195 195 return err; 196 196
+2 -1
net/sched/sch_qfq.c
··· 418 418 return -EINVAL; 419 419 } 420 420 421 - err = nla_parse_nested(tb, TCA_QFQ_MAX, tca[TCA_OPTIONS], qfq_policy); 421 + err = nla_parse_nested(tb, TCA_QFQ_MAX, tca[TCA_OPTIONS], qfq_policy, 422 + NULL); 422 423 if (err < 0) 423 424 return err; 424 425
+1 -1
net/sched/sch_red.c
··· 173 173 if (opt == NULL) 174 174 return -EINVAL; 175 175 176 - err = nla_parse_nested(tb, TCA_RED_MAX, opt, red_policy); 176 + err = nla_parse_nested(tb, TCA_RED_MAX, opt, red_policy, NULL); 177 177 if (err < 0) 178 178 return err; 179 179
+1 -1
net/sched/sch_sfb.c
··· 495 495 int err; 496 496 497 497 if (opt) { 498 - err = nla_parse_nested(tb, TCA_SFB_MAX, opt, sfb_policy); 498 + err = nla_parse_nested(tb, TCA_SFB_MAX, opt, sfb_policy, NULL); 499 499 if (err < 0) 500 500 return -EINVAL; 501 501
+1 -1
net/sched/sch_tbf.c
··· 315 315 s64 buffer, mtu; 316 316 u64 rate64 = 0, prate64 = 0; 317 317 318 - err = nla_parse_nested(tb, TCA_TBF_MAX, opt, tbf_policy); 318 + err = nla_parse_nested(tb, TCA_TBF_MAX, opt, tbf_policy, NULL); 319 319 if (err < 0) 320 320 return err; 321 321
+1 -1
net/switchdev/switchdev.c
··· 826 826 int err; 827 827 828 828 err = nla_validate_nested(protinfo, IFLA_BRPORT_MAX, 829 - switchdev_port_bridge_policy); 829 + switchdev_port_bridge_policy, NULL); 830 830 if (err) 831 831 return err; 832 832
+7 -7
net/tipc/bearer.c
··· 802 802 803 803 err = nla_parse_nested(attrs, TIPC_NLA_BEARER_MAX, 804 804 info->attrs[TIPC_NLA_BEARER], 805 - tipc_nl_bearer_policy); 805 + tipc_nl_bearer_policy, NULL); 806 806 if (err) 807 807 return err; 808 808 ··· 851 851 852 852 err = nla_parse_nested(attrs, TIPC_NLA_BEARER_MAX, 853 853 info->attrs[TIPC_NLA_BEARER], 854 - tipc_nl_bearer_policy); 854 + tipc_nl_bearer_policy, NULL); 855 855 if (err) 856 856 return err; 857 857 ··· 891 891 892 892 err = nla_parse_nested(attrs, TIPC_NLA_BEARER_MAX, 893 893 info->attrs[TIPC_NLA_BEARER], 894 - tipc_nl_bearer_policy); 894 + tipc_nl_bearer_policy, NULL); 895 895 if (err) 896 896 return err; 897 897 ··· 939 939 940 940 err = nla_parse_nested(attrs, TIPC_NLA_BEARER_MAX, 941 941 info->attrs[TIPC_NLA_BEARER], 942 - tipc_nl_bearer_policy); 942 + tipc_nl_bearer_policy, NULL); 943 943 if (err) 944 944 return err; 945 945 ··· 982 982 983 983 err = nla_parse_nested(attrs, TIPC_NLA_BEARER_MAX, 984 984 info->attrs[TIPC_NLA_BEARER], 985 - tipc_nl_bearer_policy); 985 + tipc_nl_bearer_policy, NULL); 986 986 if (err) 987 987 return err; 988 988 ··· 1104 1104 1105 1105 err = nla_parse_nested(attrs, TIPC_NLA_MEDIA_MAX, 1106 1106 info->attrs[TIPC_NLA_MEDIA], 1107 - tipc_nl_media_policy); 1107 + tipc_nl_media_policy, NULL); 1108 1108 if (err) 1109 1109 return err; 1110 1110 ··· 1152 1152 1153 1153 err = nla_parse_nested(attrs, TIPC_NLA_MEDIA_MAX, 1154 1154 info->attrs[TIPC_NLA_MEDIA], 1155 - tipc_nl_media_policy); 1155 + tipc_nl_media_policy, NULL); 1156 1156 1157 1157 if (!attrs[TIPC_NLA_MEDIA_NAME]) 1158 1158 return -EINVAL;
+1 -1
net/tipc/link.c
··· 1827 1827 int err; 1828 1828 1829 1829 err = nla_parse_nested(props, TIPC_NLA_PROP_MAX, prop, 1830 - tipc_nl_prop_policy); 1830 + tipc_nl_prop_policy, NULL); 1831 1831 if (err) 1832 1832 return err; 1833 1833
+2 -2
net/tipc/net.c
··· 211 211 return -EINVAL; 212 212 213 213 err = nla_parse_nested(attrs, TIPC_NLA_NET_MAX, 214 - info->attrs[TIPC_NLA_NET], 215 - tipc_nl_net_policy); 214 + info->attrs[TIPC_NLA_NET], tipc_nl_net_policy, 215 + NULL); 216 216 if (err) 217 217 return err; 218 218
+2 -1
net/tipc/netlink.c
··· 268 268 if (!*attr) 269 269 return -EOPNOTSUPP; 270 270 271 - return nlmsg_parse(nlh, GENL_HDRLEN, *attr, maxattr, tipc_nl_policy); 271 + return nlmsg_parse(nlh, GENL_HDRLEN, *attr, maxattr, tipc_nl_policy, 272 + NULL); 272 273 } 273 274 274 275 int __init tipc_netlink_start(void)
+6 -6
net/tipc/node.c
··· 1607 1607 return -EINVAL; 1608 1608 1609 1609 err = nla_parse_nested(attrs, TIPC_NLA_NET_MAX, 1610 - info->attrs[TIPC_NLA_NET], 1611 - tipc_nl_net_policy); 1610 + info->attrs[TIPC_NLA_NET], tipc_nl_net_policy, 1611 + NULL); 1612 1612 if (err) 1613 1613 return err; 1614 1614 ··· 1774 1774 1775 1775 err = nla_parse_nested(attrs, TIPC_NLA_LINK_MAX, 1776 1776 info->attrs[TIPC_NLA_LINK], 1777 - tipc_nl_link_policy); 1777 + tipc_nl_link_policy, NULL); 1778 1778 if (err) 1779 1779 return err; 1780 1780 ··· 1902 1902 1903 1903 err = nla_parse_nested(attrs, TIPC_NLA_LINK_MAX, 1904 1904 info->attrs[TIPC_NLA_LINK], 1905 - tipc_nl_link_policy); 1905 + tipc_nl_link_policy, NULL); 1906 1906 if (err) 1907 1907 return err; 1908 1908 ··· 2042 2042 2043 2043 err = nla_parse_nested(attrs, TIPC_NLA_MON_MAX, 2044 2044 info->attrs[TIPC_NLA_MON], 2045 - tipc_nl_monitor_policy); 2045 + tipc_nl_monitor_policy, NULL); 2046 2046 if (err) 2047 2047 return err; 2048 2048 ··· 2163 2163 2164 2164 err = nla_parse_nested(mon, TIPC_NLA_MON_MAX, 2165 2165 attrs[TIPC_NLA_MON], 2166 - tipc_nl_monitor_policy); 2166 + tipc_nl_monitor_policy, NULL); 2167 2167 if (err) 2168 2168 return err; 2169 2169
+1 -1
net/tipc/socket.c
··· 2866 2866 2867 2867 err = nla_parse_nested(sock, TIPC_NLA_SOCK_MAX, 2868 2868 attrs[TIPC_NLA_SOCK], 2869 - tipc_nl_sock_policy); 2869 + tipc_nl_sock_policy, NULL); 2870 2870 if (err) 2871 2871 return err; 2872 2872
+4 -3
net/tipc/udp_media.c
··· 457 457 458 458 err = nla_parse_nested(battrs, TIPC_NLA_BEARER_MAX, 459 459 attrs[TIPC_NLA_BEARER], 460 - tipc_nl_bearer_policy); 460 + tipc_nl_bearer_policy, NULL); 461 461 if (err) 462 462 return err; 463 463 ··· 609 609 struct nlattr *opts[TIPC_NLA_UDP_MAX + 1]; 610 610 struct udp_media_addr *dst; 611 611 612 - if (nla_parse_nested(opts, TIPC_NLA_UDP_MAX, attr, tipc_nl_udp_policy)) 612 + if (nla_parse_nested(opts, TIPC_NLA_UDP_MAX, attr, 613 + tipc_nl_udp_policy, NULL)) 613 614 return -EINVAL; 614 615 615 616 if (!opts[TIPC_NLA_UDP_REMOTE]) ··· 663 662 664 663 if (nla_parse_nested(opts, TIPC_NLA_UDP_MAX, 665 664 attrs[TIPC_NLA_BEARER_UDP_OPTS], 666 - tipc_nl_udp_policy)) 665 + tipc_nl_udp_policy, NULL)) 667 666 goto err; 668 667 669 668 if (!opts[TIPC_NLA_UDP_LOCAL] || !opts[TIPC_NLA_UDP_REMOTE]) {
+41 -37
net/wireless/nl80211.c
··· 548 548 if (!cb->args[0]) { 549 549 err = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl80211_fam.hdrsize, 550 550 genl_family_attrbuf(&nl80211_fam), 551 - nl80211_fam.maxattr, nl80211_policy); 551 + nl80211_fam.maxattr, nl80211_policy, NULL); 552 552 if (err) 553 553 return err; 554 554 ··· 719 719 { 720 720 struct nlattr *tb[NL80211_KEY_MAX + 1]; 721 721 int err = nla_parse_nested(tb, NL80211_KEY_MAX, key, 722 - nl80211_key_policy); 722 + nl80211_key_policy, NULL); 723 723 if (err) 724 724 return err; 725 725 ··· 760 760 761 761 err = nla_parse_nested(kdt, NUM_NL80211_KEY_DEFAULT_TYPES - 1, 762 762 tb[NL80211_KEY_DEFAULT_TYPES], 763 - nl80211_key_default_policy); 763 + nl80211_key_default_policy, NULL); 764 764 if (err) 765 765 return err; 766 766 ··· 807 807 808 808 if (info->attrs[NL80211_ATTR_KEY_DEFAULT_TYPES]) { 809 809 struct nlattr *kdt[NUM_NL80211_KEY_DEFAULT_TYPES]; 810 - int err = nla_parse_nested( 811 - kdt, NUM_NL80211_KEY_DEFAULT_TYPES - 1, 812 - info->attrs[NL80211_ATTR_KEY_DEFAULT_TYPES], 813 - nl80211_key_default_policy); 810 + int err = nla_parse_nested(kdt, 811 + NUM_NL80211_KEY_DEFAULT_TYPES - 1, 812 + info->attrs[NL80211_ATTR_KEY_DEFAULT_TYPES], 813 + nl80211_key_default_policy, NULL); 814 814 if (err) 815 815 return err; 816 816 ··· 1892 1892 struct nl80211_dump_wiphy_state *state) 1893 1893 { 1894 1894 struct nlattr **tb = genl_family_attrbuf(&nl80211_fam); 1895 - int ret = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl80211_fam.hdrsize, 1896 - tb, nl80211_fam.maxattr, nl80211_policy); 1895 + int ret = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl80211_fam.hdrsize, tb, 1896 + nl80211_fam.maxattr, nl80211_policy, NULL); 1897 1897 /* ignore parse errors for backward compatibility */ 1898 1898 if (ret) 1899 1899 return 0; ··· 2308 2308 rem_txq_params) { 2309 2309 result = nla_parse_nested(tb, NL80211_TXQ_ATTR_MAX, 2310 2310 nl_txq_params, 2311 - txq_params_policy); 2311 + txq_params_policy, NULL); 2312 2312 if (result) 2313 2313 return result; 2314 2314 result = parse_txq_params(tb, &txq_params); ··· 2695 2695 if (!nla) 2696 2696 return -EINVAL; 2697 2697 2698 - if (nla_parse_nested(flags, NL80211_MNTR_FLAG_MAX, 2699 - nla, mntr_flags_policy)) 2698 + if (nla_parse_nested(flags, NL80211_MNTR_FLAG_MAX, nla, 2699 + mntr_flags_policy, NULL)) 2700 2700 return -EINVAL; 2701 2701 2702 2702 for (flag = 1; flag <= NL80211_MNTR_FLAG_MAX; flag++) ··· 3561 3561 if (sband == NULL) 3562 3562 return -EINVAL; 3563 3563 err = nla_parse_nested(tb, NL80211_TXRATE_MAX, tx_rates, 3564 - nl80211_txattr_policy); 3564 + nl80211_txattr_policy, NULL); 3565 3565 if (err) 3566 3566 return err; 3567 3567 if (tb[NL80211_TXRATE_LEGACY]) { ··· 4100 4100 if (!nla) 4101 4101 return 0; 4102 4102 4103 - if (nla_parse_nested(flags, NL80211_STA_FLAG_MAX, 4104 - nla, sta_flags_policy)) 4103 + if (nla_parse_nested(flags, NL80211_STA_FLAG_MAX, nla, 4104 + sta_flags_policy, NULL)) 4105 4105 return -EINVAL; 4106 4106 4107 4107 /* ··· 4728 4728 4729 4729 nla = info->attrs[NL80211_ATTR_STA_WME]; 4730 4730 err = nla_parse_nested(tb, NL80211_STA_WME_MAX, nla, 4731 - nl80211_sta_wme_policy); 4731 + nl80211_sta_wme_policy, NULL); 4732 4732 if (err) 4733 4733 return err; 4734 4734 ··· 5853 5853 return -EINVAL; 5854 5854 if (nla_parse_nested(tb, NL80211_MESHCONF_ATTR_MAX, 5855 5855 info->attrs[NL80211_ATTR_MESH_CONFIG], 5856 - nl80211_meshconf_params_policy)) 5856 + nl80211_meshconf_params_policy, NULL)) 5857 5857 return -EINVAL; 5858 5858 5859 5859 /* This makes sure that there aren't more than 32 mesh config ··· 6002 6002 return -EINVAL; 6003 6003 if (nla_parse_nested(tb, NL80211_MESH_SETUP_ATTR_MAX, 6004 6004 info->attrs[NL80211_ATTR_MESH_SETUP], 6005 - nl80211_mesh_setup_params_policy)) 6005 + nl80211_mesh_setup_params_policy, NULL)) 6006 6006 return -EINVAL; 6007 6007 6008 6008 if (tb[NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC]) ··· 6393 6393 nla_for_each_nested(nl_reg_rule, info->attrs[NL80211_ATTR_REG_RULES], 6394 6394 rem_reg_rules) { 6395 6395 r = nla_parse_nested(tb, NL80211_REG_RULE_ATTR_MAX, 6396 - nl_reg_rule, reg_rule_policy); 6396 + nl_reg_rule, reg_rule_policy, NULL); 6397 6397 if (r) 6398 6398 goto bad_reg; 6399 6399 r = parse_reg_rule(tb, &rd->reg_rules[rule_idx]); ··· 6461 6461 return -EINVAL; 6462 6462 6463 6463 err = nla_parse_nested(attr, NL80211_BSS_SELECT_ATTR_MAX, nest, 6464 - nl80211_bss_select_policy); 6464 + nl80211_bss_select_policy, NULL); 6465 6465 if (err) 6466 6466 return err; 6467 6467 ··· 6862 6862 return -EINVAL; 6863 6863 6864 6864 err = nla_parse_nested(plan, NL80211_SCHED_SCAN_PLAN_MAX, 6865 - attr, nl80211_plan_policy); 6865 + attr, nl80211_plan_policy, NULL); 6866 6866 if (err) 6867 6867 return err; 6868 6868 ··· 6953 6953 6954 6954 err = nla_parse_nested(tb, 6955 6955 NL80211_SCHED_SCAN_MATCH_ATTR_MAX, 6956 - attr, nl80211_match_policy); 6956 + attr, nl80211_match_policy, 6957 + NULL); 6957 6958 if (err) 6958 6959 return ERR_PTR(err); 6959 6960 /* add other standalone attributes here */ ··· 7133 7132 7134 7133 err = nla_parse_nested(tb, 7135 7134 NL80211_SCHED_SCAN_MATCH_ATTR_MAX, 7136 - attr, nl80211_match_policy); 7135 + attr, nl80211_match_policy, 7136 + NULL); 7137 7137 if (err) 7138 7138 goto out_free; 7139 7139 ssid = tb[NL80211_SCHED_SCAN_MATCH_ATTR_SSID]; ··· 7435 7433 7436 7434 err = nla_parse_nested(csa_attrs, NL80211_ATTR_MAX, 7437 7435 info->attrs[NL80211_ATTR_CSA_IES], 7438 - nl80211_policy); 7436 + nl80211_policy, NULL); 7439 7437 if (err) 7440 7438 return err; 7441 7439 ··· 8641 8639 struct nlattr **attrbuf = genl_family_attrbuf(&nl80211_fam); 8642 8640 8643 8641 err = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl80211_fam.hdrsize, 8644 - attrbuf, nl80211_fam.maxattr, nl80211_policy); 8642 + attrbuf, nl80211_fam.maxattr, 8643 + nl80211_policy, NULL); 8645 8644 if (err) 8646 8645 goto out_err; 8647 8646 ··· 9533 9530 return -EINVAL; 9534 9531 9535 9532 err = nla_parse_nested(attrs, NL80211_ATTR_CQM_MAX, cqm, 9536 - nl80211_attr_cqm_policy); 9533 + nl80211_attr_cqm_policy, NULL); 9537 9534 if (err) 9538 9535 return err; 9539 9536 ··· 9943 9940 return -EINVAL; 9944 9941 9945 9942 err = nla_parse_nested(tb, MAX_NL80211_WOWLAN_TCP, attr, 9946 - nl80211_wowlan_tcp_policy); 9943 + nl80211_wowlan_tcp_policy, NULL); 9947 9944 if (err) 9948 9945 return err; 9949 9946 ··· 10088 10085 goto out; 10089 10086 } 10090 10087 10091 - err = nla_parse_nested(tb, NL80211_ATTR_MAX, attr, nl80211_policy); 10088 + err = nla_parse_nested(tb, NL80211_ATTR_MAX, attr, nl80211_policy, 10089 + NULL); 10092 10090 if (err) 10093 10091 goto out; 10094 10092 ··· 10126 10122 10127 10123 err = nla_parse_nested(tb, MAX_NL80211_WOWLAN_TRIG, 10128 10124 info->attrs[NL80211_ATTR_WOWLAN_TRIGGERS], 10129 - nl80211_wowlan_policy); 10125 + nl80211_wowlan_policy, NULL); 10130 10126 if (err) 10131 10127 return err; 10132 10128 ··· 10209 10205 u8 *mask_pat; 10210 10206 10211 10207 nla_parse_nested(pat_tb, MAX_NL80211_PKTPAT, pat, 10212 - NULL); 10208 + NULL, NULL); 10213 10209 err = -EINVAL; 10214 10210 if (!pat_tb[NL80211_PKTPAT_MASK] || 10215 10211 !pat_tb[NL80211_PKTPAT_PATTERN]) ··· 10420 10416 struct nlattr *pat_tb[NUM_NL80211_PKTPAT]; 10421 10417 10422 10418 err = nla_parse_nested(tb, NL80211_ATTR_COALESCE_RULE_MAX, rule, 10423 - nl80211_coalesce_policy); 10419 + nl80211_coalesce_policy, NULL); 10424 10420 if (err) 10425 10421 return err; 10426 10422 ··· 10458 10454 rem) { 10459 10455 u8 *mask_pat; 10460 10456 10461 - nla_parse_nested(pat_tb, MAX_NL80211_PKTPAT, pat, NULL); 10457 + nla_parse_nested(pat_tb, MAX_NL80211_PKTPAT, pat, NULL, NULL); 10462 10458 if (!pat_tb[NL80211_PKTPAT_MASK] || 10463 10459 !pat_tb[NL80211_PKTPAT_PATTERN]) 10464 10460 return -EINVAL; ··· 10579 10575 10580 10576 err = nla_parse_nested(tb, MAX_NL80211_REKEY_DATA, 10581 10577 info->attrs[NL80211_ATTR_REKEY_DATA], 10582 - nl80211_rekey_policy); 10578 + nl80211_rekey_policy, NULL); 10583 10579 if (err) 10584 10580 return err; 10585 10581 ··· 10896 10892 10897 10893 err = nla_parse_nested(tb, NL80211_NAN_FUNC_ATTR_MAX, 10898 10894 info->attrs[NL80211_ATTR_NAN_FUNC], 10899 - nl80211_nan_func_policy); 10895 + nl80211_nan_func_policy, NULL); 10900 10896 if (err) 10901 10897 return err; 10902 10898 ··· 10993 10989 10994 10990 err = nla_parse_nested(srf_tb, NL80211_NAN_SRF_ATTR_MAX, 10995 10991 tb[NL80211_NAN_FUNC_SRF], 10996 - nl80211_nan_srf_policy); 10992 + nl80211_nan_srf_policy, NULL); 10997 10993 if (err) 10998 10994 goto out; 10999 10995 ··· 11528 11524 return 0; 11529 11525 } 11530 11526 11531 - err = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl80211_fam.hdrsize, 11532 - attrbuf, nl80211_fam.maxattr, nl80211_policy); 11527 + err = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl80211_fam.hdrsize, attrbuf, 11528 + nl80211_fam.maxattr, nl80211_policy, NULL); 11533 11529 if (err) 11534 11530 return err; 11535 11531
+3 -3
net/xfrm/xfrm_user.c
··· 932 932 u8 proto = 0; 933 933 int err; 934 934 935 - err = nlmsg_parse(cb->nlh, 0, attrs, XFRMA_MAX, 936 - xfrma_policy); 935 + err = nlmsg_parse(cb->nlh, 0, attrs, XFRMA_MAX, xfrma_policy, 936 + NULL); 937 937 if (err < 0) 938 938 return err; 939 939 ··· 2489 2489 2490 2490 err = nlmsg_parse(nlh, xfrm_msg_min[type], attrs, 2491 2491 link->nla_max ? : XFRMA_MAX, 2492 - link->nla_pol ? : xfrma_policy); 2492 + link->nla_pol ? : xfrma_policy, NULL); 2493 2493 if (err < 0) 2494 2494 return err; 2495 2495