@@ -296,7 +296,8 @@ ip_set_get_ipaddr4(struct nlattr *nla, __be32 *ipaddr)
296296
297297 if (unlikely (!flag_nested (nla )))
298298 return - IPSET_ERR_PROTOCOL ;
299- if (nla_parse_nested_deprecated (tb , IPSET_ATTR_IPADDR_MAX , nla , ipaddr_policy , NULL ))
299+ if (nla_parse_nested (tb , IPSET_ATTR_IPADDR_MAX , nla ,
300+ ipaddr_policy , NULL ))
300301 return - IPSET_ERR_PROTOCOL ;
301302 if (unlikely (!ip_set_attr_netorder (tb , IPSET_ATTR_IPADDR_IPV4 )))
302303 return - IPSET_ERR_PROTOCOL ;
@@ -314,7 +315,8 @@ ip_set_get_ipaddr6(struct nlattr *nla, union nf_inet_addr *ipaddr)
314315 if (unlikely (!flag_nested (nla )))
315316 return - IPSET_ERR_PROTOCOL ;
316317
317- if (nla_parse_nested_deprecated (tb , IPSET_ATTR_IPADDR_MAX , nla , ipaddr_policy , NULL ))
318+ if (nla_parse_nested (tb , IPSET_ATTR_IPADDR_MAX , nla ,
319+ ipaddr_policy , NULL ))
318320 return - IPSET_ERR_PROTOCOL ;
319321 if (unlikely (!ip_set_attr_netorder (tb , IPSET_ATTR_IPADDR_IPV6 )))
320322 return - IPSET_ERR_PROTOCOL ;
@@ -934,7 +936,8 @@ static int ip_set_create(struct net *net, struct sock *ctnl,
934936
935937 /* Without holding any locks, create private part. */
936938 if (attr [IPSET_ATTR_DATA ] &&
937- nla_parse_nested_deprecated (tb , IPSET_ATTR_CREATE_MAX , attr [IPSET_ATTR_DATA ], set -> type -> create_policy , NULL )) {
939+ nla_parse_nested (tb , IPSET_ATTR_CREATE_MAX , attr [IPSET_ATTR_DATA ],
940+ set -> type -> create_policy , NULL )) {
938941 ret = - IPSET_ERR_PROTOCOL ;
939942 goto put_out ;
940943 }
@@ -1281,6 +1284,14 @@ dump_attrs(struct nlmsghdr *nlh)
12811284 }
12821285}
12831286
1287+ static const struct nla_policy
1288+ ip_set_dump_policy [IPSET_ATTR_CMD_MAX + 1 ] = {
1289+ [IPSET_ATTR_PROTOCOL ] = { .type = NLA_U8 },
1290+ [IPSET_ATTR_SETNAME ] = { .type = NLA_NUL_STRING ,
1291+ .len = IPSET_MAXNAMELEN - 1 },
1292+ [IPSET_ATTR_FLAGS ] = { .type = NLA_U32 },
1293+ };
1294+
12841295static int
12851296dump_init (struct netlink_callback * cb , struct ip_set_net * inst )
12861297{
@@ -1292,9 +1303,9 @@ dump_init(struct netlink_callback *cb, struct ip_set_net *inst)
12921303 ip_set_id_t index ;
12931304 int ret ;
12941305
1295- ret = nla_parse_deprecated (cda , IPSET_ATTR_CMD_MAX , attr ,
1296- nlh -> nlmsg_len - min_len ,
1297- ip_set_setname_policy , NULL );
1306+ ret = nla_parse (cda , IPSET_ATTR_CMD_MAX , attr ,
1307+ nlh -> nlmsg_len - min_len ,
1308+ ip_set_dump_policy , NULL );
12981309 if (ret )
12991310 return ret ;
13001311
@@ -1543,9 +1554,9 @@ call_ad(struct sock *ctnl, struct sk_buff *skb, struct ip_set *set,
15431554 memcpy (& errmsg -> msg , nlh , nlh -> nlmsg_len );
15441555 cmdattr = (void * )& errmsg -> msg + min_len ;
15451556
1546- ret = nla_parse_deprecated (cda , IPSET_ATTR_CMD_MAX , cmdattr ,
1547- nlh -> nlmsg_len - min_len ,
1548- ip_set_adt_policy , NULL );
1557+ ret = nla_parse (cda , IPSET_ATTR_CMD_MAX , cmdattr ,
1558+ nlh -> nlmsg_len - min_len , ip_set_adt_policy ,
1559+ NULL );
15491560
15501561 if (ret ) {
15511562 nlmsg_free (skb2 );
@@ -1596,7 +1607,9 @@ static int ip_set_ad(struct net *net, struct sock *ctnl,
15961607
15971608 use_lineno = !!attr [IPSET_ATTR_LINENO ];
15981609 if (attr [IPSET_ATTR_DATA ]) {
1599- if (nla_parse_nested_deprecated (tb , IPSET_ATTR_ADT_MAX , attr [IPSET_ATTR_DATA ], set -> type -> adt_policy , NULL ))
1610+ if (nla_parse_nested (tb , IPSET_ATTR_ADT_MAX ,
1611+ attr [IPSET_ATTR_DATA ],
1612+ set -> type -> adt_policy , NULL ))
16001613 return - IPSET_ERR_PROTOCOL ;
16011614 ret = call_ad (ctnl , skb , set , tb , adt , flags ,
16021615 use_lineno );
@@ -1606,7 +1619,8 @@ static int ip_set_ad(struct net *net, struct sock *ctnl,
16061619 nla_for_each_nested (nla , attr [IPSET_ATTR_ADT ], nla_rem ) {
16071620 if (nla_type (nla ) != IPSET_ATTR_DATA ||
16081621 !flag_nested (nla ) ||
1609- nla_parse_nested_deprecated (tb , IPSET_ATTR_ADT_MAX , nla , set -> type -> adt_policy , NULL ))
1622+ nla_parse_nested (tb , IPSET_ATTR_ADT_MAX , nla ,
1623+ set -> type -> adt_policy , NULL ))
16101624 return - IPSET_ERR_PROTOCOL ;
16111625 ret = call_ad (ctnl , skb , set , tb , adt ,
16121626 flags , use_lineno );
@@ -1655,7 +1669,8 @@ static int ip_set_utest(struct net *net, struct sock *ctnl, struct sk_buff *skb,
16551669 if (!set )
16561670 return - ENOENT ;
16571671
1658- if (nla_parse_nested_deprecated (tb , IPSET_ATTR_ADT_MAX , attr [IPSET_ATTR_DATA ], set -> type -> adt_policy , NULL ))
1672+ if (nla_parse_nested (tb , IPSET_ATTR_ADT_MAX , attr [IPSET_ATTR_DATA ],
1673+ set -> type -> adt_policy , NULL ))
16591674 return - IPSET_ERR_PROTOCOL ;
16601675
16611676 rcu_read_lock_bh ();
@@ -1961,7 +1976,7 @@ static const struct nfnl_callback ip_set_netlink_subsys_cb[IPSET_MSG_MAX] = {
19611976 [IPSET_CMD_LIST ] = {
19621977 .call = ip_set_dump ,
19631978 .attr_count = IPSET_ATTR_CMD_MAX ,
1964- .policy = ip_set_setname_policy ,
1979+ .policy = ip_set_dump_policy ,
19651980 },
19661981 [IPSET_CMD_SAVE ] = {
19671982 .call = ip_set_dump ,
0 commit comments