Lines Matching defs:nlh

767 		 const struct nlmsghdr *nlh, gfp_t flags)
771 nlmsg_notify(rtnl, skb, pid, group, nlmsg_report(nlh), flags);
1785 struct nlmsghdr *nlh;
1789 nlh = nlmsg_put(skb, pid, seq, type, sizeof(*ifm), flags);
1790 if (nlh == NULL)
1793 ifm = nlmsg_data(nlh);
1919 nlmsg_end(skb, nlh);
1925 nlmsg_cancel(skb, nlh);
2124 static int rtnl_valid_dump_ifinfo_req(const struct nlmsghdr *nlh,
2133 if (nlh->nlmsg_len < nlmsg_msg_size(sizeof(*ifm))) {
2138 ifm = nlmsg_data(nlh);
2149 return nlmsg_parse_deprecated_strict(nlh, sizeof(*ifm), tb,
2161 hdrlen = nlmsg_len(nlh) < sizeof(struct ifinfomsg) ?
2164 return nlmsg_parse_deprecated(nlh, hdrlen, tb, IFLA_MAX, ifla_policy,
2171 const struct nlmsghdr *nlh = cb->nlh;
2189 err = rtnl_valid_dump_ifinfo_req(nlh, cb->strict_check, tb, extack);
2243 nlh->nlmsg_seq, 0, flags,
3140 static int rtnl_setlink(struct sk_buff *skb, struct nlmsghdr *nlh,
3149 err = nlmsg_parse_deprecated(nlh, sizeof(*ifm), tb, IFLA_MAX,
3159 ifm = nlmsg_data(nlh);
3217 int rtnl_delete_link(struct net_device *dev, u32 portid, const struct nlmsghdr *nlh)
3227 unregister_netdevice_many_notify(&list_kill, portid, nlh);
3233 static int rtnl_dellink(struct sk_buff *skb, struct nlmsghdr *nlh,
3245 err = nlmsg_parse_deprecated(nlh, sizeof(*ifm), tb, IFLA_MAX,
3262 ifm = nlmsg_data(nlh);
3279 err = rtnl_delete_link(dev, portid, nlh);
3289 u32 portid, const struct nlmsghdr *nlh)
3303 __dev_notify_flags(dev, old_flags, (old_flags ^ dev->flags), portid, nlh);
3306 __dev_notify_flags(dev, old_flags, ~0U, portid, nlh);
3433 const struct nlmsghdr *nlh,
3493 err = rtnl_configure_link(dev, ifm, portid, nlh);
3529 static int __rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh,
3550 err = nlmsg_parse_deprecated(nlh, sizeof(*ifm), tb, IFLA_MAX,
3559 ifm = nlmsg_data(nlh);
3640 if (nlh->nlmsg_flags & NLM_F_EXCL)
3642 if (nlh->nlmsg_flags & NLM_F_REPLACE)
3674 if (!(nlh->nlmsg_flags & NLM_F_CREATE)) {
3705 return rtnl_newlink_create(skb, ifm, ops, nlh, tb, data, extack);
3708 static int rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh,
3718 ret = __rtnl_newlink(skb, nlh, tbs, extack);
3724 const struct nlmsghdr *nlh,
3731 if (nlh->nlmsg_len < nlmsg_msg_size(sizeof(*ifm))) {
3737 return nlmsg_parse_deprecated(nlh, sizeof(*ifm), tb, IFLA_MAX,
3740 ifm = nlmsg_data(nlh);
3747 err = nlmsg_parse_deprecated_strict(nlh, sizeof(*ifm), tb, IFLA_MAX,
3771 static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr *nlh,
3784 err = rtnl_valid_getlink_req(skb, nlh, tb, extack);
3803 ifm = nlmsg_data(nlh);
3822 nlh->nlmsg_seq, 0, 0, ext_filter_mask,
3879 static int rtnl_linkprop(int cmd, struct sk_buff *skb, struct nlmsghdr *nlh,
3890 err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy, extack);
3898 ifm = nlmsg_data(nlh);
3927 static int rtnl_newlinkprop(struct sk_buff *skb, struct nlmsghdr *nlh,
3930 return rtnl_linkprop(RTM_NEWLINKPROP, skb, nlh, extack);
3933 static int rtnl_dellinkprop(struct sk_buff *skb, struct nlmsghdr *nlh,
3936 return rtnl_linkprop(RTM_DELLINKPROP, skb, nlh, extack);
3939 static u32 rtnl_calcit(struct sk_buff *skb, struct nlmsghdr *nlh)
3949 hdrlen = nlmsg_len(nlh) < sizeof(struct ifinfomsg) ?
3952 if (nlmsg_parse_deprecated(nlh, hdrlen, tb, IFLA_MAX, ifla_policy, NULL) >= 0) {
3977 int type = cb->nlh->nlmsg_type - RTM_BASE;
4024 const struct nlmsghdr *nlh)
4035 if (nlmsg_report(nlh))
4036 seq = nlmsg_seq(nlh);
4057 u32 portid, const struct nlmsghdr *nlh)
4061 rtnl_notify(skb, net, portid, RTNLGRP_LINK, nlh, flags);
4067 u32 portid, const struct nlmsghdr *nlh)
4075 new_ifindex, portid, nlh);
4077 rtmsg_ifinfo_send(skb, dev, flags, portid, nlh);
4081 gfp_t flags, u32 portid, const struct nlmsghdr *nlh)
4084 NULL, 0, portid, nlh);
4100 struct nlmsghdr *nlh;
4103 nlh = nlmsg_put(skb, pid, seq, type, sizeof(*ndm), nlflags);
4104 if (!nlh)
4107 ndm = nlmsg_data(nlh);
4122 nlmsg_end(skb, nlh);
4126 nlmsg_cancel(skb, nlh);
4226 static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh,
4237 err = nlmsg_parse_deprecated(nlh, sizeof(*ndm), tb, NDA_MAX, NULL,
4242 ndm = nlmsg_data(nlh);
4279 nlh->nlmsg_flags, extack);
4291 nlh->nlmsg_flags,
4295 nlh->nlmsg_flags);
4341 static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,
4344 bool del_bulk = !!(nlh->nlmsg_flags & NLM_F_BULK);
4358 err = nlmsg_parse_deprecated(nlh, sizeof(*ndm), tb, NDA_MAX,
4361 err = nlmsg_parse(nlh, sizeof(*ndm), tb, NDA_MAX,
4367 ndm = nlmsg_data(nlh);
4457 seq = cb->nlh->nlmsg_seq;
4508 static int valid_fdb_dump_strict(const struct nlmsghdr *nlh,
4516 if (nlh->nlmsg_len < nlmsg_msg_size(sizeof(*ndm))) {
4521 ndm = nlmsg_data(nlh);
4528 err = nlmsg_parse_deprecated_strict(nlh, sizeof(struct ndmsg), tb,
4562 static int valid_fdb_dump_legacy(const struct nlmsghdr *nlh,
4576 if (nlmsg_len(nlh) != sizeof(struct ndmsg) &&
4577 (nlmsg_len(nlh) != sizeof(struct ndmsg) +
4581 err = nlmsg_parse_deprecated(nlh, sizeof(struct ifinfomsg),
4591 ifm = nlmsg_data(nlh);
4613 err = valid_fdb_dump_strict(cb->nlh, &br_idx, &brport_idx,
4616 err = valid_fdb_dump_legacy(cb->nlh, &br_idx, &brport_idx,
4697 static int valid_fdb_get_strict(const struct nlmsghdr *nlh,
4705 if (nlh->nlmsg_len < nlmsg_msg_size(sizeof(*ndm))) {
4710 ndm = nlmsg_data(nlh);
4722 err = nlmsg_parse_deprecated_strict(nlh, sizeof(struct ndmsg), tb,
4760 static int rtnl_fdb_get(struct sk_buff *in_skb, struct nlmsghdr *nlh,
4775 err = valid_fdb_get_strict(nlh, tb, &ndm_flags, &br_idx,
4846 nlh->nlmsg_seq, extack);
4872 struct nlmsghdr *nlh;
4880 nlh = nlmsg_put(skb, pid, seq, RTM_NEWLINK, sizeof(*ifm), nlflags);
4881 if (nlh == NULL)
4884 ifm = nlmsg_data(nlh);
4959 nlmsg_end(skb, nlh);
4962 nlmsg_cancel(skb, nlh);
4967 static int valid_bridge_getlink_req(const struct nlmsghdr *nlh,
4977 if (nlh->nlmsg_len < nlmsg_msg_size(sizeof(*ifm))) {
4982 ifm = nlmsg_data(nlh);
4989 err = nlmsg_parse_deprecated_strict(nlh,
4994 err = nlmsg_parse_deprecated(nlh, sizeof(struct ifinfomsg),
5023 const struct nlmsghdr *nlh = cb->nlh;
5028 u32 seq = nlh->nlmsg_seq;
5032 err = valid_bridge_getlink_req(nlh, cb->strict_check, &filter_mask,
5132 static int rtnl_bridge_setlink(struct sk_buff *skb, struct nlmsghdr *nlh,
5142 if (nlmsg_len(nlh) < sizeof(*ifm))
5145 ifm = nlmsg_data(nlh);
5155 br_spec = nlmsg_find_attr(nlh, sizeof(struct ifinfomsg), IFLA_AF_SPEC);
5181 err = br_dev->netdev_ops->ndo_bridge_setlink(dev, nlh, flags,
5193 err = dev->netdev_ops->ndo_bridge_setlink(dev, nlh,
5212 static int rtnl_bridge_dellink(struct sk_buff *skb, struct nlmsghdr *nlh,
5223 if (nlmsg_len(nlh) < sizeof(*ifm))
5226 ifm = nlmsg_data(nlh);
5236 br_spec = nlmsg_find_attr(nlh, sizeof(struct ifinfomsg), IFLA_AF_SPEC);
5258 err = br_dev->netdev_ops->ndo_bridge_dellink(dev, nlh, flags);
5269 err = dev->netdev_ops->ndo_bridge_dellink(dev, nlh,
5570 struct nlmsghdr *nlh;
5577 nlh = nlmsg_put(skb, pid, seq, type, sizeof(*ifsm), flags);
5578 if (!nlh)
5581 ifsm = nlmsg_data(nlh);
5714 nlmsg_end(skb, nlh);
5721 nlmsg_cancel(skb, nlh);
5723 nlmsg_end(skb, nlh);
5842 static int rtnl_stats_get_parse(const struct nlmsghdr *nlh,
5855 err = nlmsg_parse(nlh, sizeof(struct if_stats_msg), tb,
5870 static int rtnl_valid_stats_req(const struct nlmsghdr *nlh, bool strict_check,
5875 if (nlh->nlmsg_len < nlmsg_msg_size(sizeof(*ifsm))) {
5883 ifsm = nlmsg_data(nlh);
5900 static int rtnl_stats_get(struct sk_buff *skb, struct nlmsghdr *nlh,
5911 err = rtnl_valid_stats_req(nlh, netlink_strict_get_check(skb),
5916 ifsm = nlmsg_data(nlh);
5930 err = rtnl_stats_get_parse(nlh, ifsm->filter_mask, &filters, extack);
5939 NETLINK_CB(skb).portid, nlh->nlmsg_seq, 0,
5971 err = rtnl_valid_stats_req(cb->nlh, cb->strict_check, true, extack);
5975 ifsm = nlmsg_data(cb->nlh);
5981 err = rtnl_stats_get_parse(cb->nlh, ifsm->filter_mask, &filters,
5994 cb->nlh->nlmsg_seq, 0,
6056 static int rtnl_stats_set(struct sk_buff *skb, struct nlmsghdr *nlh,
6068 err = rtnl_valid_stats_req(nlh, netlink_strict_get_check(skb),
6073 ifsm = nlmsg_data(nlh);
6092 err = nlmsg_parse(nlh, sizeof(*ifsm), tb, IFLA_STATS_GETSET_MAX,
6122 static int rtnl_mdb_valid_dump_req(const struct nlmsghdr *nlh,
6127 if (nlh->nlmsg_len < nlmsg_msg_size(sizeof(*bpm))) {
6132 bpm = nlmsg_data(nlh);
6137 if (nlmsg_attrlen(nlh, sizeof(*bpm))) {
6160 err = rtnl_mdb_valid_dump_req(cb->nlh, cb->extack);
6255 static int rtnl_mdb_add(struct sk_buff *skb, struct nlmsghdr *nlh,
6264 err = nlmsg_parse_deprecated(nlh, sizeof(*bpm), tb,
6269 bpm = nlmsg_data(nlh);
6291 return dev->netdev_ops->ndo_mdb_add(dev, tb, nlh->nlmsg_flags, extack);
6294 static int rtnl_mdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,
6303 err = nlmsg_parse_deprecated(nlh, sizeof(*bpm), tb,
6308 bpm = nlmsg_data(nlh);
6335 static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
6348 type = nlh->nlmsg_type;
6355 if (nlmsg_len(nlh) < sizeof(struct rtgenmsg))
6358 family = ((struct rtgenmsg *)nlmsg_data(nlh))->rtgen_family;
6365 if (kind == RTNL_KIND_GET && (nlh->nlmsg_flags & NLM_F_DUMP)) {
6381 min_dump_alloc = rtnl_calcit(skb, nlh);
6397 err = netlink_dump_start(rtnl, skb, nlh, &c);
6421 if (kind == RTNL_KIND_DEL && (nlh->nlmsg_flags & NLM_F_BULK) &&
6432 err = doit(skb, nlh, extack);
6441 err = link->doit(skb, nlh, extack);