| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * net/sched/cls_rsvp.h Template file for RSVPv[46] classifiers. |
|---|
| 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: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> |
|---|
| 10 | 6 | */ |
|---|
| .. | .. |
|---|
| 312 | 308 | __rsvp_delete_filter(f); |
|---|
| 313 | 309 | } |
|---|
| 314 | 310 | |
|---|
| 315 | | -static void rsvp_destroy(struct tcf_proto *tp, struct netlink_ext_ack *extack) |
|---|
| 311 | +static void rsvp_destroy(struct tcf_proto *tp, bool rtnl_held, |
|---|
| 312 | + struct netlink_ext_ack *extack) |
|---|
| 316 | 313 | { |
|---|
| 317 | 314 | struct rsvp_head *data = rtnl_dereference(tp->root); |
|---|
| 318 | 315 | int h1, h2; |
|---|
| .. | .. |
|---|
| 341 | 338 | } |
|---|
| 342 | 339 | |
|---|
| 343 | 340 | static int rsvp_delete(struct tcf_proto *tp, void *arg, bool *last, |
|---|
| 344 | | - struct netlink_ext_ack *extack) |
|---|
| 341 | + bool rtnl_held, struct netlink_ext_ack *extack) |
|---|
| 345 | 342 | { |
|---|
| 346 | 343 | struct rsvp_head *head = rtnl_dereference(tp->root); |
|---|
| 347 | 344 | struct rsvp_filter *nfp, *f = arg; |
|---|
| .. | .. |
|---|
| 475 | 472 | struct tcf_proto *tp, unsigned long base, |
|---|
| 476 | 473 | u32 handle, |
|---|
| 477 | 474 | struct nlattr **tca, |
|---|
| 478 | | - void **arg, bool ovr, struct netlink_ext_ack *extack) |
|---|
| 475 | + void **arg, bool ovr, bool rtnl_held, |
|---|
| 476 | + struct netlink_ext_ack *extack) |
|---|
| 479 | 477 | { |
|---|
| 480 | 478 | struct rsvp_head *data = rtnl_dereference(tp->root); |
|---|
| 481 | 479 | struct rsvp_filter *f, *nfp; |
|---|
| .. | .. |
|---|
| 493 | 491 | if (opt == NULL) |
|---|
| 494 | 492 | return handle ? -EINVAL : 0; |
|---|
| 495 | 493 | |
|---|
| 496 | | - err = nla_parse_nested(tb, TCA_RSVP_MAX, opt, rsvp_policy, NULL); |
|---|
| 494 | + err = nla_parse_nested_deprecated(tb, TCA_RSVP_MAX, opt, rsvp_policy, |
|---|
| 495 | + NULL); |
|---|
| 497 | 496 | if (err < 0) |
|---|
| 498 | 497 | return err; |
|---|
| 499 | 498 | |
|---|
| 500 | | - err = tcf_exts_init(&e, TCA_RSVP_ACT, TCA_RSVP_POLICE); |
|---|
| 499 | + err = tcf_exts_init(&e, net, TCA_RSVP_ACT, TCA_RSVP_POLICE); |
|---|
| 501 | 500 | if (err < 0) |
|---|
| 502 | 501 | return err; |
|---|
| 503 | | - err = tcf_exts_validate(net, tp, tb, tca[TCA_RATE], &e, ovr, extack); |
|---|
| 502 | + err = tcf_exts_validate(net, tp, tb, tca[TCA_RATE], &e, ovr, true, |
|---|
| 503 | + extack); |
|---|
| 504 | 504 | if (err < 0) |
|---|
| 505 | 505 | goto errout2; |
|---|
| 506 | 506 | |
|---|
| .. | .. |
|---|
| 518 | 518 | goto errout2; |
|---|
| 519 | 519 | } |
|---|
| 520 | 520 | |
|---|
| 521 | | - err = tcf_exts_init(&n->exts, TCA_RSVP_ACT, TCA_RSVP_POLICE); |
|---|
| 521 | + err = tcf_exts_init(&n->exts, net, TCA_RSVP_ACT, |
|---|
| 522 | + TCA_RSVP_POLICE); |
|---|
| 522 | 523 | if (err < 0) { |
|---|
| 523 | 524 | kfree(n); |
|---|
| 524 | 525 | goto errout2; |
|---|
| .. | .. |
|---|
| 546 | 547 | if (f == NULL) |
|---|
| 547 | 548 | goto errout2; |
|---|
| 548 | 549 | |
|---|
| 549 | | - err = tcf_exts_init(&f->exts, TCA_RSVP_ACT, TCA_RSVP_POLICE); |
|---|
| 550 | + err = tcf_exts_init(&f->exts, net, TCA_RSVP_ACT, TCA_RSVP_POLICE); |
|---|
| 550 | 551 | if (err < 0) |
|---|
| 551 | 552 | goto errout; |
|---|
| 552 | 553 | h2 = 16; |
|---|
| .. | .. |
|---|
| 652 | 653 | return err; |
|---|
| 653 | 654 | } |
|---|
| 654 | 655 | |
|---|
| 655 | | -static void rsvp_walk(struct tcf_proto *tp, struct tcf_walker *arg) |
|---|
| 656 | +static void rsvp_walk(struct tcf_proto *tp, struct tcf_walker *arg, |
|---|
| 657 | + bool rtnl_held) |
|---|
| 656 | 658 | { |
|---|
| 657 | 659 | struct rsvp_head *head = rtnl_dereference(tp->root); |
|---|
| 658 | 660 | unsigned int h, h1; |
|---|
| .. | .. |
|---|
| 686 | 688 | } |
|---|
| 687 | 689 | |
|---|
| 688 | 690 | static int rsvp_dump(struct net *net, struct tcf_proto *tp, void *fh, |
|---|
| 689 | | - struct sk_buff *skb, struct tcmsg *t) |
|---|
| 691 | + struct sk_buff *skb, struct tcmsg *t, bool rtnl_held) |
|---|
| 690 | 692 | { |
|---|
| 691 | 693 | struct rsvp_filter *f = fh; |
|---|
| 692 | 694 | struct rsvp_session *s; |
|---|
| .. | .. |
|---|
| 699 | 701 | |
|---|
| 700 | 702 | t->tcm_handle = f->handle; |
|---|
| 701 | 703 | |
|---|
| 702 | | - nest = nla_nest_start(skb, TCA_OPTIONS); |
|---|
| 704 | + nest = nla_nest_start_noflag(skb, TCA_OPTIONS); |
|---|
| 703 | 705 | if (nest == NULL) |
|---|
| 704 | 706 | goto nla_put_failure; |
|---|
| 705 | 707 | |
|---|