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

pkt_sched: cls_rsvp.h was outdated

File cls_rsvp.h in /net/sched was outdated. I'm sending you patch for this
file.

[ tb[] array should be indexed by X not X-1 -DaveM ]

Signed-off-by: Igor Maravić <igorm@etf.rs>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Igor Maravić and committed by
David S. Miller
27e95a8c 150966ad

+13 -14
+13 -14
net/sched/cls_rsvp.h
··· 425 425 struct rsvp_filter *f, **fp; 426 426 struct rsvp_session *s, **sp; 427 427 struct tc_rsvp_pinfo *pinfo = NULL; 428 - struct nlattr *opt = tca[TCA_OPTIONS-1]; 428 + struct nlattr *opt = tca[TCA_OPTIONS]; 429 429 struct nlattr *tb[TCA_RSVP_MAX + 1]; 430 430 struct tcf_exts e; 431 431 unsigned int h1, h2; ··· 439 439 if (err < 0) 440 440 return err; 441 441 442 - err = tcf_exts_validate(tp, tb, tca[TCA_RATE-1], &e, &rsvp_ext_map); 442 + err = tcf_exts_validate(tp, tb, tca[TCA_RATE], &e, &rsvp_ext_map); 443 443 if (err < 0) 444 444 return err; 445 445 ··· 449 449 450 450 if (f->handle != handle && handle) 451 451 goto errout2; 452 - if (tb[TCA_RSVP_CLASSID-1]) { 453 - f->res.classid = nla_get_u32(tb[TCA_RSVP_CLASSID-1]); 452 + if (tb[TCA_RSVP_CLASSID]) { 453 + f->res.classid = nla_get_u32(tb[TCA_RSVP_CLASSID]); 454 454 tcf_bind_filter(tp, &f->res, base); 455 455 } 456 456 ··· 462 462 err = -EINVAL; 463 463 if (handle) 464 464 goto errout2; 465 - if (tb[TCA_RSVP_DST-1] == NULL) 465 + if (tb[TCA_RSVP_DST] == NULL) 466 466 goto errout2; 467 467 468 468 err = -ENOBUFS; ··· 471 471 goto errout2; 472 472 473 473 h2 = 16; 474 - if (tb[TCA_RSVP_SRC-1]) { 475 - memcpy(f->src, nla_data(tb[TCA_RSVP_SRC-1]), sizeof(f->src)); 474 + if (tb[TCA_RSVP_SRC]) { 475 + memcpy(f->src, nla_data(tb[TCA_RSVP_SRC]), sizeof(f->src)); 476 476 h2 = hash_src(f->src); 477 477 } 478 - if (tb[TCA_RSVP_PINFO-1]) { 479 - pinfo = nla_data(tb[TCA_RSVP_PINFO-1]); 478 + if (tb[TCA_RSVP_PINFO]) { 479 + pinfo = nla_data(tb[TCA_RSVP_PINFO]); 480 480 f->spi = pinfo->spi; 481 481 f->tunnelhdr = pinfo->tunnelhdr; 482 482 } 483 - if (tb[TCA_RSVP_CLASSID-1]) 484 - f->res.classid = nla_get_u32(tb[TCA_RSVP_CLASSID-1]); 483 + if (tb[TCA_RSVP_CLASSID]) 484 + f->res.classid = nla_get_u32(tb[TCA_RSVP_CLASSID]); 485 485 486 - dst = nla_data(tb[TCA_RSVP_DST-1]); 486 + dst = nla_data(tb[TCA_RSVP_DST]); 487 487 h1 = hash_dst(dst, pinfo ? pinfo->protocol : 0, pinfo ? pinfo->tunnelid : 0); 488 488 489 489 err = -ENOMEM; ··· 642 642 return -1; 643 643 } 644 644 645 - static struct tcf_proto_ops RSVP_OPS = { 646 - .next = NULL, 645 + static struct tcf_proto_ops RSVP_OPS __read_mostly = { 647 646 .kind = RSVP_ID, 648 647 .classify = rsvp_classify, 649 648 .init = rsvp_init,