Lines Matching defs:nlh

729 		 struct nlmsghdr *nlh, gfp_t flags)
734 if (nlh)
735 report = nlmsg_report(nlh);
1713 struct nlmsghdr *nlh;
1717 nlh = nlmsg_put(skb, pid, seq, type, sizeof(*ifm), flags);
1718 if (nlh == NULL)
1721 ifm = nlmsg_data(nlh);
1828 nlmsg_end(skb, nlh);
1834 nlmsg_cancel(skb, nlh);
2018 static int rtnl_valid_dump_ifinfo_req(const struct nlmsghdr *nlh,
2027 if (nlh->nlmsg_len < nlmsg_msg_size(sizeof(*ifm))) {
2032 ifm = nlmsg_data(nlh);
2043 return nlmsg_parse_deprecated_strict(nlh, sizeof(*ifm), tb,
2055 hdrlen = nlmsg_len(nlh) < sizeof(struct ifinfomsg) ?
2058 return nlmsg_parse_deprecated(nlh, hdrlen, tb, IFLA_MAX, ifla_policy,
2065 const struct nlmsghdr *nlh = cb->nlh;
2083 err = rtnl_valid_dump_ifinfo_req(nlh, cb->strict_check, tb, extack);
2137 nlh->nlmsg_seq, 0, flags,
2989 static int rtnl_setlink(struct sk_buff *skb, struct nlmsghdr *nlh,
2999 err = nlmsg_parse_deprecated(nlh, sizeof(*ifm), tb, IFLA_MAX,
3014 ifm = nlmsg_data(nlh);
3084 static int rtnl_dellink(struct sk_buff *skb, struct nlmsghdr *nlh,
3095 err = nlmsg_parse_deprecated(nlh, sizeof(*ifm), tb, IFLA_MAX,
3112 ifm = nlmsg_data(nlh);
3257 static int __rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh,
3281 err = nlmsg_parse_deprecated(nlh, sizeof(*ifm), tb, IFLA_MAX,
3295 ifm = nlmsg_data(nlh);
3380 if (nlh->nlmsg_flags & NLM_F_EXCL)
3382 if (nlh->nlmsg_flags & NLM_F_REPLACE)
3410 if (!(nlh->nlmsg_flags & NLM_F_CREATE)) {
3517 static int rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh,
3527 ret = __rtnl_newlink(skb, nlh, attr, extack);
3533 const struct nlmsghdr *nlh,
3540 if (nlh->nlmsg_len < nlmsg_msg_size(sizeof(*ifm))) {
3546 return nlmsg_parse_deprecated(nlh, sizeof(*ifm), tb, IFLA_MAX,
3549 ifm = nlmsg_data(nlh);
3556 err = nlmsg_parse_deprecated_strict(nlh, sizeof(*ifm), tb, IFLA_MAX,
3580 static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr *nlh,
3593 err = rtnl_valid_getlink_req(skb, nlh, tb, extack);
3612 ifm = nlmsg_data(nlh);
3632 nlh->nlmsg_seq, 0, 0, ext_filter_mask,
3689 static int rtnl_linkprop(int cmd, struct sk_buff *skb, struct nlmsghdr *nlh,
3700 err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy, extack);
3708 ifm = nlmsg_data(nlh);
3738 static int rtnl_newlinkprop(struct sk_buff *skb, struct nlmsghdr *nlh,
3741 return rtnl_linkprop(RTM_NEWLINKPROP, skb, nlh, extack);
3744 static int rtnl_dellinkprop(struct sk_buff *skb, struct nlmsghdr *nlh,
3747 return rtnl_linkprop(RTM_DELLINKPROP, skb, nlh, extack);
3750 static u32 rtnl_calcit(struct sk_buff *skb, struct nlmsghdr *nlh)
3760 hdrlen = nlmsg_len(nlh) < sizeof(struct ifinfomsg) ?
3763 if (nlmsg_parse_deprecated(nlh, hdrlen, tb, IFLA_MAX, ifla_policy, NULL) >= 0) {
3788 int type = cb->nlh->nlmsg_type - RTM_BASE;
3903 struct nlmsghdr *nlh;
3906 nlh = nlmsg_put(skb, pid, seq, type, sizeof(*ndm), nlflags);
3907 if (!nlh)
3910 ndm = nlmsg_data(nlh);
3925 nlmsg_end(skb, nlh);
3929 nlmsg_cancel(skb, nlh);
4024 static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh,
4035 err = nlmsg_parse_deprecated(nlh, sizeof(*ndm), tb, NDA_MAX, NULL,
4040 ndm = nlmsg_data(nlh);
4077 nlh->nlmsg_flags, extack);
4089 nlh->nlmsg_flags,
4093 nlh->nlmsg_flags);
4132 static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,
4146 err = nlmsg_parse_deprecated(nlh, sizeof(*ndm), tb, NDA_MAX, NULL,
4151 ndm = nlmsg_data(nlh);
4225 seq = cb->nlh->nlmsg_seq;
4276 static int valid_fdb_dump_strict(const struct nlmsghdr *nlh,
4284 if (nlh->nlmsg_len < nlmsg_msg_size(sizeof(*ndm))) {
4289 ndm = nlmsg_data(nlh);
4296 err = nlmsg_parse_deprecated_strict(nlh, sizeof(struct ndmsg), tb,
4330 static int valid_fdb_dump_legacy(const struct nlmsghdr *nlh,
4344 if (nlmsg_len(nlh) != sizeof(struct ndmsg) &&
4345 (nlmsg_len(nlh) != sizeof(struct ndmsg) +
4349 err = nlmsg_parse_deprecated(nlh, sizeof(struct ifinfomsg),
4359 ifm = nlmsg_data(nlh);
4381 err = valid_fdb_dump_strict(cb->nlh, &br_idx, &brport_idx,
4384 err = valid_fdb_dump_legacy(cb->nlh, &br_idx, &brport_idx,
4465 static int valid_fdb_get_strict(const struct nlmsghdr *nlh,
4473 if (nlh->nlmsg_len < nlmsg_msg_size(sizeof(*ndm))) {
4478 ndm = nlmsg_data(nlh);
4490 err = nlmsg_parse_deprecated_strict(nlh, sizeof(struct ndmsg), tb,
4528 static int rtnl_fdb_get(struct sk_buff *in_skb, struct nlmsghdr *nlh,
4543 err = valid_fdb_get_strict(nlh, tb, &ndm_flags, &br_idx,
4614 nlh->nlmsg_seq, extack);
4640 struct nlmsghdr *nlh;
4648 nlh = nlmsg_put(skb, pid, seq, RTM_NEWLINK, sizeof(*ifm), nlflags);
4649 if (nlh == NULL)
4652 ifm = nlmsg_data(nlh);
4727 nlmsg_end(skb, nlh);
4730 nlmsg_cancel(skb, nlh);
4735 static int valid_bridge_getlink_req(const struct nlmsghdr *nlh,
4745 if (nlh->nlmsg_len < nlmsg_msg_size(sizeof(*ifm))) {
4750 ifm = nlmsg_data(nlh);
4757 err = nlmsg_parse_deprecated_strict(nlh,
4762 err = nlmsg_parse_deprecated(nlh, sizeof(struct ifinfomsg),
4791 const struct nlmsghdr *nlh = cb->nlh;
4796 u32 seq = nlh->nlmsg_seq;
4800 err = valid_bridge_getlink_req(nlh, cb->strict_check, &filter_mask,
4900 static int rtnl_bridge_setlink(struct sk_buff *skb, struct nlmsghdr *nlh,
4910 if (nlmsg_len(nlh) < sizeof(*ifm))
4913 ifm = nlmsg_data(nlh);
4923 br_spec = nlmsg_find_attr(nlh, sizeof(struct ifinfomsg), IFLA_AF_SPEC);
4949 err = br_dev->netdev_ops->ndo_bridge_setlink(dev, nlh, flags,
4961 err = dev->netdev_ops->ndo_bridge_setlink(dev, nlh,
4980 static int rtnl_bridge_dellink(struct sk_buff *skb, struct nlmsghdr *nlh,
4991 if (nlmsg_len(nlh) < sizeof(*ifm))
4994 ifm = nlmsg_data(nlh);
5004 br_spec = nlmsg_find_attr(nlh, sizeof(struct ifinfomsg), IFLA_AF_SPEC);
5026 err = br_dev->netdev_ops->ndo_bridge_dellink(dev, nlh, flags);
5037 err = dev->netdev_ops->ndo_bridge_dellink(dev, nlh,
5153 struct nlmsghdr *nlh;
5160 nlh = nlmsg_put(skb, pid, seq, type, sizeof(*ifsm), flags);
5161 if (!nlh)
5164 ifsm = nlmsg_data(nlh);
5283 nlmsg_end(skb, nlh);
5290 nlmsg_cancel(skb, nlh);
5292 nlmsg_end(skb, nlh);
5361 static int rtnl_valid_stats_req(const struct nlmsghdr *nlh, bool strict_check,
5366 if (nlh->nlmsg_len < nlmsg_msg_size(sizeof(*ifsm))) {
5374 ifsm = nlmsg_data(nlh);
5383 if (nlmsg_attrlen(nlh, sizeof(*ifsm))) {
5395 static int rtnl_stats_get(struct sk_buff *skb, struct nlmsghdr *nlh,
5406 err = rtnl_valid_stats_req(nlh, netlink_strict_get_check(skb),
5411 ifsm = nlmsg_data(nlh);
5429 NETLINK_CB(skb).portid, nlh->nlmsg_seq, 0,
5461 err = rtnl_valid_stats_req(cb->nlh, cb->strict_check, true, extack);
5465 ifsm = nlmsg_data(cb->nlh);
5480 cb->nlh->nlmsg_seq, 0,
5508 static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
5521 type = nlh->nlmsg_type;
5528 if (nlmsg_len(nlh) < sizeof(struct rtgenmsg))
5531 family = ((struct rtgenmsg *)nlmsg_data(nlh))->rtgen_family;
5538 if (kind == 2 && nlh->nlmsg_flags&NLM_F_DUMP) {
5554 min_dump_alloc = rtnl_calcit(skb, nlh);
5570 err = netlink_dump_start(rtnl, skb, nlh, &c);
5598 err = doit(skb, nlh, extack);
5607 err = link->doit(skb, nlh, extack);