.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * net/sched/ematch.c Extended Match API |
---|
3 | | - * |
---|
4 | | - * This program is free software; you can redistribute it and/or |
---|
5 | | - * modify it under the terms of the GNU General Public License |
---|
6 | | - * as published by the Free Software Foundation; either version |
---|
7 | | - * 2 of the License, or (at your option) any later version. |
---|
8 | 4 | * |
---|
9 | 5 | * Authors: Thomas Graf <tgraf@suug.ch> |
---|
10 | 6 | * |
---|
.. | .. |
---|
259 | 255 | * the value carried. |
---|
260 | 256 | */ |
---|
261 | 257 | if (em_hdr->flags & TCF_EM_SIMPLE) { |
---|
| 258 | + if (em->ops->datalen > 0) |
---|
| 259 | + goto errout; |
---|
262 | 260 | if (data_len < sizeof(u32)) |
---|
263 | 261 | goto errout; |
---|
264 | 262 | em->data = *(u32 *) data; |
---|
.. | .. |
---|
317 | 315 | if (!nla) |
---|
318 | 316 | return 0; |
---|
319 | 317 | |
---|
320 | | - err = nla_parse_nested(tb, TCA_EMATCH_TREE_MAX, nla, em_policy, NULL); |
---|
| 318 | + err = nla_parse_nested_deprecated(tb, TCA_EMATCH_TREE_MAX, nla, |
---|
| 319 | + em_policy, NULL); |
---|
321 | 320 | if (err < 0) |
---|
322 | 321 | goto errout; |
---|
323 | 322 | |
---|
.. | .. |
---|
392 | 391 | /** |
---|
393 | 392 | * tcf_em_tree_destroy - destroy an ematch tree |
---|
394 | 393 | * |
---|
395 | | - * @tp: classifier kind handle |
---|
396 | 394 | * @tree: ematch tree to be deleted |
---|
397 | 395 | * |
---|
398 | 396 | * This functions destroys an ematch tree previously created by |
---|
.. | .. |
---|
428 | 426 | * tcf_em_tree_dump - dump ematch tree into a rtnl message |
---|
429 | 427 | * |
---|
430 | 428 | * @skb: skb holding the rtnl message |
---|
431 | | - * @t: ematch tree to be dumped |
---|
| 429 | + * @tree: ematch tree to be dumped |
---|
432 | 430 | * @tlv: TLV type to be used to encapsulate the tree |
---|
433 | 431 | * |
---|
434 | 432 | * This function dumps a ematch tree into a rtnl message. It is valid to |
---|
.. | .. |
---|
443 | 441 | struct nlattr *top_start; |
---|
444 | 442 | struct nlattr *list_start; |
---|
445 | 443 | |
---|
446 | | - top_start = nla_nest_start(skb, tlv); |
---|
| 444 | + top_start = nla_nest_start_noflag(skb, tlv); |
---|
447 | 445 | if (top_start == NULL) |
---|
448 | 446 | goto nla_put_failure; |
---|
449 | 447 | |
---|
450 | 448 | if (nla_put(skb, TCA_EMATCH_TREE_HDR, sizeof(tree->hdr), &tree->hdr)) |
---|
451 | 449 | goto nla_put_failure; |
---|
452 | 450 | |
---|
453 | | - list_start = nla_nest_start(skb, TCA_EMATCH_TREE_LIST); |
---|
| 451 | + list_start = nla_nest_start_noflag(skb, TCA_EMATCH_TREE_LIST); |
---|
454 | 452 | if (list_start == NULL) |
---|
455 | 453 | goto nla_put_failure; |
---|
456 | 454 | |
---|