make nla_nest_start() add NLA_F_NESTED flag
Subsystems (31)
cover make nla_nest_start() add NLA_F_NESTED flag
One of the comments in recent review of the ethtool netlink series pointed out that proposed ethnl_nest_start() helper which adds NLA_F_NESTED to second argument of nla_nest_start() is not really specific to ethtool netlink code. That is hard to argue with as closer inspection revealed that exactly the same helper already exists in ipset code (except it's a macro rather than an inline function).
Another observation was that even if NLA_F_NESTED flag was introduced in 2007, only few netlink based interfaces set it in kernel generated messages and even many recently added APIs omit it. That is unfortunate as without the flag, message parsers not familiar with attribute semantics cannot recognize nested attributes and do not see message structure; this affects e.g. wireshark dissector or mnl_nlmsg_fprintf() from libmnl.
This is why I'm suggesting to rename existing nla_nest_start() to different name (nla_nest_start_noflag) and reintroduce nla_nest_start() as a wrapper adding NLA_F_NESTED flag. This is implemented in first patch which is mostly generated by spatch. Second patch drops ipset helper macros which lose their purpose. Third patch cleans up minor coding style issues found by checkpatch.pl in first patch.
We could leave nla_nest_start() untouched and simply add a wrapper adding NLA_F_NESTED but that would probably preserve the state when even most new code doesn't set the flag.
Michal Kubecek (3):
netlink: make nla_nest_start() add NLA_F_NESTED flag
ipset: drop ipset_nest_start() and ipset_nest_end()
net: fix two coding style issues
drivers/block/drbd/drbd_nl.c | 8 +- drivers/block/nbd.c | 4 +- drivers/infiniband/core/nldev.c | 9 +- drivers/infiniband/hw/cxgb4/restrack.c | 8 +- drivers/net/bonding/bond_netlink.c | 8 +- drivers/net/ieee802154/mac802154_hwsim.c | 6 +- drivers/net/macsec.c | 27 +-- drivers/net/macvlan.c | 2 +- drivers/net/team/team.c | 8 +- drivers/net/wireless/ath/wil6210/cfg80211.c | 4 +- include/linux/netfilter/ipset/ip_set.h | 11 +- include/net/netlink.h | 26 ++- kernel/taskstats.c | 2 +- net/8021q/vlan_netlink.c | 4 +- net/bridge/br_mdb.c | 17 +- net/bridge/br_netlink.c | 8 +- net/bridge/br_netlink_tunnel.c | 2 +- net/core/devlink.c | 78 ++++---- net/core/lwt_bpf.c | 2 +- net/core/lwtunnel.c | 2 +- net/core/neighbour.c | 2 +- net/core/rtnetlink.c | 48 ++--- net/dcb/dcbnl.c | 40 ++-- net/decnet/dn_table.c | 3 +- net/ieee802154/nl802154.c | 34 ++-- net/ipv4/fib_semantics.c | 2 +- net/ipv4/ipmr.c | 6 +- net/ipv4/ipmr_base.c | 2 +- net/ipv4/tcp_metrics.c | 2 +- net/ipv6/addrconf.c | 2 +- net/ipv6/route.c | 2 +- net/ipv6/seg6_local.c | 2 +- net/l2tp/l2tp_netlink.c | 4 +- net/mpls/af_mpls.c | 2 +- net/ncsi/ncsi-netlink.c | 12 +- net/netfilter/ipset/ip_set_bitmap_gen.h | 14 +- net/netfilter/ipset/ip_set_hash_gen.h | 14 +- net/netfilter/ipset/ip_set_list_set.c | 14 +- net/netfilter/ipvs/ip_vs_ctl.c | 10 +- net/netfilter/nf_conntrack_netlink.c | 40 ++-- net/netfilter/nf_conntrack_proto_dccp.c | 2 +- net/netfilter/nf_conntrack_proto_sctp.c | 2 +- net/netfilter/nf_conntrack_proto_tcp.c | 2 +- net/netfilter/nf_tables_api.c | 29 +-- net/netfilter/nfnetlink_cthelper.c | 7 +- net/netfilter/nfnetlink_cttimeout.c | 4 +- net/netfilter/nfnetlink_queue.c | 2 +- net/netfilter/nft_ct.c | 2 +- net/netfilter/nft_tunnel.c | 6 +- net/netlabel/netlabel_cipso_v4.c | 14 +- net/netlabel/netlabel_mgmt.c | 8 +- net/netlink/genetlink.c | 12 +- net/nfc/netlink.c | 4 +- net/openvswitch/conntrack.c | 6 +- net/openvswitch/datapath.c | 7 +- net/openvswitch/flow_netlink.c | 33 ++-- net/openvswitch/meter.c | 8 +- net/openvswitch/vport-vxlan.c | 2 +- net/openvswitch/vport.c | 2 +- net/packet/diag.c | 2 +- net/sched/act_api.c | 14 +- net/sched/act_ife.c | 2 +- net/sched/act_pedit.c | 5 +- net/sched/act_tunnel_key.c | 4 +- net/sched/cls_api.c | 4 +- net/sched/cls_basic.c | 2 +- net/sched/cls_bpf.c | 2 +- net/sched/cls_cgroup.c | 2 +- net/sched/cls_flow.c | 2 +- net/sched/cls_flower.c | 8 +- net/sched/cls_fw.c | 2 +- net/sched/cls_matchall.c | 2 +- net/sched/cls_route.c | 2 +- net/sched/cls_rsvp.h | 2 +- net/sched/cls_tcindex.c | 2 +- net/sched/cls_u32.c | 2 +- net/sched/ematch.c | 4 +- net/sched/sch_api.c | 2 +- net/sched/sch_atm.c | 2 +- net/sched/sch_cake.c | 10 +- net/sched/sch_cbq.c | 4 +- net/sched/sch_cbs.c | 2 +- net/sched/sch_choke.c | 2 +- net/sched/sch_codel.c | 2 +- net/sched/sch_drr.c | 2 +- net/sched/sch_dsmark.c | 4 +- net/sched/sch_etf.c | 2 +- net/sched/sch_fq.c | 2 +- net/sched/sch_fq_codel.c | 2 +- net/sched/sch_gred.c | 8 +- net/sched/sch_hfsc.c | 2 +- net/sched/sch_hhf.c | 2 +- net/sched/sch_htb.c | 4 +- net/sched/sch_ingress.c | 2 +- net/sched/sch_mqprio.c | 4 +- net/sched/sch_netem.c | 2 +- net/sched/sch_pie.c | 2 +- net/sched/sch_qfq.c | 2 +- net/sched/sch_red.c | 2 +- net/sched/sch_sfb.c | 2 +- net/sched/sch_taprio.c | 7 +- net/sched/sch_tbf.c | 2 +- net/tipc/bearer.c | 8 +- net/tipc/group.c | 2 +- net/tipc/link.c | 12 +- net/tipc/monitor.c | 4 +- net/tipc/name_table.c | 4 +- net/tipc/net.c | 2 +- net/tipc/netlink_compat.c | 24 +-- net/tipc/node.c | 4 +- net/tipc/socket.c | 10 +- net/tipc/udp_media.c | 2 +- net/wireless/nl80211.c | 192 +++++++++++--------- net/wireless/pmsr.c | 12 +- 114 files changed, 565 insertions(+), 494 deletions(-)
Signature · 1 line
2.21.0
PATCH 1/3 netlink: make nla_nest_start() add NLA_F_NESTED flag
Even if the NLA_F_NESTED flag was introduced more than 11 years ago, most netlink based interfaces (including recently added ones) are still not setting it in kernel generated messages. Without the flag, message parsers not aware of attribute semantics (e.g. wireshark dissector or libmnl's mnl_nlmsg_fprintf()) cannot recognize nested attributes and won't display the structure of their contents.
Unfortunately we cannot just add the flag everywhere as there may be userspace applications which check nlattr::nla_type directly rather than through a helper masking out the flags. Therefore the patch renames nla_nest_start() to nla_nest_start_noflag() and introduces nla_nest_start() as a wrapper adding NLA_F_NESTED. The calls which add NLA_F_NESTED manually are rewritten to use nla_nest_start().
Except for changes in include/net/netlink.h, the patch was generated using this semantic patch:
@@ expression E1, E2; @@
-nla_nest_start(E1, E2)
+nla_nest_start_noflag(E1, E2)
@@ expression E1, E2; @@
-nla_nest_start_noflag(E1, E2 | NLA_F_NESTED)
+nla_nest_start(E1, E2)
--- drivers/block/drbd/drbd_nl.c | 8 +- drivers/block/nbd.c | 4 +- drivers/infiniband/core/nldev.c | 9 +- drivers/infiniband/hw/cxgb4/restrack.c | 8 +- drivers/net/bonding/bond_netlink.c | 8 +- drivers/net/ieee802154/mac802154_hwsim.c | 6 +- drivers/net/macsec.c | 27 +-- drivers/net/macvlan.c | 2 +- drivers/net/team/team.c | 8 +- drivers/net/wireless/ath/wil6210/cfg80211.c | 4 +- include/linux/netfilter/ipset/ip_set.h | 2 +- include/net/netlink.h | 26 ++- kernel/taskstats.c | 2 +- net/8021q/vlan_netlink.c | 4 +- net/bridge/br_mdb.c | 17 +- net/bridge/br_netlink.c | 6 +- net/bridge/br_netlink_tunnel.c | 2 +- net/core/devlink.c | 78 ++++---- net/core/lwt_bpf.c | 2 +- net/core/lwtunnel.c | 2 +- net/core/neighbour.c | 2 +- net/core/rtnetlink.c | 48 ++--- net/dcb/dcbnl.c | 40 ++-- net/decnet/dn_table.c | 2 +- net/ieee802154/nl802154.c | 34 ++-- net/ipv4/fib_semantics.c | 2 +- net/ipv4/ipmr.c | 6 +- net/ipv4/ipmr_base.c | 2 +- net/ipv4/tcp_metrics.c | 2 +- net/ipv6/addrconf.c | 2 +- net/ipv6/route.c | 2 +- net/ipv6/seg6_local.c | 2 +- net/l2tp/l2tp_netlink.c | 4 +- net/mpls/af_mpls.c | 2 +- net/ncsi/ncsi-netlink.c | 12 +- net/netfilter/ipvs/ip_vs_ctl.c | 10 +- net/netfilter/nf_conntrack_netlink.c | 40 ++-- net/netfilter/nf_conntrack_proto_dccp.c | 2 +- net/netfilter/nf_conntrack_proto_sctp.c | 2 +- net/netfilter/nf_conntrack_proto_tcp.c | 2 +- net/netfilter/nf_tables_api.c | 29 +-- net/netfilter/nfnetlink_cthelper.c | 7 +- net/netfilter/nfnetlink_cttimeout.c | 4 +- net/netfilter/nfnetlink_queue.c | 2 +- net/netfilter/nft_ct.c | 2 +- net/netfilter/nft_tunnel.c | 6 +- net/netlabel/netlabel_cipso_v4.c | 14 +- net/netlabel/netlabel_mgmt.c | 8 +- net/netlink/genetlink.c | 12 +- net/nfc/netlink.c | 4 +- net/openvswitch/conntrack.c | 6 +- net/openvswitch/datapath.c | 7 +- net/openvswitch/flow_netlink.c | 33 ++-- net/openvswitch/meter.c | 8 +- net/openvswitch/vport-vxlan.c | 2 +- net/openvswitch/vport.c | 2 +- net/packet/diag.c | 2 +- net/sched/act_api.c | 14 +- net/sched/act_ife.c | 2 +- net/sched/act_pedit.c | 5 +- net/sched/act_tunnel_key.c | 4 +- net/sched/cls_api.c | 4 +- net/sched/cls_basic.c | 2 +- net/sched/cls_bpf.c | 2 +- net/sched/cls_cgroup.c | 2 +- net/sched/cls_flow.c | 2 +- net/sched/cls_flower.c | 8 +- net/sched/cls_fw.c | 2 +- net/sched/cls_matchall.c | 2 +- net/sched/cls_route.c | 2 +- net/sched/cls_rsvp.h | 2 +- net/sched/cls_tcindex.c | 2 +- net/sched/cls_u32.c | 2 +- net/sched/ematch.c | 4 +- net/sched/sch_api.c | 2 +- net/sched/sch_atm.c | 2 +- net/sched/sch_cake.c | 10 +- net/sched/sch_cbq.c | 4 +- net/sched/sch_cbs.c | 2 +- net/sched/sch_choke.c | 2 +- net/sched/sch_codel.c | 2 +- net/sched/sch_drr.c | 2 +- net/sched/sch_dsmark.c | 4 +- net/sched/sch_etf.c | 2 +- net/sched/sch_fq.c | 2 +- net/sched/sch_fq_codel.c | 2 +- net/sched/sch_gred.c | 8 +- net/sched/sch_hfsc.c | 2 +- net/sched/sch_hhf.c | 2 +- net/sched/sch_htb.c | 4 +- net/sched/sch_ingress.c | 2 +- net/sched/sch_mqprio.c | 4 +- net/sched/sch_netem.c | 2 +- net/sched/sch_pie.c | 2 +- net/sched/sch_qfq.c | 2 +- net/sched/sch_red.c | 2 +- net/sched/sch_sfb.c | 2 +- net/sched/sch_taprio.c | 7 +- net/sched/sch_tbf.c | 2 +- net/tipc/bearer.c | 8 +- net/tipc/group.c | 2 +- net/tipc/link.c | 12 +- net/tipc/monitor.c | 4 +- net/tipc/name_table.c | 4 +- net/tipc/net.c | 2 +- net/tipc/netlink_compat.c | 24 +-- net/tipc/node.c | 4 +- net/tipc/socket.c | 10 +- net/tipc/udp_media.c | 2 +- net/wireless/nl80211.c | 192 +++++++++++--------- net/wireless/pmsr.c | 12 +- 111 files changed, 539 insertions(+), 466 deletions(-)
drivers/block/drbd/drbd_nl.c +4 -4
@@ -114,7 +114,7 @@ static int drbd_msg_put_info(struct sk_buff *skb, const char *info)if (!info || !info[0 ])return 0 ; - nla =nla_nest_start (skb,DRBD_NLA_CFG_REPLY ); + nla =nla_nest_start_noflag (skb,DRBD_NLA_CFG_REPLY );if (!nla)return err;
@@ -135,7 +135,7 @@ static int drbd_msg_sprintf_info(struct sk_buff *skb, const char *fmt, ...)int err = -EMSGSIZE ;int len; - nla =nla_nest_start (skb,DRBD_NLA_CFG_REPLY ); + nla =nla_nest_start_noflag (skb,DRBD_NLA_CFG_REPLY );if (!nla)return err;
@@ -3269,7 +3269,7 @@ static int nla_put_drbd_cfg_context(struct sk_buff *skb, struct drbd_device *device) {struct nlattr *nla; - nla =nla_nest_start (skb,DRBD_NLA_CFG_CONTEXT ); + nla =nla_nest_start_noflag (skb,DRBD_NLA_CFG_CONTEXT );if (!nla) goto nla_put_failure; if (device &&
@@ -3837,7 +3837,7 @@ static int nla_put_status_info(struct sk_buff *skb, struct drbd_device *device,if (err) goto nla_put_failure; - nla =nla_nest_start (skb,DRBD_NLA_STATE_INFO ); + nla =nla_nest_start_noflag (skb,DRBD_NLA_STATE_INFO );if (!nla) goto nla_put_failure; if (nla_put_u32(skb, T_sib_reason, sib ? sib->sib_reason : SIB_GET_STATUS_REPLY) ||
drivers/block/nbd.c +2 -2
@@ -2047,7 +2047,7 @@ static int populate_nbd_status(struct nbd_device *nbd, struct sk_buff *reply)*/ if (refcount_read (&nbd->config_refs)) connected =1 ; - dev_opt =nla_nest_start (reply,NBD_DEVICE_ITEM ); + dev_opt =nla_nest_start_noflag (reply,NBD_DEVICE_ITEM );if (!dev_opt)return -EMSGSIZE ; ret =nla_put_u32 (reply,NBD_DEVICE_INDEX , nbd->index);
@@ -2095,7 +2095,7 @@ static int nbd_genl_status(struct sk_buff *skb, struct genl_info *info) goto out; } - dev_list =nla_nest_start (reply,NBD_ATTR_DEVICE_LIST ); + dev_list =nla_nest_start_noflag (reply,NBD_ATTR_DEVICE_LIST );if (index ==-1 ) { ret =idr_for_each (&nbd_index_idr, &status_cb, reply);if (ret) {
drivers/infiniband/core/nldev.c +5 -4
@@ -292,7 +292,8 @@ static int fill_res_info_entry(struct sk_buff *msg, {struct nlattr *entry_attr; - entry_attr =nla_nest_start (msg,RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY ); + entry_attr =nla_nest_start_noflag (msg, +RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY );if (!entry_attr)return -EMSGSIZE ;
@@ -327,7 +328,7 @@ static int fill_res_info(struct sk_buff *msg, struct ib_device *device)if (fill_nldev_handle (msg, device))return -EMSGSIZE ; - table_attr =nla_nest_start (msg,RDMA_NLDEV_ATTR_RES_SUMMARY ); + table_attr =nla_nest_start_noflag (msg,RDMA_NLDEV_ATTR_RES_SUMMARY );if (!table_attr)return -EMSGSIZE ;
@@ -1108,7 +1109,7 @@ static int res_get_common_dumpit(struct sk_buff *skb, goto err; } - table_attr =nla_nest_start (skb, fe->nldev_attr); + table_attr =nla_nest_start_noflag (skb, fe->nldev_attr);if (!table_attr) { ret = -EMSGSIZE ; goto err;
@@ -1134,7 +1135,7 @@ static int res_get_common_dumpit(struct sk_buff *skb, filled = true; - entry_attr =nla_nest_start (skb, fe->entry); + entry_attr =nla_nest_start_noflag (skb, fe->entry);if (!entry_attr) { ret = -EMSGSIZE ;rdma_restrack_put (res);
drivers/infiniband/hw/cxgb4/restrack.c +4 -4
@@ -149,7 +149,7 @@ static int fill_res_qp_entry(struct sk_buff *msg,if (qhp->ucontext)return 0 ; - table_attr =nla_nest_start (msg,RDMA_NLDEV_ATTR_DRIVER ); + table_attr =nla_nest_start_noflag (msg,RDMA_NLDEV_ATTR_DRIVER );if (!table_attr) goto err;
@@ -216,7 +216,7 @@ static int fill_res_ep_entry(struct sk_buff *msg,if (!uep)return 0 ; - table_attr =nla_nest_start (msg,RDMA_NLDEV_ATTR_DRIVER ); + table_attr =nla_nest_start_noflag (msg,RDMA_NLDEV_ATTR_DRIVER );if (!table_attr) goto err_free_uep;
@@ -387,7 +387,7 @@ static int fill_res_cq_entry(struct sk_buff *msg,if (ibcq->uobject)return 0 ; - table_attr =nla_nest_start (msg,RDMA_NLDEV_ATTR_DRIVER ); + table_attr =nla_nest_start_noflag (msg,RDMA_NLDEV_ATTR_DRIVER );if (!table_attr) goto err;
@@ -447,7 +447,7 @@ static int fill_res_mr_entry(struct sk_buff *msg,if (!stag)return 0 ; - table_attr =nla_nest_start (msg,RDMA_NLDEV_ATTR_DRIVER ); + table_attr =nla_nest_start_noflag (msg,RDMA_NLDEV_ATTR_DRIVER );if (!table_attr) goto err;
drivers/net/bonding/bond_netlink.c +4 -4
@@ -546,7 +546,7 @@ static int bond_fill_info(struct sk_buff *skb,if (nla_put_u32 (skb,IFLA_BOND_ARP_INTERVAL , bond->params.arp_interval)) goto nla_put_failure; - targets =nla_nest_start (skb,IFLA_BOND_ARP_IP_TARGET ); + targets =nla_nest_start_noflag (skb,IFLA_BOND_ARP_IP_TARGET );if (!targets) goto nla_put_failure;
@@ -644,7 +644,7 @@ static int bond_fill_info(struct sk_buff *skb,if (!bond_3ad_get_active_agg_info (bond, &info)) {struct nlattr *nest; - nest =nla_nest_start (skb,IFLA_BOND_AD_INFO ); + nest =nla_nest_start_noflag (skb,IFLA_BOND_AD_INFO );if (!nest) goto nla_put_failure;
@@ -711,7 +711,7 @@ static int bond_fill_linkxstats(struct sk_buff *skb,return -EINVAL ; } - nest =nla_nest_start (skb,LINK_XSTATS_TYPE_BOND ); + nest =nla_nest_start_noflag (skb,LINK_XSTATS_TYPE_BOND );if (!nest)return -EMSGSIZE ;if (BOND_MODE (bond) ==BOND_MODE_8023AD ) {
@@ -722,7 +722,7 @@ static int bond_fill_linkxstats(struct sk_buff *skb,else stats = &BOND_AD_INFO (bond).stats; - nest2 =nla_nest_start (skb,BOND_XSTATS_3AD ); + nest2 =nla_nest_start_noflag (skb,BOND_XSTATS_3AD );if (!nest2) {nla_nest_end (skb, nest);return -EMSGSIZE ;
drivers/net/ieee802154/mac802154_hwsim.c +4 -2
@@ -227,14 +227,16 @@ static int append_radio_msg(struct sk_buff *skb, struct hwsim_phy *phy)return 0 ; } - nl_edges =nla_nest_start (skb,MAC802154_HWSIM_ATTR_RADIO_EDGES ); + nl_edges =nla_nest_start_noflag (skb, +MAC802154_HWSIM_ATTR_RADIO_EDGES );if (!nl_edges) {rcu_read_unlock ();return -ENOBUFS ; }list_for_each_entry_rcu (e, &phy->edges, list) { - nl_edge =nla_nest_start (skb,MAC802154_HWSIM_ATTR_RADIO_EDGE ); + nl_edge =nla_nest_start_noflag (skb, +MAC802154_HWSIM_ATTR_RADIO_EDGE );if (!nl_edge) {rcu_read_unlock ();nla_nest_cancel (skb, nl_edges);
drivers/net/macsec.c +15 -12
@@ -2365,7 +2365,8 @@ copy_secy_stats(struct sk_buff *skb, struct pcpu_secy_stats __percpu *pstats)static int nla_put_secy (struct macsec_secy *secy,struct sk_buff *skb) {struct macsec_tx_sc *tx_sc = &secy->tx_sc; -struct nlattr *secy_nest =nla_nest_start (skb,MACSEC_ATTR_SECY ); +struct nlattr *secy_nest =nla_nest_start_noflag (skb, +MACSEC_ATTR_SECY );u64 csid;if (!secy_nest)
@@ -2435,7 +2436,7 @@ dump_secy(struct macsec_secy *secy, struct net_device *dev,if (nla_put_secy (secy, skb)) goto nla_put_failure; - attr =nla_nest_start (skb,MACSEC_ATTR_TXSC_STATS ); + attr =nla_nest_start_noflag (skb,MACSEC_ATTR_TXSC_STATS );if (!attr) goto nla_put_failure;if (copy_tx_sc_stats (skb, tx_sc->stats)) {
@@ -2444,7 +2445,7 @@ dump_secy(struct macsec_secy *secy, struct net_device *dev, }nla_nest_end (skb, attr); - attr =nla_nest_start (skb,MACSEC_ATTR_SECY_STATS ); + attr =nla_nest_start_noflag (skb,MACSEC_ATTR_SECY_STATS );if (!attr) goto nla_put_failure;if (copy_secy_stats (skb,macsec_priv (dev)->stats)) {
@@ -2453,7 +2454,7 @@ dump_secy(struct macsec_secy *secy, struct net_device *dev, }nla_nest_end (skb, attr); - txsa_list =nla_nest_start (skb,MACSEC_ATTR_TXSA_LIST ); + txsa_list =nla_nest_start_noflag (skb,MACSEC_ATTR_TXSA_LIST );if (!txsa_list) goto nla_put_failure;for (i =0 , j =1 ; i <MACSEC_NUM_AN ; i++) {
@@ -2463,7 +2464,7 @@ dump_secy(struct macsec_secy *secy, struct net_device *dev,if (!tx_sa)continue ; - txsa_nest =nla_nest_start (skb, j++); + txsa_nest =nla_nest_start_noflag (skb, j++);if (!txsa_nest) {nla_nest_cancel (skb, txsa_list); goto nla_put_failure;
@@ -2478,7 +2479,7 @@ dump_secy(struct macsec_secy *secy, struct net_device *dev, goto nla_put_failure; } - attr =nla_nest_start (skb,MACSEC_SA_ATTR_STATS ); + attr =nla_nest_start_noflag (skb,MACSEC_SA_ATTR_STATS );if (!attr) {nla_nest_cancel (skb, txsa_nest);nla_nest_cancel (skb, txsa_list);
@@ -2496,7 +2497,7 @@ dump_secy(struct macsec_secy *secy, struct net_device *dev, }nla_nest_end (skb, txsa_list); - rxsc_list =nla_nest_start (skb,MACSEC_ATTR_RXSC_LIST ); + rxsc_list =nla_nest_start_noflag (skb,MACSEC_ATTR_RXSC_LIST );if (!rxsc_list) goto nla_put_failure;
@@ -2504,7 +2505,7 @@ dump_secy(struct macsec_secy *secy, struct net_device *dev,for_each_rxsc_rtnl (secy, rx_sc) {int k;struct nlattr *rxsa_list; -struct nlattr *rxsc_nest =nla_nest_start (skb, j++); +struct nlattr *rxsc_nest =nla_nest_start_noflag (skb, j++);if (!rxsc_nest) {nla_nest_cancel (skb, rxsc_list);
@@ -2519,7 +2520,7 @@ dump_secy(struct macsec_secy *secy, struct net_device *dev, goto nla_put_failure; } - attr =nla_nest_start (skb,MACSEC_RXSC_ATTR_STATS ); + attr =nla_nest_start_noflag (skb,MACSEC_RXSC_ATTR_STATS );if (!attr) {nla_nest_cancel (skb, rxsc_nest);nla_nest_cancel (skb, rxsc_list);
@@ -2533,7 +2534,8 @@ dump_secy(struct macsec_secy *secy, struct net_device *dev, }nla_nest_end (skb, attr); - rxsa_list =nla_nest_start (skb,MACSEC_RXSC_ATTR_SA_LIST ); + rxsa_list =nla_nest_start_noflag (skb, +MACSEC_RXSC_ATTR_SA_LIST );if (!rxsa_list) {nla_nest_cancel (skb, rxsc_nest);nla_nest_cancel (skb, rxsc_list);
@@ -2547,7 +2549,7 @@ dump_secy(struct macsec_secy *secy, struct net_device *dev,if (!rx_sa)continue ; - rxsa_nest =nla_nest_start (skb, k++); + rxsa_nest =nla_nest_start_noflag (skb, k++);if (!rxsa_nest) {nla_nest_cancel (skb, rxsa_list);nla_nest_cancel (skb, rxsc_nest);
@@ -2555,7 +2557,8 @@ dump_secy(struct macsec_secy *secy, struct net_device *dev, goto nla_put_failure; } - attr =nla_nest_start (skb,MACSEC_SA_ATTR_STATS ); + attr =nla_nest_start_noflag (skb, +MACSEC_SA_ATTR_STATS );if (!attr) {nla_nest_cancel (skb, rxsa_list);nla_nest_cancel (skb, rxsc_nest);
drivers/net/macvlan.c +1 -1
@@ -1624,7 +1624,7 @@ static int macvlan_fill_info(struct sk_buff *skb,if (nla_put_u32 (skb,IFLA_MACVLAN_MACADDR_COUNT , vlan->macaddr_count)) goto nla_put_failure;if (vlan->macaddr_count >0 ) { - nest =nla_nest_start (skb,IFLA_MACVLAN_MACADDR_DATA ); + nest =nla_nest_start_noflag (skb,IFLA_MACVLAN_MACADDR_DATA );if (nest ==NULL ) goto nla_put_failure;
drivers/net/team/team.c +4 -4
@@ -2290,7 +2290,7 @@ static int team_nl_fill_one_option_get(struct sk_buff *skb, struct team *team,if (err)return err; - option_item =nla_nest_start (skb,TEAM_ATTR_ITEM_OPTION ); + option_item =nla_nest_start_noflag (skb,TEAM_ATTR_ITEM_OPTION );if (!option_item)return -EMSGSIZE ;
@@ -2404,7 +2404,7 @@ static int team_nl_send_options_get(struct team *team, u32 portid, u32 seq,if (nla_put_u32 (skb,TEAM_ATTR_TEAM_IFINDEX , team->dev->ifindex)) goto nla_put_failure; - option_list =nla_nest_start (skb,TEAM_ATTR_LIST_OPTION ); + option_list =nla_nest_start_noflag (skb,TEAM_ATTR_LIST_OPTION );if (!option_list) goto nla_put_failure;
@@ -2626,7 +2626,7 @@ static int team_nl_fill_one_port_get(struct sk_buff *skb, {struct nlattr *port_item; - port_item =nla_nest_start (skb,TEAM_ATTR_ITEM_PORT ); + port_item =nla_nest_start_noflag (skb,TEAM_ATTR_ITEM_PORT );if (!port_item) goto nest_cancel;if (nla_put_u32 (skb,TEAM_ATTR_PORT_IFINDEX , port->dev->ifindex))
@@ -2681,7 +2681,7 @@ static int team_nl_send_port_list_get(struct team *team, u32 portid, u32 seq,if (nla_put_u32 (skb,TEAM_ATTR_TEAM_IFINDEX , team->dev->ifindex)) goto nla_put_failure; - port_list =nla_nest_start (skb,TEAM_ATTR_LIST_PORT ); + port_list =nla_nest_start_noflag (skb,TEAM_ATTR_LIST_PORT );if (!port_list) goto nla_put_failure;
drivers/net/wireless/ath/wil6210/cfg80211.c +2 -2
@@ -2679,13 +2679,13 @@ static int wil_rf_sector_get_cfg(struct wiphy *wiphy, QCA_ATTR_PAD)) goto nla_put_failure; - nl_cfgs =nla_nest_start (msg,QCA_ATTR_DMG_RF_SECTOR_CFG ); + nl_cfgs =nla_nest_start_noflag (msg,QCA_ATTR_DMG_RF_SECTOR_CFG );if (!nl_cfgs) goto nla_put_failure;for (i =0 ; i <WMI_MAX_RF_MODULES_NUM ; i++) {if (!(rf_modules_vec &BIT (i)))continue ; - nl_cfg =nla_nest_start (msg, i); + nl_cfg =nla_nest_start_noflag (msg, i);if (!nl_cfg) goto nla_put_failure; si = &reply.evt.sectors_info[i];
include/linux/netfilter/ipset/ip_set.h +1 -1
@@ -401,7 +401,7 @@ ip_set_get_h16(const struct nlattr *attr)return ntohs (nla_get_be16 (attr)); } -#define ipset_nest_start (skb, attr) nla_nest_start(skb, attr | NLA_F_NESTED) +#define ipset_nest_start (skb, attr) nla_nest_start(skb, attr)#define ipset_nest_end (skb, start) nla_nest_end(skb, start)static inline int nla_put_ipaddr4 (struct sk_buff *skb,int type,__be32 ipaddr)
include/net/netlink.h +23 -3
@@ -1415,13 +1415,18 @@ static inline void *nla_memdup(const struct nlattr *src, gfp_t gfp) }/** -* nla_nest_start - Start a new level of nested attributes +* nla_nest_start_noflag - Start a new level of nested attributes * @skb: socket buffer to add attributes to * @attrtype: attribute type of container * -* Returns the container attribute +* This function exists for backward compatibility to use in APIs which never +* marked their nest attributes with NLA_F_NESTED flag. New APIs should use +* nla_nest_start() which sets the flag. +* +* Returns the container attribute or NULL on error */ -static inline struct nlattr *nla_nest_start (struct sk_buff *skb,int attrtype) +static inline struct nlattr *nla_nest_start_noflag (struct sk_buff *skb, +int attrtype) {struct nlattr *start = (struct nlattr *)skb_tail_pointer (skb);
@@ -1431,6 +1436,21 @@ static inline struct nlattr *nla_nest_start(struct sk_buff *skb, int attrtype)return start; } +/** +* nla_nest_start - Start a new level of nested attributes, with NLA_F_NESTED +* @skb: socket buffer to add attributes to +* @attrtype: attribute type of container +* +* Unlike nla_nest_start_noflag(), mark the nest attribute with NLA_F_NESTED +* flag. This is the preferred function to use in new code. +* +* Returns the container attribute or NULL on error +*/ +static inline struct nlattr *nla_nest_start (struct sk_buff *skb,int attrtype) +{ +return nla_nest_start_noflag (skb, attrtype |NLA_F_NESTED ); +} +/** * nla_nest_end - Finalize nesting of attributes * @skb: socket buffer the attributes are stored in
kernel/taskstats.c +1 -1
@@ -375,7 +375,7 @@ static struct taskstats *mk_reply(struct sk_buff *skb, int type, u32 pid) ? TASKSTATS_TYPE_AGGR_PID :TASKSTATS_TYPE_AGGR_TGID ; - na =nla_nest_start (skb, aggr); + na =nla_nest_start_noflag (skb, aggr);if (!na) goto err;
net/8021q/vlan_netlink.c +2 -2
@@ -227,7 +227,7 @@ static int vlan_fill_info(struct sk_buff *skb, const struct net_device *dev) goto nla_put_failure; }if (vlan->nr_ingress_mappings) { - nest =nla_nest_start (skb,IFLA_VLAN_INGRESS_QOS ); + nest =nla_nest_start_noflag (skb,IFLA_VLAN_INGRESS_QOS );if (nest ==NULL ) goto nla_put_failure;
@@ -245,7 +245,7 @@ static int vlan_fill_info(struct sk_buff *skb, const struct net_device *dev) }if (vlan->nr_egress_mappings) { - nest =nla_nest_start (skb,IFLA_VLAN_EGRESS_QOS ); + nest =nla_nest_start_noflag (skb,IFLA_VLAN_EGRESS_QOS );if (nest ==NULL ) goto nla_put_failure;
net/bridge/br_mdb.c +9 -8
@@ -26,14 +26,14 @@ static int br_rports_fill_info(struct sk_buff *skb, struct netlink_callback *cb,if (!br->multicast_router ||hlist_empty (&br->router_list))return 0 ; - nest =nla_nest_start (skb,MDBA_ROUTER ); + nest =nla_nest_start_noflag (skb,MDBA_ROUTER );if (nest ==NULL )return -EMSGSIZE ;hlist_for_each_entry_rcu (p, &br->router_list, rlist) {if (!p)continue ; - port_nest =nla_nest_start (skb,MDBA_ROUTER_PORT ); + port_nest =nla_nest_start_noflag (skb,MDBA_ROUTER_PORT );if (!port_nest) goto fail; if (nla_put_nohdr(skb, sizeof(u32), &p->dev->ifindex) ||
@@ -86,7 +86,7 @@ static int br_mdb_fill_info(struct sk_buff *skb, struct netlink_callback *cb,if (!br_opt_get (br,BROPT_MULTICAST_ENABLED ))return 0 ; - nest =nla_nest_start (skb,MDBA_MDB ); + nest =nla_nest_start_noflag (skb,MDBA_MDB );if (nest ==NULL )return -EMSGSIZE ;
@@ -98,7 +98,7 @@ static int br_mdb_fill_info(struct sk_buff *skb, struct netlink_callback *cb,if (idx < s_idx) goto skip; - nest2 =nla_nest_start (skb,MDBA_MDB_ENTRY ); + nest2 =nla_nest_start_noflag (skb,MDBA_MDB_ENTRY );if (!nest2) { err = -EMSGSIZE ;break ;
@@ -124,7 +124,8 @@ static int br_mdb_fill_info(struct sk_buff *skb, struct netlink_callback *cb, e.addr.u.ip6 = p->addr.u.ip6;#endif e.addr.proto = p->addr.proto; - nest_ent =nla_nest_start (skb,MDBA_MDB_ENTRY_INFO ); + nest_ent =nla_nest_start_noflag (skb, +MDBA_MDB_ENTRY_INFO );if (!nest_ent) {nla_nest_cancel (skb, nest2); err = -EMSGSIZE ;
@@ -248,10 +249,10 @@ static int nlmsg_populate_mdb_fill(struct sk_buff *skb,memset (bpm,0 ,sizeof (*bpm)); bpm->family =AF_BRIDGE ; bpm->ifindex = dev->ifindex; - nest =nla_nest_start (skb,MDBA_MDB ); + nest =nla_nest_start_noflag (skb,MDBA_MDB );if (nest ==NULL ) goto cancel; - nest2 =nla_nest_start (skb,MDBA_MDB_ENTRY ); + nest2 =nla_nest_start_noflag (skb,MDBA_MDB_ENTRY );if (nest2 ==NULL ) goto end;
@@ -444,7 +445,7 @@ static int nlmsg_populate_rtr_fill(struct sk_buff *skb,memset (bpm,0 ,sizeof (*bpm)); bpm->family =AF_BRIDGE ; bpm->ifindex = dev->ifindex; - nest =nla_nest_start (skb,MDBA_ROUTER ); + nest =nla_nest_start_noflag (skb,MDBA_ROUTER );if (!nest) goto cancel;
net/bridge/br_netlink.c +3 -3
@@ -414,7 +414,7 @@ static int br_fill_ifinfo(struct sk_buff *skb,if (event ==RTM_NEWLINK && port) {struct nlattr *nest - =nla_nest_start (skb,IFLA_PROTINFO |NLA_F_NESTED ); + =nla_nest_start (skb,IFLA_PROTINFO );if (nest ==NULL ||br_port_fill_attrs (skb, port) <0 ) goto nla_put_failure;
@@ -439,7 +439,7 @@ static int br_fill_ifinfo(struct sk_buff *skb,rcu_read_unlock (); goto done; } - af =nla_nest_start (skb,IFLA_AF_SPEC ); + af =nla_nest_start_noflag (skb,IFLA_AF_SPEC );if (!af) {rcu_read_unlock (); goto nla_put_failure;
@@ -1569,7 +1569,7 @@ static int br_fill_linkxstats(struct sk_buff *skb,return -EINVAL ; } - nest =nla_nest_start (skb,LINK_XSTATS_TYPE_BRIDGE ); + nest =nla_nest_start_noflag (skb,LINK_XSTATS_TYPE_BRIDGE );if (!nest)return -EMSGSIZE ;
net/bridge/br_netlink_tunnel.c +1 -1
@@ -97,7 +97,7 @@ static int br_fill_vlan_tinfo(struct sk_buff *skb, u16 vid,__be32 tid =tunnel_id_to_key32 (tunnel_id);struct nlattr *tmap; - tmap =nla_nest_start (skb,IFLA_BRIDGE_VLAN_TUNNEL_INFO ); + tmap =nla_nest_start_noflag (skb,IFLA_BRIDGE_VLAN_TUNNEL_INFO );if (!tmap)return -EMSGSIZE ; if (nla_put_u32(skb, IFLA_BRIDGE_VLAN_TUNNEL_ID,
net/core/devlink.c +44 -34
252 lines not on this page · raw message
net/core/lwt_bpf.c +1 -1
@@ -453,7 +453,7 @@ static int bpf_fill_lwt_prog(struct sk_buff *skb, int attr,if (!prog->prog)return 0 ; - nest =nla_nest_start (skb, attr); + nest =nla_nest_start_noflag (skb, attr);if (!nest)return -EMSGSIZE ;
net/core/lwtunnel.c +1 -1
@@ -237,7 +237,7 @@ int lwtunnel_fill_encap(struct sk_buff *skb, struct lwtunnel_state *lwtstate, lwtstate->type > LWTUNNEL_ENCAP_MAX)return 0 ; - nest =nla_nest_start (skb, encap_attr); + nest =nla_nest_start_noflag (skb, encap_attr);if (!nest)return -EMSGSIZE ;
net/core/neighbour.c +1 -1
@@ -1979,7 +1979,7 @@ static int neightbl_fill_parms(struct sk_buff *skb, struct neigh_parms *parms) {struct nlattr *nest; - nest =nla_nest_start (skb,NDTA_PARMS ); + nest =nla_nest_start_noflag (skb,NDTA_PARMS );if (nest ==NULL )return -ENOBUFS ;
net/core/rtnetlink.c +25 -23
172 lines not on this page · raw message
net/dcb/dcbnl.c +21 -19
@@ -246,7 +246,7 @@ static int dcbnl_getpfccfg(struct net_device *netdev, struct nlmsghdr *nlh,if (ret)return ret; - nest =nla_nest_start (skb,DCB_ATTR_PFC_CFG ); + nest =nla_nest_start_noflag (skb,DCB_ATTR_PFC_CFG );if (!nest)return -EMSGSIZE ;
@@ -304,7 +304,7 @@ static int dcbnl_getcap(struct net_device *netdev, struct nlmsghdr *nlh,if (ret)return ret; - nest =nla_nest_start (skb,DCB_ATTR_CAP ); + nest =nla_nest_start_noflag (skb,DCB_ATTR_CAP );if (!nest)return -EMSGSIZE ;
@@ -348,7 +348,7 @@ static int dcbnl_getnumtcs(struct net_device *netdev, struct nlmsghdr *nlh,if (ret)return ret; - nest =nla_nest_start (skb,DCB_ATTR_NUMTCS ); + nest =nla_nest_start_noflag (skb,DCB_ATTR_NUMTCS );if (!nest)return -EMSGSIZE ;
@@ -479,7 +479,7 @@ static int dcbnl_getapp(struct net_device *netdev, struct nlmsghdr *nlh, up =dcb_getapp (netdev, &app); } - app_nest =nla_nest_start (skb,DCB_ATTR_APP ); + app_nest =nla_nest_start_noflag (skb,DCB_ATTR_APP );if (!app_nest)return -EMSGSIZE ;
@@ -578,7 +578,7 @@ static int __dcbnl_pg_getcfg(struct net_device *netdev, struct nlmsghdr *nlh,if (ret)return ret; - pg_nest =nla_nest_start (skb,DCB_ATTR_PG_CFG ); + pg_nest =nla_nest_start_noflag (skb,DCB_ATTR_PG_CFG );if (!pg_nest)return -EMSGSIZE ;
@@ -598,7 +598,7 @@ static int __dcbnl_pg_getcfg(struct net_device *netdev, struct nlmsghdr *nlh,if (ret) goto err_pg; - param_nest =nla_nest_start (skb, i); + param_nest =nla_nest_start_noflag (skb, i);if (!param_nest) goto err_pg;
@@ -889,7 +889,7 @@ static int dcbnl_bcn_getcfg(struct net_device *netdev, struct nlmsghdr *nlh,if (ret)return ret; - bcn_nest =nla_nest_start (skb,DCB_ATTR_BCN ); + bcn_nest =nla_nest_start_noflag (skb,DCB_ATTR_BCN );if (!bcn_nest)return -EMSGSIZE ;
@@ -1002,7 +1002,7 @@ static int dcbnl_build_peer_app(struct net_device *netdev, struct sk_buff* skb,*/ err = -EMSGSIZE ; - app =nla_nest_start (skb, app_nested_type); + app =nla_nest_start_noflag (skb, app_nested_type);if (!app) goto nla_put_failure;
@@ -1036,7 +1036,7 @@ static int dcbnl_ieee_fill(struct sk_buff *skb, struct net_device *netdev)if (nla_put_string (skb,DCB_ATTR_IFNAME , netdev->name))return -EMSGSIZE ; - ieee =nla_nest_start (skb,DCB_ATTR_IEEE ); + ieee =nla_nest_start_noflag (skb,DCB_ATTR_IEEE );if (!ieee)return -EMSGSIZE ;
@@ -1106,7 +1106,7 @@ static int dcbnl_ieee_fill(struct sk_buff *skb, struct net_device *netdev)return -EMSGSIZE ; } - app =nla_nest_start (skb,DCB_ATTR_IEEE_APP_TABLE ); + app =nla_nest_start_noflag (skb,DCB_ATTR_IEEE_APP_TABLE );if (!app)return -EMSGSIZE ;
@@ -1174,13 +1174,13 @@ static int dcbnl_cee_pg_fill(struct sk_buff *skb, struct net_device *dev,u8 pgid, up_map, prio, tc_pct;const struct dcbnl_rtnl_ops *ops = dev->dcbnl_ops;int i = dir ?DCB_ATTR_CEE_TX_PG :DCB_ATTR_CEE_RX_PG ; -struct nlattr *pg =nla_nest_start (skb, i); +struct nlattr *pg =nla_nest_start_noflag (skb, i);if (!pg)return -EMSGSIZE ;for (i =DCB_PG_ATTR_TC_0 ; i <=DCB_PG_ATTR_TC_7 ; i++) { -struct nlattr *tc_nest =nla_nest_start (skb, i); +struct nlattr *tc_nest =nla_nest_start_noflag (skb, i);if (!tc_nest)return -EMSGSIZE ;
@@ -1231,7 +1231,7 @@ static int dcbnl_cee_fill(struct sk_buff *skb, struct net_device *netdev)if (nla_put_string (skb,DCB_ATTR_IFNAME , netdev->name)) goto nla_put_failure; - cee =nla_nest_start (skb,DCB_ATTR_CEE ); + cee =nla_nest_start_noflag (skb,DCB_ATTR_CEE );if (!cee) goto nla_put_failure;
@@ -1250,7 +1250,8 @@ static int dcbnl_cee_fill(struct sk_buff *skb, struct net_device *netdev)/* local pfc */ if (ops->getpfccfg) { -struct nlattr *pfc_nest =nla_nest_start (skb,DCB_ATTR_CEE_PFC ); +struct nlattr *pfc_nest =nla_nest_start_noflag (skb, +DCB_ATTR_CEE_PFC );if (!pfc_nest) goto nla_put_failure;
@@ -1265,14 +1266,14 @@ static int dcbnl_cee_fill(struct sk_buff *skb, struct net_device *netdev)/* local app */ spin_lock_bh (&dcb_lock); - app =nla_nest_start (skb,DCB_ATTR_CEE_APP_TABLE ); + app =nla_nest_start_noflag (skb,DCB_ATTR_CEE_APP_TABLE );if (!app) goto dcb_unlock;list_for_each_entry (itr, &dcb_app_list, list) {if (itr->ifindex == netdev->ifindex) { -struct nlattr *app_nest =nla_nest_start (skb, -DCB_ATTR_APP ); +struct nlattr *app_nest =nla_nest_start_noflag (skb, +DCB_ATTR_APP );if (!app_nest) goto dcb_unlock;
@@ -1305,7 +1306,8 @@ static int dcbnl_cee_fill(struct sk_buff *skb, struct net_device *netdev)/* features flags */ if (ops->getfeatcfg) { -struct nlattr *feat =nla_nest_start (skb,DCB_ATTR_CEE_FEAT ); +struct nlattr *feat =nla_nest_start_noflag (skb, +DCB_ATTR_CEE_FEAT );if (!feat) goto nla_put_failure;
@@ -1607,7 +1609,7 @@ static int dcbnl_getfeatcfg(struct net_device *netdev, struct nlmsghdr *nlh,if (ret)return ret; - nest =nla_nest_start (skb,DCB_ATTR_FEATCFG ); + nest =nla_nest_start_noflag (skb,DCB_ATTR_FEATCFG );if (!nest)return -EMSGSIZE ;
net/decnet/dn_table.c +1 -1
@@ -348,7 +348,7 @@ static int dn_fib_dump_info(struct sk_buff *skb, u32 portid, u32 seq, int event,struct rtnexthop *nhp;struct nlattr *mp_head; -if (!(mp_head =nla_nest_start (skb,RTA_MULTIPATH ))) +if (!(mp_head =nla_nest_start_noflag (skb,RTA_MULTIPATH ))) goto errout;for_nexthops (fi) {
net/ieee802154/nl802154.c +18 -16
@@ -312,7 +312,7 @@ static inline void *nl802154hdr_put(struct sk_buff *skb, u32 portid, u32 seq,static int nl802154_put_flags (struct sk_buff *msg,int attr,u32 mask) { -struct nlattr *nl_flags =nla_nest_start (msg, attr); +struct nlattr *nl_flags =nla_nest_start_noflag (msg, attr);int i;if (!nl_flags)
@@ -338,7 +338,7 @@ nl802154_send_wpan_phy_channels(struct cfg802154_registered_device *rdev,struct nlattr *nl_page;unsigned long page; - nl_page =nla_nest_start (msg,NL802154_ATTR_CHANNELS_SUPPORTED ); + nl_page =nla_nest_start_noflag (msg,NL802154_ATTR_CHANNELS_SUPPORTED );if (!nl_page)return -ENOBUFS ;
@@ -360,11 +360,11 @@ nl802154_put_capabilities(struct sk_buff *msg,struct nlattr *nl_caps, *nl_channels;int i; - nl_caps =nla_nest_start (msg,NL802154_ATTR_WPAN_PHY_CAPS ); + nl_caps =nla_nest_start_noflag (msg,NL802154_ATTR_WPAN_PHY_CAPS );if (!nl_caps)return -ENOBUFS ; - nl_channels =nla_nest_start (msg,NL802154_CAP_ATTR_CHANNELS ); + nl_channels =nla_nest_start_noflag (msg,NL802154_CAP_ATTR_CHANNELS );if (!nl_channels)return -ENOBUFS ;
@@ -380,8 +380,8 @@ nl802154_put_capabilities(struct sk_buff *msg,if (rdev->wpan_phy.flags &WPAN_PHY_FLAG_CCA_ED_LEVEL ) {struct nlattr *nl_ed_lvls; - nl_ed_lvls =nla_nest_start (msg, -NL802154_CAP_ATTR_CCA_ED_LEVELS ); + nl_ed_lvls =nla_nest_start_noflag (msg, +NL802154_CAP_ATTR_CCA_ED_LEVELS );if (!nl_ed_lvls)return -ENOBUFS ;
@@ -396,7 +396,8 @@ nl802154_put_capabilities(struct sk_buff *msg,if (rdev->wpan_phy.flags &WPAN_PHY_FLAG_TXPOWER ) {struct nlattr *nl_tx_pwrs; - nl_tx_pwrs =nla_nest_start (msg,NL802154_CAP_ATTR_TX_POWERS ); + nl_tx_pwrs =nla_nest_start_noflag (msg, +NL802154_CAP_ATTR_TX_POWERS );if (!nl_tx_pwrs)return -ENOBUFS ;
@@ -504,7 +505,7 @@ static int nl802154_send_wpan_phy(struct cfg802154_registered_device *rdev,if (nl802154_put_capabilities (msg, rdev)) goto nla_put_failure; - nl_cmds =nla_nest_start (msg,NL802154_ATTR_SUPPORTED_COMMANDS ); + nl_cmds =nla_nest_start_noflag (msg,NL802154_ATTR_SUPPORTED_COMMANDS );if (!nl_cmds) goto nla_put_failure;
@@ -693,7 +694,8 @@ ieee802154_llsec_send_key_id(struct sk_buff *msg,switch (desc->mode) {case NL802154_KEY_ID_MODE_IMPLICIT : - nl_dev_addr =nla_nest_start (msg,NL802154_KEY_ID_ATTR_IMPLICIT ); + nl_dev_addr =nla_nest_start_noflag (msg, +NL802154_KEY_ID_ATTR_IMPLICIT );if (!nl_dev_addr)return -ENOBUFS ;
@@ -768,7 +770,7 @@ static int nl802154_get_llsec_params(struct sk_buff *msg, params.frame_counter))return -ENOBUFS ; - nl_key_id =nla_nest_start (msg,NL802154_ATTR_SEC_OUT_KEY_ID ); + nl_key_id =nla_nest_start_noflag (msg,NL802154_ATTR_SEC_OUT_KEY_ID );if (!nl_key_id)return -ENOBUFS ;
@@ -1455,11 +1457,11 @@ static int nl802154_send_key(struct sk_buff *msg, u32 cmd, u32 portid,if (nla_put_u32 (msg,NL802154_ATTR_IFINDEX , dev->ifindex)) goto nla_put_failure; - nl_key =nla_nest_start (msg,NL802154_ATTR_SEC_KEY ); + nl_key =nla_nest_start_noflag (msg,NL802154_ATTR_SEC_KEY );if (!nl_key) goto nla_put_failure; - nl_key_id =nla_nest_start (msg,NL802154_KEY_ATTR_ID ); + nl_key_id =nla_nest_start_noflag (msg,NL802154_KEY_ATTR_ID );if (!nl_key_id) goto nla_put_failure;
@@ -1639,7 +1641,7 @@ static int nl802154_send_device(struct sk_buff *msg, u32 cmd, u32 portid,if (nla_put_u32 (msg,NL802154_ATTR_IFINDEX , dev->ifindex)) goto nla_put_failure; - nl_device =nla_nest_start (msg,NL802154_ATTR_SEC_DEVICE ); + nl_device =nla_nest_start_noflag (msg,NL802154_ATTR_SEC_DEVICE );if (!nl_device) goto nla_put_failure;
@@ -1808,7 +1810,7 @@ static int nl802154_send_devkey(struct sk_buff *msg, u32 cmd, u32 portid,if (nla_put_u32 (msg,NL802154_ATTR_IFINDEX , dev->ifindex)) goto nla_put_failure; - nl_devkey =nla_nest_start (msg,NL802154_ATTR_SEC_DEVKEY ); + nl_devkey =nla_nest_start_noflag (msg,NL802154_ATTR_SEC_DEVKEY );if (!nl_devkey) goto nla_put_failure;
@@ -1818,7 +1820,7 @@ static int nl802154_send_devkey(struct sk_buff *msg, u32 cmd, u32 portid, devkey->frame_counter)) goto nla_put_failure; - nl_key_id =nla_nest_start (msg,NL802154_DEVKEY_ATTR_ID ); + nl_key_id =nla_nest_start_noflag (msg,NL802154_DEVKEY_ATTR_ID );if (!nl_key_id) goto nla_put_failure;
@@ -1976,7 +1978,7 @@ static int nl802154_send_seclevel(struct sk_buff *msg, u32 cmd, u32 portid,if (nla_put_u32 (msg,NL802154_ATTR_IFINDEX , dev->ifindex)) goto nla_put_failure; - nl_seclevel =nla_nest_start (msg,NL802154_ATTR_SEC_LEVEL ); + nl_seclevel =nla_nest_start_noflag (msg,NL802154_ATTR_SEC_LEVEL );if (!nl_seclevel) goto nla_put_failure;
net/ipv4/fib_semantics.c +1 -1
@@ -1550,7 +1550,7 @@ static int fib_add_multipath(struct sk_buff *skb, struct fib_info *fi) {struct nlattr *mp; - mp =nla_nest_start (skb,RTA_MULTIPATH ); + mp =nla_nest_start_noflag (skb,RTA_MULTIPATH );if (!mp) goto nla_put_failure;
net/ipv4/ipmr.c +3 -3
@@ -2783,7 +2783,7 @@ static bool ipmr_fill_vif(struct mr_table *mrt, u32 vifid, struct sk_buff *skb)return true; vif = &mrt->vif_table[vifid]; - vif_nest =nla_nest_start (skb,IPMRA_VIF ); + vif_nest =nla_nest_start_noflag (skb,IPMRA_VIF );if (!vif_nest)return false; if (nla_put_u32(skb, IPMRA_VIFA_IFINDEX, vif->dev->ifindex) ||
@@ -2867,7 +2867,7 @@ static int ipmr_rtm_dumplink(struct sk_buff *skb, struct netlink_callback *cb)memset (hdr,0 ,sizeof (*hdr)); hdr->ifi_family =RTNL_FAMILY_IPMR ; - af =nla_nest_start (skb,IFLA_AF_SPEC ); + af =nla_nest_start_noflag (skb,IFLA_AF_SPEC );if (!af) {nlmsg_cancel (skb, nlh); goto out;
@@ -2878,7 +2878,7 @@ static int ipmr_rtm_dumplink(struct sk_buff *skb, struct netlink_callback *cb) goto out; } - vifs =nla_nest_start (skb,IPMRA_TABLE_VIFS ); + vifs =nla_nest_start_noflag (skb,IPMRA_TABLE_VIFS );if (!vifs) {nla_nest_end (skb, af);nlmsg_end (skb, nlh);
net/ipv4/ipmr_base.c +1 -1
@@ -228,7 +228,7 @@ int mr_fill_mroute(struct mr_table *mrt, struct sk_buff *skb,if (c->mfc_flags &MFC_OFFLOAD ) rtm->rtm_flags |=RTNH_F_OFFLOAD ; - mp_attr =nla_nest_start (skb,RTA_MULTIPATH ); + mp_attr =nla_nest_start_noflag (skb,RTA_MULTIPATH );if (!mp_attr)return -EMSGSIZE ;
net/ipv4/tcp_metrics.c +1 -1
@@ -658,7 +658,7 @@ static int tcp_metrics_fill_info(struct sk_buff *msg, {int n =0 ; - nest =nla_nest_start (msg,TCP_METRICS_ATTR_VALS ); + nest =nla_nest_start_noflag (msg,TCP_METRICS_ATTR_VALS );if (!nest) goto nla_put_failure;for (i =0 ; i <TCP_METRIC_MAX_KERNEL +1 ; i++) {
net/ipv6/addrconf.c +1 -1
@@ -5752,7 +5752,7 @@ static int inet6_fill_ifinfo(struct sk_buff *skb, struct inet6_dev *idev, nla_put_u8(skb, IFLA_OPERSTATE, netif_running(dev) ? dev->operstate : IF_OPER_DOWN)) goto nla_put_failure; - protoinfo =nla_nest_start (skb,IFLA_PROTINFO ); + protoinfo =nla_nest_start_noflag (skb,IFLA_PROTINFO );if (!protoinfo) goto nla_put_failure;
net/ipv6/route.c +1 -1
@@ -4777,7 +4777,7 @@ static int rt6_fill_node(struct net *net, struct sk_buff *skb,struct fib6_info *sibling, *next_sibling;struct nlattr *mp; - mp =nla_nest_start (skb,RTA_MULTIPATH ); + mp =nla_nest_start_noflag (skb,RTA_MULTIPATH );if (!mp) goto nla_put_failure;
net/ipv6/seg6_local.c +1 -1
@@ -853,7 +853,7 @@ static int put_nla_bpf(struct sk_buff *skb, struct seg6_local_lwt *slwt)if (!slwt->bpf.prog)return 0 ; - nest =nla_nest_start (skb,SEG6_LOCAL_BPF ); + nest =nla_nest_start_noflag (skb,SEG6_LOCAL_BPF );if (!nest)return -EMSGSIZE ;
net/l2tp/l2tp_netlink.c +2 -2
@@ -345,7 +345,7 @@ static int l2tp_nl_tunnel_send(struct sk_buff *skb, u32 portid, u32 seq, int fla nla_put_u16(skb, L2TP_ATTR_ENCAP_TYPE, tunnel->encap)) goto nla_put_failure; - nest =nla_nest_start (skb,L2TP_ATTR_STATS ); + nest =nla_nest_start_noflag (skb,L2TP_ATTR_STATS );if (nest ==NULL ) goto nla_put_failure;
@@ -742,7 +742,7 @@ static int l2tp_nl_session_send(struct sk_buff *skb, u32 portid, u32 seq, int fl session->reorder_timeout, L2TP_ATTR_PAD))) goto nla_put_failure; - nest =nla_nest_start (skb,L2TP_ATTR_STATS ); + nest =nla_nest_start_noflag (skb,L2TP_ATTR_STATS );if (nest ==NULL ) goto nla_put_failure;
net/mpls/af_mpls.c +1 -1
@@ -2017,7 +2017,7 @@ static int mpls_dump_route(struct sk_buff *skb, u32 portid, u32 seq, int event,u8 linkdown =0 ;u8 dead =0 ; - mp =nla_nest_start (skb,RTA_MULTIPATH ); + mp =nla_nest_start_noflag (skb,RTA_MULTIPATH );if (!mp) goto nla_put_failure;
net/ncsi/ncsi-netlink.c +6 -6
@@ -79,7 +79,7 @@ static int ncsi_write_channel_info(struct sk_buff *skb,nla_put_u32 (skb,NCSI_CHANNEL_ATTR_VERSION_MINOR , nc->version.alpha2);nla_put_string (skb,NCSI_CHANNEL_ATTR_VERSION_STR , nc->version.fw_name); - vid_nest =nla_nest_start (skb,NCSI_CHANNEL_ATTR_VLAN_LIST ); + vid_nest =nla_nest_start_noflag (skb,NCSI_CHANNEL_ATTR_VLAN_LIST );if (!vid_nest)return -ENOMEM ; ncf = &nc->vlan_filter;
@@ -113,19 +113,19 @@ static int ncsi_write_package_info(struct sk_buff *skb, NCSI_FOR_EACH_PACKAGE(ndp, np) {if (np->id != id)continue ; - pnest =nla_nest_start (skb,NCSI_PKG_ATTR ); + pnest =nla_nest_start_noflag (skb,NCSI_PKG_ATTR );if (!pnest)return -ENOMEM ;nla_put_u32 (skb,NCSI_PKG_ATTR_ID , np->id);if ((0x1 << np->id) == ndp->package_whitelist)nla_put_flag (skb,NCSI_PKG_ATTR_FORCED ); - cnest =nla_nest_start (skb,NCSI_PKG_ATTR_CHANNEL_LIST ); + cnest =nla_nest_start_noflag (skb,NCSI_PKG_ATTR_CHANNEL_LIST );if (!cnest) {nla_nest_cancel (skb, pnest);return -ENOMEM ; } NCSI_FOR_EACH_CHANNEL(np, nc) { - nest =nla_nest_start (skb,NCSI_CHANNEL_ATTR ); + nest =nla_nest_start_noflag (skb,NCSI_CHANNEL_ATTR );if (!nest) {nla_nest_cancel (skb, cnest);nla_nest_cancel (skb, pnest);
@@ -187,7 +187,7 @@ static int ncsi_pkg_info_nl(struct sk_buff *msg, struct genl_info *info) package_id =nla_get_u32 (info->attrs[NCSI_ATTR_PACKAGE_ID ]); - attr =nla_nest_start (skb,NCSI_ATTR_PACKAGE_LIST ); + attr =nla_nest_start_noflag (skb,NCSI_ATTR_PACKAGE_LIST );if (!attr) {kfree_skb (skb);return -EMSGSIZE ;
@@ -250,7 +250,7 @@ static int ncsi_pkg_info_all_nl(struct sk_buff *skb, goto err; } - attr =nla_nest_start (skb,NCSI_ATTR_PACKAGE_LIST ); + attr =nla_nest_start_noflag (skb,NCSI_ATTR_PACKAGE_LIST );if (!attr) { rc = -EMSGSIZE ; goto err;
net/netfilter/ipvs/ip_vs_ctl.c +5 -5
@@ -2916,7 +2916,7 @@ static const struct nla_policy ip_vs_dest_policy[IPVS_DEST_ATTR_MAX + 1] = {static int ip_vs_genl_fill_stats (struct sk_buff *skb,int container_type,struct ip_vs_kstats *kstats) { -struct nlattr *nl_stats =nla_nest_start (skb, container_type); +struct nlattr *nl_stats =nla_nest_start_noflag (skb, container_type);if (!nl_stats)return -EMSGSIZE ;
@@ -2946,7 +2946,7 @@ static int ip_vs_genl_fill_stats(struct sk_buff *skb, int container_type,static int ip_vs_genl_fill_stats64 (struct sk_buff *skb,int container_type,struct ip_vs_kstats *kstats) { -struct nlattr *nl_stats =nla_nest_start (skb, container_type); +struct nlattr *nl_stats =nla_nest_start_noflag (skb, container_type);if (!nl_stats)return -EMSGSIZE ;
@@ -2992,7 +2992,7 @@ static int ip_vs_genl_fill_service(struct sk_buff *skb,struct ip_vs_kstats kstats;char *sched_name; - nl_service =nla_nest_start (skb,IPVS_CMD_ATTR_SERVICE ); + nl_service =nla_nest_start_noflag (skb,IPVS_CMD_ATTR_SERVICE );if (!nl_service)return -EMSGSIZE ;
@@ -3203,7 +3203,7 @@ static int ip_vs_genl_fill_dest(struct sk_buff *skb, struct ip_vs_dest *dest)struct nlattr *nl_dest;struct ip_vs_kstats kstats; - nl_dest =nla_nest_start (skb,IPVS_CMD_ATTR_DEST ); + nl_dest =nla_nest_start_noflag (skb,IPVS_CMD_ATTR_DEST );if (!nl_dest)return -EMSGSIZE ;
@@ -3373,7 +3373,7 @@ static int ip_vs_genl_fill_daemon(struct sk_buff *skb, __u32 state, {struct nlattr *nl_daemon; - nl_daemon =nla_nest_start (skb,IPVS_CMD_ATTR_DAEMON ); + nl_daemon =nla_nest_start_noflag (skb,IPVS_CMD_ATTR_DAEMON );if (!nl_daemon)return -EMSGSIZE ;
net/netfilter/nf_conntrack_netlink.c +20 -20
@@ -63,7 +63,7 @@ static int ctnetlink_dump_tuples_proto(struct sk_buff *skb,int ret =0 ;struct nlattr *nest_parms; - nest_parms =nla_nest_start (skb,CTA_TUPLE_PROTO |NLA_F_NESTED ); + nest_parms =nla_nest_start (skb,CTA_TUPLE_PROTO );if (!nest_parms) goto nla_put_failure;if (nla_put_u8 (skb,CTA_PROTO_NUM , tuple->dst.protonum))
@@ -104,7 +104,7 @@ static int ctnetlink_dump_tuples_ip(struct sk_buff *skb,int ret =0 ;struct nlattr *nest_parms; - nest_parms =nla_nest_start (skb,CTA_TUPLE_IP |NLA_F_NESTED ); + nest_parms =nla_nest_start (skb,CTA_TUPLE_IP );if (!nest_parms) goto nla_put_failure;
@@ -187,7 +187,7 @@ static int ctnetlink_dump_protoinfo(struct sk_buff *skb, struct nf_conn *ct)if (!l4proto->to_nlattr)return 0 ; - nest_proto =nla_nest_start (skb,CTA_PROTOINFO |NLA_F_NESTED ); + nest_proto =nla_nest_start (skb,CTA_PROTOINFO );if (!nest_proto) goto nla_put_failure;
@@ -215,7 +215,7 @@ static int ctnetlink_dump_helpinfo(struct sk_buff *skb,if (!helper) goto out; - nest_helper =nla_nest_start (skb,CTA_HELP |NLA_F_NESTED ); + nest_helper =nla_nest_start (skb,CTA_HELP );if (!nest_helper) goto nla_put_failure;if (nla_put_string (skb,CTA_HELP_NAME , helper->name))
@@ -249,7 +249,7 @@ dump_counters(struct sk_buff *skb, struct nf_conn_acct *acct, bytes =atomic64_read (&counter[dir].bytes); } - nest_count =nla_nest_start (skb, attr |NLA_F_NESTED ); + nest_count =nla_nest_start (skb, attr);if (!nest_count) goto nla_put_failure;
@@ -293,7 +293,7 @@ ctnetlink_dump_timestamp(struct sk_buff *skb, const struct nf_conn *ct)if (!tstamp)return 0 ; - nest_count =nla_nest_start (skb,CTA_TIMESTAMP |NLA_F_NESTED ); + nest_count =nla_nest_start (skb,CTA_TIMESTAMP );if (!nest_count) goto nla_put_failure;
@@ -337,7 +337,7 @@ static int ctnetlink_dump_secctx(struct sk_buff *skb, const struct nf_conn *ct)return 0 ; ret =-1 ; - nest_secctx =nla_nest_start (skb,CTA_SECCTX |NLA_F_NESTED ); + nest_secctx =nla_nest_start (skb,CTA_SECCTX );if (!nest_secctx) goto nla_put_failure;
@@ -397,7 +397,7 @@ static int ctnetlink_dump_master(struct sk_buff *skb, const struct nf_conn *ct)if (!(ct->status &IPS_EXPECTED ))return 0 ; - nest_parms =nla_nest_start (skb,CTA_TUPLE_MASTER |NLA_F_NESTED ); + nest_parms =nla_nest_start (skb,CTA_TUPLE_MASTER );if (!nest_parms) goto nla_put_failure;if (ctnetlink_dump_tuples (skb,master_tuple (ct)) <0 )
@@ -415,7 +415,7 @@ dump_ct_seq_adj(struct sk_buff *skb, const struct nf_ct_seqadj *seq, int type) {struct nlattr *nest_parms; - nest_parms =nla_nest_start (skb, type |NLA_F_NESTED ); + nest_parms =nla_nest_start (skb, type);if (!nest_parms) goto nla_put_failure;
@@ -467,7 +467,7 @@ static int ctnetlink_dump_ct_synproxy(struct sk_buff *skb, struct nf_conn *ct)if (!synproxy)return 0 ; - nest_parms =nla_nest_start (skb,CTA_SYNPROXY |NLA_F_NESTED ); + nest_parms =nla_nest_start (skb,CTA_SYNPROXY );if (!nest_parms) goto nla_put_failure;
@@ -528,7 +528,7 @@ ctnetlink_fill_info(struct sk_buff *skb, u32 portid, u32 seq, u32 type, zone =nf_ct_zone (ct); - nest_parms =nla_nest_start (skb,CTA_TUPLE_ORIG |NLA_F_NESTED ); + nest_parms =nla_nest_start (skb,CTA_TUPLE_ORIG );if (!nest_parms) goto nla_put_failure;if (ctnetlink_dump_tuples (skb,nf_ct_tuple (ct,IP_CT_DIR_ORIGINAL )) <0 )
@@ -538,7 +538,7 @@ ctnetlink_fill_info(struct sk_buff *skb, u32 portid, u32 seq, u32 type, goto nla_put_failure;nla_nest_end (skb, nest_parms); - nest_parms =nla_nest_start (skb,CTA_TUPLE_REPLY |NLA_F_NESTED ); + nest_parms =nla_nest_start (skb,CTA_TUPLE_REPLY );if (!nest_parms) goto nla_put_failure;if (ctnetlink_dump_tuples (skb,nf_ct_tuple (ct,IP_CT_DIR_REPLY )) <0 )
@@ -720,7 +720,7 @@ ctnetlink_conntrack_event(unsigned int events, struct nf_ct_event *item) zone =nf_ct_zone (ct); - nest_parms =nla_nest_start (skb,CTA_TUPLE_ORIG |NLA_F_NESTED ); + nest_parms =nla_nest_start (skb,CTA_TUPLE_ORIG );if (!nest_parms) goto nla_put_failure;if (ctnetlink_dump_tuples (skb,nf_ct_tuple (ct,IP_CT_DIR_ORIGINAL )) <0 )
@@ -730,7 +730,7 @@ ctnetlink_conntrack_event(unsigned int events, struct nf_ct_event *item) goto nla_put_failure;nla_nest_end (skb, nest_parms); - nest_parms =nla_nest_start (skb,CTA_TUPLE_REPLY |NLA_F_NESTED ); + nest_parms =nla_nest_start (skb,CTA_TUPLE_REPLY );if (!nest_parms) goto nla_put_failure;if (ctnetlink_dump_tuples (skb,nf_ct_tuple (ct,IP_CT_DIR_REPLY )) <0 )
@@ -2400,7 +2400,7 @@ static int __ctnetlink_glue_build(struct sk_buff *skb, struct nf_conn *ct) zone =nf_ct_zone (ct); - nest_parms =nla_nest_start (skb,CTA_TUPLE_ORIG |NLA_F_NESTED ); + nest_parms =nla_nest_start (skb,CTA_TUPLE_ORIG );if (!nest_parms) goto nla_put_failure;if (ctnetlink_dump_tuples (skb,nf_ct_tuple (ct,IP_CT_DIR_ORIGINAL )) <0 )
@@ -2410,7 +2410,7 @@ static int __ctnetlink_glue_build(struct sk_buff *skb, struct nf_conn *ct) goto nla_put_failure;nla_nest_end (skb, nest_parms); - nest_parms =nla_nest_start (skb,CTA_TUPLE_REPLY |NLA_F_NESTED ); + nest_parms =nla_nest_start (skb,CTA_TUPLE_REPLY );if (!nest_parms) goto nla_put_failure;if (ctnetlink_dump_tuples (skb,nf_ct_tuple (ct,IP_CT_DIR_REPLY )) <0 )
@@ -2472,7 +2472,7 @@ ctnetlink_glue_build(struct sk_buff *skb, struct nf_conn *ct, {struct nlattr *nest_parms; - nest_parms =nla_nest_start (skb, ct_attr |NLA_F_NESTED ); + nest_parms =nla_nest_start (skb, ct_attr);if (!nest_parms) goto nla_put_failure;
@@ -2644,7 +2644,7 @@ static int ctnetlink_exp_dump_tuple(struct sk_buff *skb, {struct nlattr *nest_parms; - nest_parms =nla_nest_start (skb, type |NLA_F_NESTED ); + nest_parms =nla_nest_start (skb, type);if (!nest_parms) goto nla_put_failure;if (ctnetlink_dump_tuples (skb, tuple) <0 )
@@ -2671,7 +2671,7 @@ static int ctnetlink_exp_dump_mask(struct sk_buff *skb, m.src.u.all = mask->src.u.all; m.dst.protonum = tuple->dst.protonum; - nest_parms =nla_nest_start (skb,CTA_EXPECT_MASK |NLA_F_NESTED ); + nest_parms =nla_nest_start (skb,CTA_EXPECT_MASK );if (!nest_parms) goto nla_put_failure;
@@ -2743,7 +2743,7 @@ ctnetlink_exp_dump_expect(struct sk_buff *skb,#if IS_ENABLED (CONFIG_NF_NAT )if (!nf_inet_addr_cmp (&exp->saved_addr, &any_addr) || exp->saved_proto.all) { - nest_parms =nla_nest_start (skb,CTA_EXPECT_NAT |NLA_F_NESTED ); + nest_parms =nla_nest_start (skb,CTA_EXPECT_NAT );if (!nest_parms) goto nla_put_failure;
net/netfilter/nf_conntrack_proto_dccp.c +1 -1
@@ -598,7 +598,7 @@ static int dccp_to_nlattr(struct sk_buff *skb, struct nlattr *nla,struct nlattr *nest_parms;spin_lock_bh (&ct->lock); - nest_parms =nla_nest_start (skb,CTA_PROTOINFO_DCCP |NLA_F_NESTED ); + nest_parms =nla_nest_start (skb,CTA_PROTOINFO_DCCP );if (!nest_parms) goto nla_put_failure; if (nla_put_u8(skb, CTA_PROTOINFO_DCCP_STATE, ct->proto.dccp.state) ||
net/netfilter/nf_conntrack_proto_sctp.c +1 -1
@@ -520,7 +520,7 @@ static int sctp_to_nlattr(struct sk_buff *skb, struct nlattr *nla,struct nlattr *nest_parms;spin_lock_bh (&ct->lock); - nest_parms =nla_nest_start (skb,CTA_PROTOINFO_SCTP |NLA_F_NESTED ); + nest_parms =nla_nest_start (skb,CTA_PROTOINFO_SCTP );if (!nest_parms) goto nla_put_failure;
net/netfilter/nf_conntrack_proto_tcp.c +1 -1
@@ -1192,7 +1192,7 @@ static int tcp_to_nlattr(struct sk_buff *skb, struct nlattr *nla,struct nf_ct_tcp_flags tmp = {};spin_lock_bh (&ct->lock); - nest_parms =nla_nest_start (skb,CTA_PROTOINFO_TCP |NLA_F_NESTED ); + nest_parms =nla_nest_start (skb,CTA_PROTOINFO_TCP );if (!nest_parms) goto nla_put_failure;
net/netfilter/nf_tables_api.c +15 -14
@@ -1200,7 +1200,7 @@ static int nft_dump_stats(struct sk_buff *skb, struct nft_stats __percpu *stats) total.pkts += pkts; total.bytes += bytes; } - nest =nla_nest_start (skb,NFTA_CHAIN_COUNTERS ); + nest =nla_nest_start_noflag (skb,NFTA_CHAIN_COUNTERS );if (nest ==NULL ) goto nla_put_failure;
@@ -1248,7 +1248,7 @@ static int nf_tables_fill_chain_info(struct sk_buff *skb, struct net *net,const struct nf_hook_ops *ops = &basechain->ops;struct nlattr *nest; - nest =nla_nest_start (skb,NFTA_CHAIN_HOOK ); + nest =nla_nest_start_noflag (skb,NFTA_CHAIN_HOOK );if (nest ==NULL ) goto nla_put_failure;if (nla_put_be32 (skb,NFTA_HOOK_HOOKNUM ,htonl (ops->hooknum)))
@@ -2059,7 +2059,8 @@ static int nf_tables_fill_expr_info(struct sk_buff *skb, goto nla_put_failure;if (expr->ops->dump) { -struct nlattr *data =nla_nest_start (skb,NFTA_EXPR_DATA ); +struct nlattr *data =nla_nest_start_noflag (skb, +NFTA_EXPR_DATA );if (data ==NULL ) goto nla_put_failure;if (expr->ops->dump (skb, expr) <0 )
@@ -2078,7 +2079,7 @@ int nft_expr_dump(struct sk_buff *skb, unsigned int attr, {struct nlattr *nest; - nest =nla_nest_start (skb, attr); + nest =nla_nest_start_noflag (skb, attr);if (!nest) goto nla_put_failure;if (nf_tables_fill_expr_info (skb, expr) <0 )
@@ -2289,7 +2290,7 @@ static int nf_tables_fill_rule_info(struct sk_buff *skb, struct net *net, goto nla_put_failure; } - list =nla_nest_start (skb,NFTA_RULE_EXPRESSIONS ); + list =nla_nest_start_noflag (skb,NFTA_RULE_EXPRESSIONS );if (list ==NULL ) goto nla_put_failure;nft_rule_for_each_expr (expr, next, rule) {
@@ -3258,7 +3259,7 @@ static int nf_tables_fill_set(struct sk_buff *skb, const struct nft_ctx *ctx,if (nla_put (skb,NFTA_SET_USERDATA , set->udlen, set->udata)) goto nla_put_failure; - desc =nla_nest_start (skb,NFTA_SET_DESC ); + desc =nla_nest_start_noflag (skb,NFTA_SET_DESC );if (desc ==NULL ) goto nla_put_failure; if (set->size &&
@@ -3908,7 +3909,7 @@ static int nf_tables_fill_setelem(struct sk_buff *skb,unsigned char *b =skb_tail_pointer (skb);struct nlattr *nest; - nest =nla_nest_start (skb,NFTA_LIST_ELEM ); + nest =nla_nest_start_noflag (skb,NFTA_LIST_ELEM );if (nest ==NULL ) goto nla_put_failure;
@@ -4052,7 +4053,7 @@ static int nf_tables_dump_set(struct sk_buff *skb, struct netlink_callback *cb)if (nla_put_string (skb,NFTA_SET_ELEM_LIST_SET , set->name)) goto nla_put_failure; - nest =nla_nest_start (skb,NFTA_SET_ELEM_LIST_ELEMENTS ); + nest =nla_nest_start_noflag (skb,NFTA_SET_ELEM_LIST_ELEMENTS );if (nest ==NULL ) goto nla_put_failure;
@@ -4124,7 +4125,7 @@ static int nf_tables_fill_setelem_info(struct sk_buff *skb,if (nla_put_string (skb,NFTA_SET_NAME , set->name)) goto nla_put_failure; - nest =nla_nest_start (skb,NFTA_SET_ELEM_LIST_ELEMENTS ); + nest =nla_nest_start_noflag (skb,NFTA_SET_ELEM_LIST_ELEMENTS );if (nest ==NULL ) goto nla_put_failure;
@@ -5014,7 +5015,7 @@ static int nft_object_dump(struct sk_buff *skb, unsigned int attr, {struct nlattr *nest; - nest =nla_nest_start (skb, attr); + nest =nla_nest_start_noflag (skb, attr);if (!nest) goto nla_put_failure;if (obj->ops->dump (skb, obj, reset) <0 )
@@ -5831,14 +5832,14 @@ static int nf_tables_fill_flowtable_info(struct sk_buff *skb, struct net *net, NFTA_FLOWTABLE_PAD)) goto nla_put_failure; - nest =nla_nest_start (skb,NFTA_FLOWTABLE_HOOK ); + nest =nla_nest_start_noflag (skb,NFTA_FLOWTABLE_HOOK );if (!nest) goto nla_put_failure;if (nla_put_be32 (skb,NFTA_FLOWTABLE_HOOK_NUM ,htonl (flowtable->hooknum)) ||nla_put_be32 (skb,NFTA_FLOWTABLE_HOOK_PRIORITY ,htonl (flowtable->priority))) goto nla_put_failure; - nest_devs =nla_nest_start (skb,NFTA_FLOWTABLE_HOOK_DEVS ); + nest_devs =nla_nest_start_noflag (skb,NFTA_FLOWTABLE_HOOK_DEVS );if (!nest_devs) goto nla_put_failure;
@@ -7264,7 +7265,7 @@ int nft_verdict_dump(struct sk_buff *skb, int type, const struct nft_verdict *v) {struct nlattr *nest; - nest =nla_nest_start (skb, type); + nest =nla_nest_start_noflag (skb, type);if (!nest) goto nla_put_failure;
@@ -7377,7 +7378,7 @@ int nft_data_dump(struct sk_buff *skb, int attr, const struct nft_data *data,struct nlattr *nest;int err; - nest =nla_nest_start (skb, attr); + nest =nla_nest_start_noflag (skb, attr);if (nest ==NULL )return -1 ;
net/netfilter/nfnetlink_cthelper.c +3 -4
@@ -462,7 +462,7 @@ nfnl_cthelper_dump_tuple(struct sk_buff *skb, {struct nlattr *nest_parms; - nest_parms =nla_nest_start (skb,NFCTH_TUPLE |NLA_F_NESTED ); + nest_parms =nla_nest_start (skb,NFCTH_TUPLE );if (nest_parms ==NULL ) goto nla_put_failure;
@@ -487,7 +487,7 @@ nfnl_cthelper_dump_policy(struct sk_buff *skb,int i;struct nlattr *nest_parms1, *nest_parms2; - nest_parms1 =nla_nest_start (skb,NFCTH_POLICY |NLA_F_NESTED ); + nest_parms1 =nla_nest_start (skb,NFCTH_POLICY );if (nest_parms1 ==NULL ) goto nla_put_failure;
@@ -496,8 +496,7 @@ nfnl_cthelper_dump_policy(struct sk_buff *skb, goto nla_put_failure;for (i =0 ; i < helper->expect_class_max +1 ; i++) { - nest_parms2 =nla_nest_start (skb, - (NFCTH_POLICY_SET +i) |NLA_F_NESTED ); + nest_parms2 =nla_nest_start (skb, (NFCTH_POLICY_SET + i));if (nest_parms2 ==NULL ) goto nla_put_failure;
net/netfilter/nfnetlink_cttimeout.c +2 -2
@@ -184,7 +184,7 @@ ctnl_timeout_fill_info(struct sk_buff *skb, u32 portid, u32 seq, u32 type, htonl(refcount_read(&timeout->refcnt)))) goto nla_put_failure; - nest_parms =nla_nest_start (skb,CTA_TIMEOUT_DATA |NLA_F_NESTED ); + nest_parms =nla_nest_start (skb,CTA_TIMEOUT_DATA );if (!nest_parms) goto nla_put_failure;
@@ -401,7 +401,7 @@ cttimeout_default_fill_info(struct net *net, struct sk_buff *skb, u32 portid, nla_put_u8(skb, CTA_TIMEOUT_L4PROTO, l4proto->l4proto)) goto nla_put_failure; - nest_parms =nla_nest_start (skb,CTA_TIMEOUT_DATA |NLA_F_NESTED ); + nest_parms =nla_nest_start (skb,CTA_TIMEOUT_DATA );if (!nest_parms) goto nla_put_failure;
net/netfilter/nfnetlink_queue.c +1 -1
@@ -351,7 +351,7 @@ static int nfqnl_put_bridge(struct nf_queue_entry *entry, struct sk_buff *skb)if (skb_vlan_tag_present (entskb)) {struct nlattr *nest; - nest =nla_nest_start (skb,NFQA_VLAN |NLA_F_NESTED ); + nest =nla_nest_start (skb,NFQA_VLAN );if (!nest) goto nla_put_failure;
net/netfilter/nft_ct.c +1 -1
@@ -928,7 +928,7 @@ static int nft_ct_timeout_obj_dump(struct sk_buff *skb, nla_put_be16(skb, NFTA_CT_TIMEOUT_L3PROTO, htons(timeout->l3num)))return -1 ; - nest_params =nla_nest_start (skb,NFTA_CT_TIMEOUT_DATA |NLA_F_NESTED ); + nest_params =nla_nest_start (skb,NFTA_CT_TIMEOUT_DATA );if (!nest_params)return -1 ;
net/netfilter/nft_tunnel.c +3 -3
@@ -437,7 +437,7 @@ static int nft_tunnel_ip_dump(struct sk_buff *skb, struct ip_tunnel_info *info)struct nlattr *nest;if (info->mode &IP_TUNNEL_INFO_IPV6 ) { - nest =nla_nest_start (skb,NFTA_TUNNEL_KEY_IP6 ); + nest =nla_nest_start_noflag (skb,NFTA_TUNNEL_KEY_IP6 );if (!nest)return -1 ;
@@ -448,7 +448,7 @@ static int nft_tunnel_ip_dump(struct sk_buff *skb, struct ip_tunnel_info *info)nla_nest_end (skb, nest); }else { - nest =nla_nest_start (skb,NFTA_TUNNEL_KEY_IP ); + nest =nla_nest_start_noflag (skb,NFTA_TUNNEL_KEY_IP );if (!nest)return -1 ;
@@ -468,7 +468,7 @@ static int nft_tunnel_opts_dump(struct sk_buff *skb,struct nft_tunnel_opts *opts = &priv->opts;struct nlattr *nest; - nest =nla_nest_start (skb,NFTA_TUNNEL_KEY_OPTS ); + nest =nla_nest_start_noflag (skb,NFTA_TUNNEL_KEY_OPTS );if (!nest)return -1 ;
net/netlabel/netlabel_cipso_v4.c +9 -5
@@ -498,7 +498,7 @@ static int netlbl_cipsov4_list(struct sk_buff *skb, struct genl_info *info)if (ret_val !=0 ) goto list_failure_lock; - nla_a =nla_nest_start (ans_skb,NLBL_CIPSOV4_A_TAGLST ); + nla_a =nla_nest_start_noflag (ans_skb,NLBL_CIPSOV4_A_TAGLST );if (nla_a ==NULL ) { ret_val = -ENOMEM ; goto list_failure_lock;
@@ -517,7 +517,8 @@ static int netlbl_cipsov4_list(struct sk_buff *skb, struct genl_info *info)switch (doi_def->type) {case CIPSO_V4_MAP_TRANS : - nla_a =nla_nest_start (ans_skb,NLBL_CIPSOV4_A_MLSLVLLST ); + nla_a =nla_nest_start_noflag (ans_skb, +NLBL_CIPSOV4_A_MLSLVLLST );if (nla_a ==NULL ) { ret_val = -ENOMEM ; goto list_failure_lock;
@@ -529,7 +530,8 @@ static int netlbl_cipsov4_list(struct sk_buff *skb, struct genl_info *info) CIPSO_V4_INV_LVL)continue ; - nla_b =nla_nest_start (ans_skb,NLBL_CIPSOV4_A_MLSLVL ); + nla_b =nla_nest_start_noflag (ans_skb, +NLBL_CIPSOV4_A_MLSLVL );if (nla_b ==NULL ) { ret_val = -ENOMEM ; goto list_retry;
@@ -548,7 +550,8 @@ static int netlbl_cipsov4_list(struct sk_buff *skb, struct genl_info *info) }nla_nest_end (ans_skb, nla_a); - nla_a =nla_nest_start (ans_skb,NLBL_CIPSOV4_A_MLSCATLST ); + nla_a =nla_nest_start_noflag (ans_skb, +NLBL_CIPSOV4_A_MLSCATLST );if (nla_a ==NULL ) { ret_val = -ENOMEM ; goto list_retry;
@@ -560,7 +563,8 @@ static int netlbl_cipsov4_list(struct sk_buff *skb, struct genl_info *info) CIPSO_V4_INV_CAT)continue ; - nla_b =nla_nest_start (ans_skb,NLBL_CIPSOV4_A_MLSCAT ); + nla_b =nla_nest_start_noflag (ans_skb, +NLBL_CIPSOV4_A_MLSCAT );if (nla_b ==NULL ) { ret_val = -ENOMEM ; goto list_retry;
net/netlabel/netlabel_mgmt.c +5 -3
@@ -315,7 +315,7 @@ static int netlbl_mgmt_listentry(struct sk_buff *skb,switch (entry->def.type) {case NETLBL_NLTYPE_ADDRSELECT : - nla_a =nla_nest_start (skb,NLBL_MGMT_A_SELECTORLIST ); + nla_a =nla_nest_start_noflag (skb,NLBL_MGMT_A_SELECTORLIST );if (nla_a ==NULL )return -ENOMEM ;
@@ -323,7 +323,8 @@ static int netlbl_mgmt_listentry(struct sk_buff *skb,struct netlbl_domaddr4_map *map4;struct in_addr addr_struct; - nla_b =nla_nest_start (skb,NLBL_MGMT_A_ADDRSELECTOR ); + nla_b =nla_nest_start_noflag (skb, +NLBL_MGMT_A_ADDRSELECTOR );if (nla_b ==NULL )return -ENOMEM ;
@@ -357,7 +358,8 @@ static int netlbl_mgmt_listentry(struct sk_buff *skb, netlbl_af6list_foreach_rcu(iter6, &entry->def.addrsel->list6) {struct netlbl_domaddr6_map *map6; - nla_b =nla_nest_start (skb,NLBL_MGMT_A_ADDRSELECTOR ); + nla_b =nla_nest_start_noflag (skb, +NLBL_MGMT_A_ADDRSELECTOR );if (nla_b ==NULL )return -ENOMEM ;
net/netlink/genetlink.c +6 -6
@@ -665,7 +665,7 @@ static int ctrl_fill_info(const struct genl_family *family, u32 portid, u32 seq,struct nlattr *nla_ops;int i; - nla_ops =nla_nest_start (skb,CTRL_ATTR_OPS ); + nla_ops =nla_nest_start_noflag (skb,CTRL_ATTR_OPS );if (nla_ops ==NULL ) goto nla_put_failure;
@@ -681,7 +681,7 @@ static int ctrl_fill_info(const struct genl_family *family, u32 portid, u32 seq,if (family->policy) op_flags |=GENL_CMD_CAP_HASPOL ; - nest =nla_nest_start (skb, i +1 ); + nest =nla_nest_start_noflag (skb, i +1 );if (nest ==NULL ) goto nla_put_failure;
@@ -699,7 +699,7 @@ static int ctrl_fill_info(const struct genl_family *family, u32 portid, u32 seq,struct nlattr *nla_grps;int i; - nla_grps =nla_nest_start (skb,CTRL_ATTR_MCAST_GROUPS ); + nla_grps =nla_nest_start_noflag (skb,CTRL_ATTR_MCAST_GROUPS );if (nla_grps ==NULL ) goto nla_put_failure;
@@ -709,7 +709,7 @@ static int ctrl_fill_info(const struct genl_family *family, u32 portid, u32 seq, grp = &family->mcgrps[i]; - nest =nla_nest_start (skb, i +1 ); + nest =nla_nest_start_noflag (skb, i +1 );if (nest ==NULL ) goto nla_put_failure;
@@ -749,11 +749,11 @@ static int ctrl_fill_mcgrp_info(const struct genl_family *family, nla_put_u16(skb, CTRL_ATTR_FAMILY_ID, family->id)) goto nla_put_failure; - nla_grps =nla_nest_start (skb,CTRL_ATTR_MCAST_GROUPS ); + nla_grps =nla_nest_start_noflag (skb,CTRL_ATTR_MCAST_GROUPS );if (nla_grps ==NULL ) goto nla_put_failure; - nest =nla_nest_start (skb,1 ); + nest =nla_nest_start_noflag (skb,1 );if (nest ==NULL ) goto nla_put_failure;
net/nfc/netlink.c +2 -2
@@ -392,7 +392,7 @@ int nfc_genl_llc_send_sdres(struct nfc_dev *dev, struct hlist_head *sdres_list)if (nla_put_u32 (msg,NFC_ATTR_DEVICE_INDEX , dev->idx)) goto nla_put_failure; - sdp_attr =nla_nest_start (msg,NFC_ATTR_LLC_SDP ); + sdp_attr =nla_nest_start_noflag (msg,NFC_ATTR_LLC_SDP );if (sdp_attr ==NULL ) { rc = -ENOMEM ; goto nla_put_failure;
@@ -402,7 +402,7 @@ int nfc_genl_llc_send_sdres(struct nfc_dev *dev, struct hlist_head *sdres_list)hlist_for_each_entry_safe (sdres, n, sdres_list, node) {pr_debug ("uri: %s, sap: %d\n" , sdres->uri, sdres->sap); - uri_attr =nla_nest_start (msg, i++); + uri_attr =nla_nest_start_noflag (msg, i++);if (uri_attr ==NULL ) { rc = -ENOMEM ; goto nla_put_failure;
net/openvswitch/conntrack.c +3 -3
@@ -1683,7 +1683,7 @@ static bool ovs_ct_nat_to_attr(const struct ovs_conntrack_info *info, {struct nlattr *start; - start =nla_nest_start (skb,OVS_CT_ATTR_NAT ); + start =nla_nest_start_noflag (skb,OVS_CT_ATTR_NAT );if (!start)return false;
@@ -1750,7 +1750,7 @@ int ovs_ct_action_to_attr(const struct ovs_conntrack_info *ct_info, {struct nlattr *start; - start =nla_nest_start (skb,OVS_ACTION_ATTR_CT ); + start =nla_nest_start_noflag (skb,OVS_ACTION_ATTR_CT );if (!start)return -EMSGSIZE ;
@@ -2160,7 +2160,7 @@ static int ovs_ct_limit_cmd_get(struct sk_buff *skb, struct genl_info *info)if (IS_ERR (reply))return PTR_ERR (reply); - nla_reply =nla_nest_start (reply,OVS_CT_LIMIT_ATTR_ZONE_LIMIT ); + nla_reply =nla_nest_start_noflag (reply,OVS_CT_LIMIT_ATTR_ZONE_LIMIT );if (a[OVS_CT_LIMIT_ATTR_ZONE_LIMIT ]) { err = ovs_ct_limit_get_zone_limit(
net/openvswitch/datapath.c +4 -3
@@ -463,7 +463,8 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb, nla_data(upcall_info->userdata));if (upcall_info->egress_tun_info) { - nla =nla_nest_start (user_skb,OVS_PACKET_ATTR_EGRESS_TUN_KEY ); + nla =nla_nest_start_noflag (user_skb, +OVS_PACKET_ATTR_EGRESS_TUN_KEY );if (!nla) { err = -EMSGSIZE ; goto out;
@@ -475,7 +476,7 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb, }if (upcall_info->actions_len) { - nla =nla_nest_start (user_skb,OVS_PACKET_ATTR_ACTIONS ); + nla =nla_nest_start_noflag (user_skb,OVS_PACKET_ATTR_ACTIONS );if (!nla) { err = -EMSGSIZE ; goto out;
@@ -776,7 +777,7 @@ static int ovs_flow_cmd_fill_actions(const struct sw_flow *flow,* This can only fail for dump operations because the skb is always * properly sized for single flows. */ - start =nla_nest_start (skb,OVS_FLOW_ATTR_ACTIONS ); + start =nla_nest_start_noflag (skb,OVS_FLOW_ATTR_ACTIONS );if (start) {const struct sw_flow_actions *sf_acts;
net/openvswitch/flow_netlink.c +17 -16
@@ -856,7 +856,7 @@ static int vxlan_opt_to_nlattr(struct sk_buff *skb,const struct vxlan_metadata *opts = tun_opts;struct nlattr *nla; - nla =nla_nest_start (skb,OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS ); + nla =nla_nest_start_noflag (skb,OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS );if (!nla)return -EMSGSIZE ;
@@ -948,7 +948,7 @@ static int ip_tun_to_nlattr(struct sk_buff *skb,struct nlattr *nla;int err; - nla =nla_nest_start (skb,OVS_KEY_ATTR_TUNNEL ); + nla =nla_nest_start_noflag (skb,OVS_KEY_ATTR_TUNNEL );if (!nla)return -EMSGSIZE ;
@@ -1957,7 +1957,7 @@ static int nsh_key_to_nlattr(const struct ovs_key_nsh *nsh, bool is_mask, {struct nlattr *start; - start =nla_nest_start (skb,OVS_KEY_ATTR_NSH ); + start =nla_nest_start_noflag (skb,OVS_KEY_ATTR_NSH );if (!start)return -EMSGSIZE ;
@@ -2040,14 +2040,15 @@ static int __ovs_nla_put_key(const struct sw_flow_key *swkey,if (swkey->eth.vlan.tci ||eth_type_vlan (swkey->eth.type)) {if (ovs_nla_put_vlan (skb, &output->eth.vlan, is_mask)) goto nla_put_failure; - encap =nla_nest_start (skb,OVS_KEY_ATTR_ENCAP ); + encap =nla_nest_start_noflag (skb,OVS_KEY_ATTR_ENCAP );if (!swkey->eth.vlan.tci) goto unencap;if (swkey->eth.cvlan.tci ||eth_type_vlan (swkey->eth.type)) {if (ovs_nla_put_vlan (skb, &output->eth.cvlan, is_mask)) goto nla_put_failure; - in_encap =nla_nest_start (skb,OVS_KEY_ATTR_ENCAP ); + in_encap =nla_nest_start_noflag (skb, +OVS_KEY_ATTR_ENCAP );if (!swkey->eth.cvlan.tci) goto unencap; }
@@ -2226,7 +2227,7 @@ int ovs_nla_put_key(const struct sw_flow_key *swkey,int err;struct nlattr *nla; - nla =nla_nest_start (skb, attr); + nla =nla_nest_start_noflag (skb, attr);if (!nla)return -EMSGSIZE ; err =__ovs_nla_put_key (swkey, output, is_mask, skb);
@@ -3252,7 +3253,7 @@ static int sample_action_to_attr(const struct nlattr *attr,const struct sample_arg *arg;struct nlattr *actions; - start =nla_nest_start (skb,OVS_ACTION_ATTR_SAMPLE ); + start =nla_nest_start_noflag (skb,OVS_ACTION_ATTR_SAMPLE );if (!start)return -EMSGSIZE ;
@@ -3265,7 +3266,7 @@ static int sample_action_to_attr(const struct nlattr *attr, goto out; } - ac_start =nla_nest_start (skb,OVS_SAMPLE_ATTR_ACTIONS ); + ac_start =nla_nest_start_noflag (skb,OVS_SAMPLE_ATTR_ACTIONS );if (!ac_start) { err = -EMSGSIZE ; goto out;
@@ -3291,7 +3292,7 @@ static int clone_action_to_attr(const struct nlattr *attr,struct nlattr *start;int err =0 , rem =nla_len (attr); - start =nla_nest_start (skb,OVS_ACTION_ATTR_CLONE ); + start =nla_nest_start_noflag (skb,OVS_ACTION_ATTR_CLONE );if (!start)return -EMSGSIZE ;
@@ -3313,7 +3314,7 @@ static int check_pkt_len_action_to_attr(const struct nlattr *attr,const struct nlattr *a, *cpl_arg;int err =0 , rem =nla_len (attr); - start =nla_nest_start (skb,OVS_ACTION_ATTR_CHECK_PKT_LEN ); + start =nla_nest_start_noflag (skb,OVS_ACTION_ATTR_CHECK_PKT_LEN );if (!start)return -EMSGSIZE ;
@@ -3332,8 +3333,8 @@ static int check_pkt_len_action_to_attr(const struct nlattr *attr,* 'OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_LESS_EQUAL'. */ a =nla_next (cpl_arg, &rem); - ac_start =nla_nest_start (skb, -OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_LESS_EQUAL ); + ac_start =nla_nest_start_noflag (skb, +OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_LESS_EQUAL );if (!ac_start) { err = -EMSGSIZE ; goto out;
@@ -3351,8 +3352,8 @@ static int check_pkt_len_action_to_attr(const struct nlattr *attr,* OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_GREATER. */ a =nla_next (a, &rem); - ac_start =nla_nest_start (skb, -OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_GREATER ); + ac_start =nla_nest_start_noflag (skb, +OVS_CHECK_PKT_LEN_ATTR_ACTIONS_IF_GREATER );if (!ac_start) { err = -EMSGSIZE ; goto out;
@@ -3386,7 +3387,7 @@ static int set_action_to_attr(const struct nlattr *a, struct sk_buff *skb)struct ovs_tunnel_info *ovs_tun =nla_data (ovs_key);struct ip_tunnel_info *tun_info = &ovs_tun->tun_dst->u.tun_info; - start =nla_nest_start (skb,OVS_ACTION_ATTR_SET ); + start =nla_nest_start_noflag (skb,OVS_ACTION_ATTR_SET );if (!start)return -EMSGSIZE ;
@@ -3418,7 +3419,7 @@ static int masked_set_action_to_set_action_attr(const struct nlattr *a,/* Revert the conversion we did from a non-masked set action to * masked set action. */ - nla =nla_nest_start (skb,OVS_ACTION_ATTR_SET ); + nla =nla_nest_start_noflag (skb,OVS_ACTION_ATTR_SET );if (!nla)return -EMSGSIZE ;
net/openvswitch/meter.c +4 -4
@@ -127,7 +127,7 @@ static int ovs_meter_cmd_reply_stats(struct sk_buff *reply, u32 meter_id, OVS_METER_ATTR_PAD)) goto error; - nla =nla_nest_start (reply,OVS_METER_ATTR_BANDS ); + nla =nla_nest_start_noflag (reply,OVS_METER_ATTR_BANDS );if (!nla) goto error;
@@ -136,7 +136,7 @@ static int ovs_meter_cmd_reply_stats(struct sk_buff *reply, u32 meter_id,for (i =0 ; i < meter->n_bands; ++i, ++band) {struct nlattr *band_nla; - band_nla =nla_nest_start (reply,OVS_BAND_ATTR_UNSPEC ); + band_nla =nla_nest_start_noflag (reply,OVS_BAND_ATTR_UNSPEC );if (!band_nla ||nla_put (reply,OVS_BAND_ATTR_STATS ,sizeof (struct ovs_flow_stats ), &band->stats))
@@ -166,11 +166,11 @@ static int ovs_meter_cmd_features(struct sk_buff *skb, struct genl_info *info) nla_put_u32(reply, OVS_METER_ATTR_MAX_BANDS, DP_MAX_BANDS)) goto nla_put_failure; - nla =nla_nest_start (reply,OVS_METER_ATTR_BANDS ); + nla =nla_nest_start_noflag (reply,OVS_METER_ATTR_BANDS );if (!nla) goto nla_put_failure; - band_nla =nla_nest_start (reply,OVS_BAND_ATTR_UNSPEC ); + band_nla =nla_nest_start_noflag (reply,OVS_BAND_ATTR_UNSPEC );if (!band_nla) goto nla_put_failure;/* Currently only DROP band type is supported. */
net/openvswitch/vport-vxlan.c +1 -1
@@ -43,7 +43,7 @@ static int vxlan_get_options(const struct vport *vport, struct sk_buff *skb)if (vxlan->cfg.flags &VXLAN_F_GBP ) {struct nlattr *exts; - exts =nla_nest_start (skb,OVS_TUNNEL_ATTR_EXTENSION ); + exts =nla_nest_start_noflag (skb,OVS_TUNNEL_ATTR_EXTENSION );if (!exts)return -EMSGSIZE ;
net/openvswitch/vport.c +1 -1
@@ -319,7 +319,7 @@ int ovs_vport_get_options(const struct vport *vport, struct sk_buff *skb)if (!vport->ops->get_options)return 0 ; - nla =nla_nest_start (skb,OVS_VPORT_ATTR_OPTIONS ); + nla =nla_nest_start_noflag (skb,OVS_VPORT_ATTR_OPTIONS );if (!nla)return -EMSGSIZE ;
net/packet/diag.c +1 -1
@@ -39,7 +39,7 @@ static int pdiag_put_mclist(const struct packet_sock *po, struct sk_buff *nlskb)struct nlattr *mca;struct packet_mclist *ml; - mca =nla_nest_start (nlskb,PACKET_DIAG_MCLIST ); + mca =nla_nest_start_noflag (nlskb,PACKET_DIAG_MCLIST );if (!mca)return -EMSGSIZE ;
net/sched/act_api.c +7 -7
@@ -242,7 +242,7 @@ static int tcf_dump_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb, (unsigned long)p->tcfa_tm.lastuse))continue ; - nest =nla_nest_start (skb, n_i); + nest =nla_nest_start_noflag (skb, n_i);if (!nest) { index--; goto nla_put_failure;
@@ -299,7 +299,7 @@ static int tcf_del_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb,struct tc_action *p;unsigned long id =1 ; - nest =nla_nest_start (skb,0 ); + nest =nla_nest_start_noflag (skb,0 );if (nest ==NULL ) goto nla_put_failure;if (nla_put_string (skb,TCA_KIND , ops->kind))
@@ -776,7 +776,7 @@ tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref) }rcu_read_unlock (); - nest =nla_nest_start (skb,TCA_OPTIONS ); + nest =nla_nest_start_noflag (skb,TCA_OPTIONS );if (nest ==NULL ) goto nla_put_failure; err =tcf_action_dump_old (skb, a, bind, ref);
@@ -800,7 +800,7 @@ int tcf_action_dump(struct sk_buff *skb, struct tc_action *actions[],for (i =0 ; i <TCA_ACT_MAX_PRIO && actions[i]; i++) { a = actions[i]; - nest =nla_nest_start (skb, a->order); + nest =nla_nest_start_noflag (skb, a->order);if (nest ==NULL ) goto nla_put_failure; err =tcf_action_dump_1 (skb, a, bind, ref);
@@ -1052,7 +1052,7 @@ static int tca_get_fill(struct sk_buff *skb, struct tc_action *actions[], t->tca__pad1 =0 ; t->tca__pad2 =0 ; - nest =nla_nest_start (skb,TCA_ACT_TAB ); + nest =nla_nest_start_noflag (skb,TCA_ACT_TAB );if (!nest) goto out_nlmsg_trim;
@@ -1176,7 +1176,7 @@ static int tca_action_flush(struct net *net, struct nlattr *nla, t->tca__pad1 =0 ; t->tca__pad2 =0 ; - nest =nla_nest_start (skb,TCA_ACT_TAB ); + nest =nla_nest_start_noflag (skb,TCA_ACT_TAB );if (!nest) {NL_SET_ERR_MSG (extack,"Failed to add new netlink message" ); goto out_module_put;
@@ -1508,7 +1508,7 @@ static int tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)if (!count_attr) goto out_module_put; - nest =nla_nest_start (skb,TCA_ACT_TAB ); + nest =nla_nest_start_noflag (skb,TCA_ACT_TAB );if (nest ==NULL ) goto out_module_put;
net/sched/act_ife.c +1 -1
@@ -387,7 +387,7 @@ static int dump_metalist(struct sk_buff *skb, struct tcf_ife_info *ife)if (list_empty (&ife->metalist))return 0 ; - nest =nla_nest_start (skb,TCA_IFE_METALST ); + nest =nla_nest_start_noflag (skb,TCA_IFE_METALST );if (!nest) goto out_nlmsg_trim;
net/sched/act_pedit.c +3 -2
@@ -108,14 +108,15 @@ static struct tcf_pedit_key_ex *tcf_pedit_keys_ex_parse(struct nlattr *nla,static int tcf_pedit_key_ex_dump (struct sk_buff *skb,struct tcf_pedit_key_ex *keys_ex,int n) { -struct nlattr *keys_start =nla_nest_start (skb,TCA_PEDIT_KEYS_EX ); +struct nlattr *keys_start =nla_nest_start_noflag (skb, +TCA_PEDIT_KEYS_EX );if (!keys_start) goto nla_failure;for (; n >0 ; n--) {struct nlattr *key_start; - key_start =nla_nest_start (skb,TCA_PEDIT_KEY_EX ); + key_start =nla_nest_start_noflag (skb,TCA_PEDIT_KEY_EX );if (!key_start) goto nla_failure;
net/sched/act_tunnel_key.c +2 -2
@@ -426,7 +426,7 @@ static int tunnel_key_geneve_opts_dump(struct sk_buff *skb,u8 *src = (u8 *)(info +1 );struct nlattr *start; - start =nla_nest_start (skb,TCA_TUNNEL_KEY_ENC_OPTS_GENEVE ); + start =nla_nest_start_noflag (skb,TCA_TUNNEL_KEY_ENC_OPTS_GENEVE );if (!start)return -EMSGSIZE ;
@@ -460,7 +460,7 @@ static int tunnel_key_opts_dump(struct sk_buff *skb,if (!info->options_len)return 0 ; - start =nla_nest_start (skb,TCA_TUNNEL_KEY_ENC_OPTS ); + start =nla_nest_start_noflag (skb,TCA_TUNNEL_KEY_ENC_OPTS );if (!start)return -EMSGSIZE ;
net/sched/cls_api.c +2 -2
@@ -3111,7 +3111,7 @@ int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts)* tc data even if iproute2 was newer - jhs */ if (exts->type !=TCA_OLD_COMPAT ) { - nest =nla_nest_start (skb, exts->action); + nest =nla_nest_start_noflag (skb, exts->action);if (nest ==NULL ) goto nla_put_failure;
@@ -3120,7 +3120,7 @@ int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts)nla_nest_end (skb, nest); }else if (exts->police) {struct tc_action *act =tcf_exts_first_act (exts); - nest =nla_nest_start (skb, exts->police); + nest =nla_nest_start_noflag (skb, exts->police);if (nest ==NULL || !act) goto nla_put_failure;if (tcf_action_dump_old (skb, act,0 ,0 ) <0 )
net/sched/cls_basic.c +1 -1
@@ -288,7 +288,7 @@ static int basic_dump(struct net *net, struct tcf_proto *tp, void *fh, t->tcm_handle = f->handle; - nest =nla_nest_start (skb,TCA_OPTIONS ); + nest =nla_nest_start_noflag (skb,TCA_OPTIONS );if (nest ==NULL ) goto nla_put_failure;
net/sched/cls_bpf.c +1 -1
@@ -591,7 +591,7 @@ static int cls_bpf_dump(struct net *net, struct tcf_proto *tp, void *fh,cls_bpf_offload_update_stats (tp, prog); - nest =nla_nest_start (skb,TCA_OPTIONS ); + nest =nla_nest_start_noflag (skb,TCA_OPTIONS );if (nest ==NULL ) goto nla_put_failure;
net/sched/cls_cgroup.c +1 -1
@@ -176,7 +176,7 @@ static int cls_cgroup_dump(struct net *net, struct tcf_proto *tp, void *fh, t->tcm_handle = head->handle; - nest =nla_nest_start (skb,TCA_OPTIONS ); + nest =nla_nest_start_noflag (skb,TCA_OPTIONS );if (nest ==NULL ) goto nla_put_failure;
net/sched/cls_flow.c +1 -1
@@ -629,7 +629,7 @@ static int flow_dump(struct net *net, struct tcf_proto *tp, void *fh, t->tcm_handle = f->handle; - nest =nla_nest_start (skb,TCA_OPTIONS ); + nest =nla_nest_start_noflag (skb,TCA_OPTIONS );if (nest ==NULL ) goto nla_put_failure;
net/sched/cls_flower.c +4 -4
@@ -2051,7 +2051,7 @@ static int fl_dump_key_geneve_opt(struct sk_buff *skb,struct nlattr *nest;int opt_off =0 ; - nest =nla_nest_start (skb,TCA_FLOWER_KEY_ENC_OPTS_GENEVE ); + nest =nla_nest_start_noflag (skb,TCA_FLOWER_KEY_ENC_OPTS_GENEVE );if (!nest) goto nla_put_failure;
@@ -2087,7 +2087,7 @@ static int fl_dump_key_options(struct sk_buff *skb, int enc_opt_type,if (!enc_opts->len)return 0 ; - nest =nla_nest_start (skb, enc_opt_type); + nest =nla_nest_start_noflag (skb, enc_opt_type);if (!nest) goto nla_put_failure;
@@ -2333,7 +2333,7 @@ static int fl_dump(struct net *net, struct tcf_proto *tp, void *fh, t->tcm_handle = f->handle; - nest =nla_nest_start (skb,TCA_OPTIONS ); + nest =nla_nest_start_noflag (skb,TCA_OPTIONS );if (!nest) goto nla_put_failure;
@@ -2384,7 +2384,7 @@ static int fl_tmplt_dump(struct sk_buff *skb, struct net *net, void *tmplt_priv)struct fl_flow_key *key, *mask;struct nlattr *nest; - nest =nla_nest_start (skb,TCA_OPTIONS ); + nest =nla_nest_start_noflag (skb,TCA_OPTIONS );if (!nest) goto nla_put_failure;
net/sched/cls_fw.c +1 -1
@@ -402,7 +402,7 @@ static int fw_dump(struct net *net, struct tcf_proto *tp, void *fh,if (!f->res.classid && !tcf_exts_has_actions (&f->exts))return skb->len; - nest =nla_nest_start (skb,TCA_OPTIONS ); + nest =nla_nest_start_noflag (skb,TCA_OPTIONS );if (nest ==NULL ) goto nla_put_failure;
net/sched/cls_matchall.c +1 -1
@@ -303,7 +303,7 @@ static int mall_dump(struct net *net, struct tcf_proto *tp, void *fh, t->tcm_handle = head->handle; - nest =nla_nest_start (skb,TCA_OPTIONS ); + nest =nla_nest_start_noflag (skb,TCA_OPTIONS );if (!nest) goto nla_put_failure;
net/sched/cls_route.c +1 -1
@@ -607,7 +607,7 @@ static int route4_dump(struct net *net, struct tcf_proto *tp, void *fh, t->tcm_handle = f->handle; - nest =nla_nest_start (skb,TCA_OPTIONS ); + nest =nla_nest_start_noflag (skb,TCA_OPTIONS );if (nest ==NULL ) goto nla_put_failure;
net/sched/cls_rsvp.h +1 -1
@@ -706,7 +706,7 @@ static int rsvp_dump(struct net *net, struct tcf_proto *tp, void *fh, t->tcm_handle = f->handle; - nest =nla_nest_start (skb,TCA_OPTIONS ); + nest =nla_nest_start_noflag (skb,TCA_OPTIONS );if (nest ==NULL ) goto nla_put_failure;
net/sched/cls_tcindex.c +1 -1
@@ -601,7 +601,7 @@ static int tcindex_dump(struct net *net, struct tcf_proto *tp, void *fh, tp, fh, skb, t, p, r);pr_debug ("p->perfect %p p->h %p\n" , p->perfect, p->h); - nest =nla_nest_start (skb,TCA_OPTIONS ); + nest =nla_nest_start_noflag (skb,TCA_OPTIONS );if (nest ==NULL ) goto nla_put_failure;
net/sched/cls_u32.c +1 -1
@@ -1294,7 +1294,7 @@ static int u32_dump(struct net *net, struct tcf_proto *tp, void *fh, t->tcm_handle = n->handle; - nest =nla_nest_start (skb,TCA_OPTIONS ); + nest =nla_nest_start_noflag (skb,TCA_OPTIONS );if (nest ==NULL ) goto nla_put_failure;
net/sched/ematch.c +2 -2
@@ -440,14 +440,14 @@ int tcf_em_tree_dump(struct sk_buff *skb, struct tcf_ematch_tree *tree, int tlv)struct nlattr *top_start;struct nlattr *list_start; - top_start =nla_nest_start (skb, tlv); + top_start =nla_nest_start_noflag (skb, tlv);if (top_start ==NULL ) goto nla_put_failure;if (nla_put (skb,TCA_EMATCH_TREE_HDR ,sizeof (tree->hdr), &tree->hdr)) goto nla_put_failure; - list_start =nla_nest_start (skb,TCA_EMATCH_TREE_LIST ); + list_start =nla_nest_start_noflag (skb,TCA_EMATCH_TREE_LIST );if (list_start ==NULL ) goto nla_put_failure;
net/sched/sch_api.c +1 -1
@@ -542,7 +542,7 @@ static int qdisc_dump_stab(struct sk_buff *skb, struct qdisc_size_table *stab) {struct nlattr *nest; - nest =nla_nest_start (skb,TCA_STAB ); + nest =nla_nest_start_noflag (skb,TCA_STAB );if (nest ==NULL ) goto nla_put_failure;if (nla_put (skb,TCA_STAB_BASE ,sizeof (stab->szopts), &stab->szopts))
net/sched/sch_atm.c +1 -1
@@ -609,7 +609,7 @@ static int atm_tc_dump_class(struct Qdisc *sch, unsigned long cl, tcm->tcm_handle = flow->common.classid; tcm->tcm_info = flow->q->handle; - nest =nla_nest_start (skb,TCA_OPTIONS ); + nest =nla_nest_start_noflag (skb,TCA_OPTIONS );if (nest ==NULL ) goto nla_put_failure;
net/sched/sch_cake.c +5 -5
@@ -2735,7 +2735,7 @@ static int cake_dump(struct Qdisc *sch, struct sk_buff *skb)struct cake_sched_data *q =qdisc_priv (sch);struct nlattr *opts; - opts =nla_nest_start (skb,TCA_OPTIONS ); + opts =nla_nest_start_noflag (skb,TCA_OPTIONS );if (!opts) goto nla_put_failure;
@@ -2806,7 +2806,7 @@ static int cake_dump(struct Qdisc *sch, struct sk_buff *skb)static int cake_dump_stats (struct Qdisc *sch,struct gnet_dump *d) { -struct nlattr *stats =nla_nest_start (d->skb,TCA_STATS_APP ); +struct nlattr *stats =nla_nest_start_noflag (d->skb,TCA_STATS_APP );struct cake_sched_data *q =qdisc_priv (sch);struct nlattr *tstats, *ts;int i;
@@ -2836,7 +2836,7 @@ static int cake_dump_stats(struct Qdisc *sch, struct gnet_dump *d)#undef PUT_STAT_U32#undef PUT_STAT_U64 - tstats =nla_nest_start (d->skb,TCA_CAKE_STATS_TIN_STATS ); + tstats =nla_nest_start_noflag (d->skb,TCA_CAKE_STATS_TIN_STATS );if (!tstats) goto nla_put_failure;
@@ -2853,7 +2853,7 @@ static int cake_dump_stats(struct Qdisc *sch, struct gnet_dump *d)for (i =0 ; i < q->tin_cnt; i++) {struct cake_tin_data *b = &q->tins[q->tin_order[i]]; - ts =nla_nest_start (d->skb, i +1 ); + ts =nla_nest_start_noflag (d->skb, i +1 );if (!ts) goto nla_put_failure;
@@ -2973,7 +2973,7 @@ static int cake_dump_class_stats(struct Qdisc *sch, unsigned long cl,if (flow) {ktime_t now =ktime_get (); - stats =nla_nest_start (d->skb,TCA_STATS_APP ); + stats =nla_nest_start_noflag (d->skb,TCA_STATS_APP );if (!stats)return -1 ;
net/sched/sch_cbq.c +2 -2
@@ -1305,7 +1305,7 @@ static int cbq_dump(struct Qdisc *sch, struct sk_buff *skb)struct cbq_sched_data *q =qdisc_priv (sch);struct nlattr *nest; - nest =nla_nest_start (skb,TCA_OPTIONS ); + nest =nla_nest_start_noflag (skb,TCA_OPTIONS );if (nest ==NULL ) goto nla_put_failure;if (cbq_dump_attr (skb, &q->link) <0 )
@@ -1340,7 +1340,7 @@ cbq_dump_class(struct Qdisc *sch, unsigned long arg, tcm->tcm_handle = cl->common.classid; tcm->tcm_info = cl->q->handle; - nest =nla_nest_start (skb,TCA_OPTIONS ); + nest =nla_nest_start_noflag (skb,TCA_OPTIONS );if (nest ==NULL ) goto nla_put_failure;if (cbq_dump_attr (skb, cl) <0 )
net/sched/sch_cbs.c +1 -1
@@ -449,7 +449,7 @@ static int cbs_dump(struct Qdisc *sch, struct sk_buff *skb)struct tc_cbs_qopt opt = { };struct nlattr *nest; - nest =nla_nest_start (skb,TCA_OPTIONS ); + nest =nla_nest_start_noflag (skb,TCA_OPTIONS );if (!nest) goto nla_put_failure;
net/sched/sch_choke.c +1 -1
@@ -452,7 +452,7 @@ static int choke_dump(struct Qdisc *sch, struct sk_buff *skb) .Scell_log = q->parms.Scell_log, }; - opts =nla_nest_start (skb,TCA_OPTIONS ); + opts =nla_nest_start_noflag (skb,TCA_OPTIONS );if (opts ==NULL ) goto nla_put_failure;
net/sched/sch_codel.c +1 -1
@@ -217,7 +217,7 @@ static int codel_dump(struct Qdisc *sch, struct sk_buff *skb)struct codel_sched_data *q =qdisc_priv (sch);struct nlattr *opts; - opts =nla_nest_start (skb,TCA_OPTIONS ); + opts =nla_nest_start_noflag (skb,TCA_OPTIONS );if (opts ==NULL ) goto nla_put_failure;
net/sched/sch_drr.c +1 -1
@@ -244,7 +244,7 @@ static int drr_dump_class(struct Qdisc *sch, unsigned long arg, tcm->tcm_handle = cl->common.classid; tcm->tcm_info = cl->qdisc->handle; - nest =nla_nest_start (skb,TCA_OPTIONS ); + nest =nla_nest_start_noflag (skb,TCA_OPTIONS );if (nest ==NULL ) goto nla_put_failure;if (nla_put_u32 (skb,TCA_DRR_QUANTUM , cl->quantum))
net/sched/sch_dsmark.c +2 -2
@@ -432,7 +432,7 @@ static int dsmark_dump_class(struct Qdisc *sch, unsigned long cl, tcm->tcm_handle =TC_H_MAKE (TC_H_MAJ (sch->handle), cl -1 ); tcm->tcm_info = p->q->handle; - opts =nla_nest_start (skb,TCA_OPTIONS ); + opts =nla_nest_start_noflag (skb,TCA_OPTIONS );if (opts ==NULL ) goto nla_put_failure; if (nla_put_u8(skb, TCA_DSMARK_MASK, p->mv[cl - 1].mask) ||
@@ -451,7 +451,7 @@ static int dsmark_dump(struct Qdisc *sch, struct sk_buff *skb)struct dsmark_qdisc_data *p =qdisc_priv (sch);struct nlattr *opts =NULL ; - opts =nla_nest_start (skb,TCA_OPTIONS ); + opts =nla_nest_start_noflag (skb,TCA_OPTIONS );if (opts ==NULL ) goto nla_put_failure;if (nla_put_u16 (skb,TCA_DSMARK_INDICES , p->indices))
net/sched/sch_etf.c +1 -1
@@ -460,7 +460,7 @@ static int etf_dump(struct Qdisc *sch, struct sk_buff *skb)struct tc_etf_qopt opt = { };struct nlattr *nest; - nest =nla_nest_start (skb,TCA_OPTIONS ); + nest =nla_nest_start_noflag (skb,TCA_OPTIONS );if (!nest) goto nla_put_failure;
net/sched/sch_fq.c +1 -1
@@ -823,7 +823,7 @@ static int fq_dump(struct Qdisc *sch, struct sk_buff *skb)u64 ce_threshold = q->ce_threshold;struct nlattr *opts; - opts =nla_nest_start (skb,TCA_OPTIONS ); + opts =nla_nest_start_noflag (skb,TCA_OPTIONS );if (opts ==NULL ) goto nla_put_failure;
net/sched/sch_fq_codel.c +1 -1
@@ -527,7 +527,7 @@ static int fq_codel_dump(struct Qdisc *sch, struct sk_buff *skb)struct fq_codel_sched_data *q =qdisc_priv (sch);struct nlattr *opts; - opts =nla_nest_start (skb,TCA_OPTIONS ); + opts =nla_nest_start_noflag (skb,TCA_OPTIONS );if (opts ==NULL ) goto nla_put_failure;
net/sched/sch_gred.c +4 -4
@@ -772,7 +772,7 @@ static int gred_dump(struct Qdisc *sch, struct sk_buff *skb)if (gred_offload_dump_stats (sch)) goto nla_put_failure; - opts =nla_nest_start (skb,TCA_OPTIONS ); + opts =nla_nest_start_noflag (skb,TCA_OPTIONS );if (opts ==NULL ) goto nla_put_failure;if (nla_put (skb,TCA_GRED_DPS ,sizeof (sopt), &sopt))
@@ -790,7 +790,7 @@ static int gred_dump(struct Qdisc *sch, struct sk_buff *skb) goto nla_put_failure;/* Old style all-in-one dump of VQs */ - parms =nla_nest_start (skb,TCA_GRED_PARMS ); + parms =nla_nest_start_noflag (skb,TCA_GRED_PARMS );if (parms ==NULL ) goto nla_put_failure;
@@ -841,7 +841,7 @@ static int gred_dump(struct Qdisc *sch, struct sk_buff *skb)nla_nest_end (skb, parms);/* Dump the VQs again, in more structured way */ - vqs =nla_nest_start (skb,TCA_GRED_VQ_LIST ); + vqs =nla_nest_start_noflag (skb,TCA_GRED_VQ_LIST );if (!vqs) goto nla_put_failure;
@@ -852,7 +852,7 @@ static int gred_dump(struct Qdisc *sch, struct sk_buff *skb)if (!q)continue ; - vq =nla_nest_start (skb,TCA_GRED_VQ_ENTRY ); + vq =nla_nest_start_noflag (skb,TCA_GRED_VQ_ENTRY );if (!vq) goto nla_put_failure;
net/sched/sch_hfsc.c +1 -1
@@ -1300,7 +1300,7 @@ hfsc_dump_class(struct Qdisc *sch, unsigned long arg, struct sk_buff *skb,if (cl->level ==0 ) tcm->tcm_info = cl->qdisc->handle; - nest =nla_nest_start (skb,TCA_OPTIONS ); + nest =nla_nest_start_noflag (skb,TCA_OPTIONS );if (nest ==NULL ) goto nla_put_failure;if (hfsc_dump_curves (skb, cl) <0 )
net/sched/sch_hhf.c +1 -1
@@ -654,7 +654,7 @@ static int hhf_dump(struct Qdisc *sch, struct sk_buff *skb)struct hhf_sched_data *q =qdisc_priv (sch);struct nlattr *opts; - opts =nla_nest_start (skb,TCA_OPTIONS ); + opts =nla_nest_start_noflag (skb,TCA_OPTIONS );if (opts ==NULL ) goto nla_put_failure;
net/sched/sch_htb.c +2 -2
@@ -1057,7 +1057,7 @@ static int htb_dump(struct Qdisc *sch, struct sk_buff *skb) gopt.defcls = q->defcls; gopt.debug =0 ; - nest =nla_nest_start (skb,TCA_OPTIONS ); + nest =nla_nest_start_noflag (skb,TCA_OPTIONS );if (nest ==NULL ) goto nla_put_failure; if (nla_put(skb, TCA_HTB_INIT, sizeof(gopt), &gopt) ||
@@ -1086,7 +1086,7 @@ static int htb_dump_class(struct Qdisc *sch, unsigned long arg,if (!cl->level && cl->leaf.q) tcm->tcm_info = cl->leaf.q->handle; - nest =nla_nest_start (skb,TCA_OPTIONS ); + nest =nla_nest_start_noflag (skb,TCA_OPTIONS );if (nest ==NULL ) goto nla_put_failure;
net/sched/sch_ingress.c +1 -1
@@ -106,7 +106,7 @@ static int ingress_dump(struct Qdisc *sch, struct sk_buff *skb) {struct nlattr *nest; - nest =nla_nest_start (skb,TCA_OPTIONS ); + nest =nla_nest_start_noflag (skb,TCA_OPTIONS );if (nest ==NULL ) goto nla_put_failure;
net/sched/sch_mqprio.c +2 -2
@@ -349,7 +349,7 @@ static int dump_rates(struct mqprio_sched *priv,int i;if (priv->flags &TC_MQPRIO_F_MIN_RATE ) { - nest =nla_nest_start (skb,TCA_MQPRIO_MIN_RATE64 ); + nest =nla_nest_start_noflag (skb,TCA_MQPRIO_MIN_RATE64 );if (!nest) goto nla_put_failure;
@@ -363,7 +363,7 @@ static int dump_rates(struct mqprio_sched *priv, }if (priv->flags &TC_MQPRIO_F_MAX_RATE ) { - nest =nla_nest_start (skb,TCA_MQPRIO_MAX_RATE64 ); + nest =nla_nest_start_noflag (skb,TCA_MQPRIO_MAX_RATE64 );if (!nest) goto nla_put_failure;
net/sched/sch_netem.c +1 -1
@@ -1079,7 +1079,7 @@ static int dump_loss_model(const struct netem_sched_data *q, {struct nlattr *nest; - nest =nla_nest_start (skb,TCA_NETEM_LOSS ); + nest =nla_nest_start_noflag (skb,TCA_NETEM_LOSS );if (nest ==NULL ) goto nla_put_failure;
net/sched/sch_pie.c +1 -1
@@ -491,7 +491,7 @@ static int pie_dump(struct Qdisc *sch, struct sk_buff *skb)struct pie_sched_data *q =qdisc_priv (sch);struct nlattr *opts; - opts =nla_nest_start (skb,TCA_OPTIONS ); + opts =nla_nest_start_noflag (skb,TCA_OPTIONS );if (!opts) goto nla_put_failure;
net/sched/sch_qfq.c +1 -1
@@ -619,7 +619,7 @@ static int qfq_dump_class(struct Qdisc *sch, unsigned long arg, tcm->tcm_handle = cl->common.classid; tcm->tcm_info = cl->qdisc->handle; - nest =nla_nest_start (skb,TCA_OPTIONS ); + nest =nla_nest_start_noflag (skb,TCA_OPTIONS );if (nest ==NULL ) goto nla_put_failure; if (nla_put_u32(skb, TCA_QFQ_WEIGHT, cl->agg->class_weight) ||
net/sched/sch_red.c +1 -1
@@ -318,7 +318,7 @@ static int red_dump(struct Qdisc *sch, struct sk_buff *skb)if (err) goto nla_put_failure; - opts =nla_nest_start (skb,TCA_OPTIONS ); + opts =nla_nest_start_noflag (skb,TCA_OPTIONS );if (opts ==NULL ) goto nla_put_failure; if (nla_put(skb, TCA_RED_PARMS, sizeof(opt), &opt) ||
net/sched/sch_sfb.c +1 -1
@@ -580,7 +580,7 @@ static int sfb_dump(struct Qdisc *sch, struct sk_buff *skb) }; sch->qstats.backlog = q->qdisc->qstats.backlog; - opts =nla_nest_start (skb,TCA_OPTIONS ); + opts =nla_nest_start_noflag (skb,TCA_OPTIONS );if (opts ==NULL ) goto nla_put_failure;if (nla_put (skb,TCA_SFB_PARMS ,sizeof (opt), &opt))
net/sched/sch_taprio.c +4 -3
@@ -841,7 +841,7 @@ static int dump_entry(struct sk_buff *msg, {struct nlattr *item; - item =nla_nest_start (msg,TCA_TAPRIO_SCHED_ENTRY ); + item =nla_nest_start_noflag (msg,TCA_TAPRIO_SCHED_ENTRY );if (!item)return -ENOSPC ;
@@ -883,7 +883,7 @@ static int taprio_dump(struct Qdisc *sch, struct sk_buff *skb) opt.offset[i] = dev->tc_to_txq[i].offset; } - nest =nla_nest_start (skb,TCA_OPTIONS ); + nest =nla_nest_start_noflag (skb,TCA_OPTIONS );if (!nest)return -ENOSPC ;
@@ -897,7 +897,8 @@ static int taprio_dump(struct Qdisc *sch, struct sk_buff *skb)if (nla_put_s32 (skb,TCA_TAPRIO_ATTR_SCHED_CLOCKID , q->clockid)) goto options_error; - entry_list =nla_nest_start (skb,TCA_TAPRIO_ATTR_SCHED_ENTRY_LIST ); + entry_list =nla_nest_start_noflag (skb, +TCA_TAPRIO_ATTR_SCHED_ENTRY_LIST );if (!entry_list) goto options_error;
net/sched/sch_tbf.c +1 -1
@@ -448,7 +448,7 @@ static int tbf_dump(struct Qdisc *sch, struct sk_buff *skb)struct tc_tbf_qopt opt; sch->qstats.backlog = q->qdisc->qstats.backlog; - nest =nla_nest_start (skb,TCA_OPTIONS ); + nest =nla_nest_start_noflag (skb,TCA_OPTIONS );if (nest ==NULL ) goto nla_put_failure;
net/tipc/bearer.c +4 -4
@@ -687,14 +687,14 @@ static int __tipc_nl_add_bearer(struct tipc_nl_msg *msg,if (!hdr)return -EMSGSIZE ; - attrs =nla_nest_start (msg->skb,TIPC_NLA_BEARER ); + attrs =nla_nest_start_noflag (msg->skb,TIPC_NLA_BEARER );if (!attrs) goto msg_full;if (nla_put_string (msg->skb,TIPC_NLA_BEARER_NAME , bearer->name)) goto attr_msg_full; - prop =nla_nest_start (msg->skb,TIPC_NLA_BEARER_PROP ); + prop =nla_nest_start_noflag (msg->skb,TIPC_NLA_BEARER_PROP );if (!prop) goto prop_msg_full;if (nla_put_u32 (msg->skb,TIPC_NLA_PROP_PRIO , bearer->priority))
@@ -1033,14 +1033,14 @@ static int __tipc_nl_add_media(struct tipc_nl_msg *msg,if (!hdr)return -EMSGSIZE ; - attrs =nla_nest_start (msg->skb,TIPC_NLA_MEDIA ); + attrs =nla_nest_start_noflag (msg->skb,TIPC_NLA_MEDIA );if (!attrs) goto msg_full;if (nla_put_string (msg->skb,TIPC_NLA_MEDIA_NAME , media->name)) goto attr_msg_full; - prop =nla_nest_start (msg->skb,TIPC_NLA_MEDIA_PROP ); + prop =nla_nest_start_noflag (msg->skb,TIPC_NLA_MEDIA_PROP );if (!prop) goto prop_msg_full;if (nla_put_u32 (msg->skb,TIPC_NLA_PROP_PRIO , media->priority))
net/tipc/group.c +1 -1
@@ -917,7 +917,7 @@ void tipc_group_member_evt(struct tipc_group *grp,int tipc_group_fill_sock_diag (struct tipc_group *grp,struct sk_buff *skb) { -struct nlattr *group =nla_nest_start (skb,TIPC_NLA_SOCK_GROUP ); +struct nlattr *group =nla_nest_start_noflag (skb,TIPC_NLA_SOCK_GROUP );if (!group)return -EMSGSIZE ;
net/tipc/link.c +6 -6
@@ -2228,7 +2228,7 @@ static int __tipc_nl_add_stats(struct sk_buff *skb, struct tipc_stats *s) (s->accu_queue_sz / s->queue_sz_counts) : 0} }; - stats =nla_nest_start (skb,TIPC_NLA_LINK_STATS ); + stats =nla_nest_start_noflag (skb,TIPC_NLA_LINK_STATS );if (!stats)return -EMSGSIZE ;
@@ -2260,7 +2260,7 @@ int __tipc_nl_add_link(struct net *net, struct tipc_nl_msg *msg,if (!hdr)return -EMSGSIZE ; - attrs =nla_nest_start (msg->skb,TIPC_NLA_LINK ); + attrs =nla_nest_start_noflag (msg->skb,TIPC_NLA_LINK );if (!attrs) goto msg_full;
@@ -2282,7 +2282,7 @@ int __tipc_nl_add_link(struct net *net, struct tipc_nl_msg *msg,if (nla_put_flag (msg->skb,TIPC_NLA_LINK_ACTIVE )) goto attr_msg_full; - prop =nla_nest_start (msg->skb,TIPC_NLA_LINK_PROP ); + prop =nla_nest_start_noflag (msg->skb,TIPC_NLA_LINK_PROP );if (!prop) goto attr_msg_full;if (nla_put_u32 (msg->skb,TIPC_NLA_PROP_PRIO , link->priority))
@@ -2349,7 +2349,7 @@ static int __tipc_nl_add_bc_link_stat(struct sk_buff *skb, (stats->accu_queue_sz / stats->queue_sz_counts) : 0} }; - nest =nla_nest_start (skb,TIPC_NLA_LINK_STATS ); + nest =nla_nest_start_noflag (skb,TIPC_NLA_LINK_STATS );if (!nest)return -EMSGSIZE ;
@@ -2389,7 +2389,7 @@ int tipc_nl_add_bc_link(struct net *net, struct tipc_nl_msg *msg)return -EMSGSIZE ; } - attrs =nla_nest_start (msg->skb,TIPC_NLA_LINK ); + attrs =nla_nest_start_noflag (msg->skb,TIPC_NLA_LINK );if (!attrs) goto msg_full;
@@ -2406,7 +2406,7 @@ int tipc_nl_add_bc_link(struct net *net, struct tipc_nl_msg *msg)if (nla_put_u32 (msg->skb,TIPC_NLA_LINK_TX ,0 )) goto attr_msg_full; - prop =nla_nest_start (msg->skb,TIPC_NLA_LINK_PROP ); + prop =nla_nest_start_noflag (msg->skb,TIPC_NLA_LINK_PROP );if (!prop) goto attr_msg_full;if (nla_put_u32 (msg->skb,TIPC_NLA_PROP_WIN , bcl->window))
net/tipc/monitor.c +2 -2
@@ -696,7 +696,7 @@ static int __tipc_nl_add_monitor_peer(struct tipc_peer *peer,if (!hdr)return -EMSGSIZE ; - attrs =nla_nest_start (msg->skb,TIPC_NLA_MON_PEER ); + attrs =nla_nest_start_noflag (msg->skb,TIPC_NLA_MON_PEER );if (!attrs) goto msg_full;
@@ -785,7 +785,7 @@ int __tipc_nl_add_monitor(struct net *net, struct tipc_nl_msg *msg,if (!hdr)return -EMSGSIZE ; - attrs =nla_nest_start (msg->skb,TIPC_NLA_MON ); + attrs =nla_nest_start_noflag (msg->skb,TIPC_NLA_MON );if (!attrs) goto msg_full;
net/tipc/name_table.c +2 -2
@@ -829,11 +829,11 @@ static int __tipc_nl_add_nametable_publ(struct tipc_nl_msg *msg,if (!hdr)return -EMSGSIZE ; - attrs =nla_nest_start (msg->skb,TIPC_NLA_NAME_TABLE ); + attrs =nla_nest_start_noflag (msg->skb,TIPC_NLA_NAME_TABLE );if (!attrs) goto msg_full; - b =nla_nest_start (msg->skb,TIPC_NLA_NAME_TABLE_PUBL ); + b =nla_nest_start_noflag (msg->skb,TIPC_NLA_NAME_TABLE_PUBL );if (!b) goto attr_msg_full;
net/tipc/net.c +1 -1
@@ -187,7 +187,7 @@ static int __tipc_nl_add_net(struct net *net, struct tipc_nl_msg *msg)if (!hdr)return -EMSGSIZE ; - attrs =nla_nest_start (msg->skb,TIPC_NLA_NET ); + attrs =nla_nest_start_noflag (msg->skb,TIPC_NLA_NET );if (!attrs) goto msg_full;
net/tipc/netlink_compat.c +12 -12
@@ -399,7 +399,7 @@ static int tipc_nl_compat_bearer_enable(struct tipc_nl_compat_cmd_doit *cmd, b = (struct tipc_bearer_config *)TLV_DATA (msg->req); - bearer =nla_nest_start (skb,TIPC_NLA_BEARER ); + bearer =nla_nest_start_noflag (skb,TIPC_NLA_BEARER );if (!bearer)return -EMSGSIZE ;
@@ -419,7 +419,7 @@ static int tipc_nl_compat_bearer_enable(struct tipc_nl_compat_cmd_doit *cmd,return -EMSGSIZE ;if (ntohl (b->priority) <=TIPC_MAX_LINK_PRI ) { - prop =nla_nest_start (skb,TIPC_NLA_BEARER_PROP ); + prop =nla_nest_start_noflag (skb,TIPC_NLA_BEARER_PROP );if (!prop)return -EMSGSIZE ;if (nla_put_u32 (skb,TIPC_NLA_PROP_PRIO ,ntohl (b->priority)))
@@ -441,7 +441,7 @@ static int tipc_nl_compat_bearer_disable(struct tipc_nl_compat_cmd_doit *cmd, name = (char *)TLV_DATA (msg->req); - bearer =nla_nest_start (skb,TIPC_NLA_BEARER ); + bearer =nla_nest_start_noflag (skb,TIPC_NLA_BEARER );if (!bearer)return -EMSGSIZE ;
@@ -685,7 +685,7 @@ static int tipc_nl_compat_media_set(struct sk_buff *skb, lc = (struct tipc_link_config *)TLV_DATA (msg->req); - media =nla_nest_start (skb,TIPC_NLA_MEDIA ); + media =nla_nest_start_noflag (skb,TIPC_NLA_MEDIA );if (!media)return -EMSGSIZE ;
@@ -696,7 +696,7 @@ static int tipc_nl_compat_media_set(struct sk_buff *skb,if (nla_put_string (skb,TIPC_NLA_MEDIA_NAME , lc->name))return -EMSGSIZE ; - prop =nla_nest_start (skb,TIPC_NLA_MEDIA_PROP ); + prop =nla_nest_start_noflag (skb,TIPC_NLA_MEDIA_PROP );if (!prop)return -EMSGSIZE ;
@@ -717,7 +717,7 @@ static int tipc_nl_compat_bearer_set(struct sk_buff *skb, lc = (struct tipc_link_config *)TLV_DATA (msg->req); - bearer =nla_nest_start (skb,TIPC_NLA_BEARER ); + bearer =nla_nest_start_noflag (skb,TIPC_NLA_BEARER );if (!bearer)return -EMSGSIZE ;
@@ -728,7 +728,7 @@ static int tipc_nl_compat_bearer_set(struct sk_buff *skb,if (nla_put_string (skb,TIPC_NLA_BEARER_NAME , lc->name))return -EMSGSIZE ; - prop =nla_nest_start (skb,TIPC_NLA_BEARER_PROP ); + prop =nla_nest_start_noflag (skb,TIPC_NLA_BEARER_PROP );if (!prop)return -EMSGSIZE ;
@@ -748,14 +748,14 @@ static int __tipc_nl_compat_link_set(struct sk_buff *skb, lc = (struct tipc_link_config *)TLV_DATA (msg->req); - link =nla_nest_start (skb,TIPC_NLA_LINK ); + link =nla_nest_start_noflag (skb,TIPC_NLA_LINK );if (!link)return -EMSGSIZE ;if (nla_put_string (skb,TIPC_NLA_LINK_NAME , lc->name))return -EMSGSIZE ; - prop =nla_nest_start (skb,TIPC_NLA_LINK_PROP ); + prop =nla_nest_start_noflag (skb,TIPC_NLA_LINK_PROP );if (!prop)return -EMSGSIZE ;
@@ -811,7 +811,7 @@ static int tipc_nl_compat_link_reset_stats(struct tipc_nl_compat_cmd_doit *cmd, name = (char *)TLV_DATA (msg->req); - link =nla_nest_start (skb,TIPC_NLA_LINK ); + link =nla_nest_start_noflag (skb,TIPC_NLA_LINK );if (!link)return -EMSGSIZE ;
@@ -973,7 +973,7 @@ static int tipc_nl_compat_publ_dump(struct tipc_nl_compat_msg *msg, u32 sock)return -EMSGSIZE ; } - nest =nla_nest_start (args,TIPC_NLA_SOCK ); + nest =nla_nest_start_noflag (args,TIPC_NLA_SOCK );if (!nest) {kfree_skb (args);return -EMSGSIZE ;
@@ -1100,7 +1100,7 @@ static int tipc_nl_compat_net_set(struct tipc_nl_compat_cmd_doit *cmd, val =ntohl (*(__be32 *)TLV_DATA (msg->req)); - net =nla_nest_start (skb,TIPC_NLA_NET ); + net =nla_nest_start_noflag (skb,TIPC_NLA_NET );if (!net)return -EMSGSIZE ;
net/tipc/node.c +2 -2
@@ -1359,7 +1359,7 @@ static int __tipc_nl_add_node(struct tipc_nl_msg *msg, struct tipc_node *node)if (!hdr)return -EMSGSIZE ; - attrs =nla_nest_start (msg->skb,TIPC_NLA_NODE ); + attrs =nla_nest_start_noflag (msg->skb,TIPC_NLA_NODE );if (!attrs) goto msg_full;
@@ -2353,7 +2353,7 @@ static int __tipc_nl_add_monitor_prop(struct net *net, struct tipc_nl_msg *msg)if (!hdr)return -EMSGSIZE ; - attrs =nla_nest_start (msg->skb,TIPC_NLA_MON ); + attrs =nla_nest_start_noflag (msg->skb,TIPC_NLA_MON );if (!attrs) goto msg_full;
net/tipc/socket.c +5 -5
@@ -3273,7 +3273,7 @@ static int __tipc_nl_add_sk_con(struct sk_buff *skb, struct tipc_sock *tsk) peer_node =tsk_peer_node (tsk); peer_port =tsk_peer_port (tsk); - nest =nla_nest_start (skb,TIPC_NLA_SOCK_CON ); + nest =nla_nest_start_noflag (skb,TIPC_NLA_SOCK_CON );if (!nest)return -EMSGSIZE ;
@@ -3332,7 +3332,7 @@ static int __tipc_nl_add_sk(struct sk_buff *skb, struct netlink_callback *cb,if (!hdr) goto msg_cancel; - attrs =nla_nest_start (skb,TIPC_NLA_SOCK ); + attrs =nla_nest_start_noflag (skb,TIPC_NLA_SOCK );if (!attrs) goto genlmsg_cancel;
@@ -3437,7 +3437,7 @@ int tipc_sk_fill_sock_diag(struct sk_buff *skb, struct netlink_callback *cb,if (!(sk_filter_state & (1 << sk->sk_state)))return 0 ; - attrs =nla_nest_start (skb,TIPC_NLA_SOCK ); + attrs =nla_nest_start_noflag (skb,TIPC_NLA_SOCK );if (!attrs) goto msg_cancel;
@@ -3455,7 +3455,7 @@ int tipc_sk_fill_sock_diag(struct sk_buff *skb, struct netlink_callback *cb, TIPC_NLA_SOCK_PAD)) goto attr_msg_cancel; - stat =nla_nest_start (skb,TIPC_NLA_SOCK_STAT ); + stat =nla_nest_start_noflag (skb,TIPC_NLA_SOCK_STAT );if (!stat) goto attr_msg_cancel;
@@ -3512,7 +3512,7 @@ static int __tipc_nl_add_sk_publ(struct sk_buff *skb,if (!hdr) goto msg_cancel; - attrs =nla_nest_start (skb,TIPC_NLA_PUBL ); + attrs =nla_nest_start_noflag (skb,TIPC_NLA_PUBL );if (!attrs) goto genlmsg_cancel;
net/tipc/udp_media.c +1 -1
@@ -524,7 +524,7 @@ int tipc_udp_nl_add_bearer_data(struct tipc_nl_msg *msg, struct tipc_bearer *b)if (!ub)return -ENODEV ; - nest =nla_nest_start (msg->skb,TIPC_NLA_BEARER_UDP_OPTS ); + nest =nla_nest_start_noflag (msg->skb,TIPC_NLA_BEARER_UDP_OPTS );if (!nest) goto msg_full;
net/wireless/nl80211.c +106 -86
55 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.21.0
Part of the diff is not shown here. View the raw message.
Re: [PATCH net-next 1/3] netlink: make nla_nest_start() add NLA_F_NESTED flag
Quoted 25 lines · Fri, Apr 26, 2019 at 11:13:06AM CEST, [email protected] wrote:
Even if the
NLA_F_NESTEDflag was introduced more than 11 years ago, most netlink based interfaces (including recently added ones) are still not setting it in kernel generated messages. Without the flag, message parsers not aware of attribute semantics (e.g. wireshark dissector or libmnl'smnl_nlmsg_fprintf()) cannot recognize nested attributes and won't display the structure of their contents.Unfortunately we cannot just add the flag everywhere as there may be userspace applications which check
nlattr::nla_typedirectly rather than through a helper masking out the flags. Therefore the patch renamesnla_nest_start()tonla_nest_start_noflag()and introducesnla_nest_start()as a wrapper addingNLA_F_NESTED. The calls which addNLA_F_NESTEDmanually are rewritten to usenla_nest_start().Except for changes in
include/net/netlink.h, the patch was generated using this semantic patch:@@ expression E1, E2; @@
(quoted diff) +1
-1-nla_nest_start(E1, E2) +nla_nest_start_noflag(E1, E2)@@ expression E1, E2; @@
(quoted diff) +1
-1-nla_nest_start_noflag(E1, E2 | NLA_F_NESTED) +nla_nest_start(E1, E2)
Quoted 1 line
Signed-off-by Michal Kubecek <[email protected]>
Re: [PATCH net-next 1/3] netlink: make nla_nest_start() add NLA_F_NESTED flag
In reply to Michal KubecekQuoted 25 lines · Michal Kubecek
Even if the
NLA_F_NESTEDflag was introduced more than 11 years ago, most netlink based interfaces (including recently added ones) are still not setting it in kernel generated messages. Without the flag, message parsers not aware of attribute semantics (e.g. wireshark dissector or libmnl'smnl_nlmsg_fprintf()) cannot recognize nested attributes and won't display the structure of their contents.Unfortunately we cannot just add the flag everywhere as there may be userspace applications which check
nlattr::nla_typedirectly rather than through a helper masking out the flags. Therefore the patch renamesnla_nest_start()tonla_nest_start_noflag()and introducesnla_nest_start()as a wrapper addingNLA_F_NESTED. The calls which addNLA_F_NESTEDmanually are rewritten to usenla_nest_start().Except for changes in
include/net/netlink.h, the patch was generated using this semantic patch:@@ expression E1, E2; @@
(quoted diff) +1
-1-nla_nest_start(E1, E2) +nla_nest_start_noflag(E1, E2)@@ expression E1, E2; @@
(quoted diff) +1
-1-nla_nest_start_noflag(E1, E2 | NLA_F_NESTED) +nla_nest_start(E1, E2)
Quoted 2 lines
Signed-off-by Michal Kubecek <[email protected]>---
PATCH 2/3 ipset: drop ipset_nest_start() and ipset_nest_end()
In reply to Michal KubecekAfter the previous commit, both ipset_nest_start() and ipset_nest_end() are just aliases for nla_nest_start() and nla_nest_end() so that there is no need to keep them.
--- include/linux/netfilter/ipset/ip_set.h | 11 ++++------- net/netfilter/ipset/ip_set_bitmap_gen.h | 14 +++++++------- net/netfilter/ipset/ip_set_hash_gen.h | 14 +++++++------- net/netfilter/ipset/ip_set_list_set.c | 14 +++++++------- 4 files changed, 25 insertions(+), 28 deletions(-)
include/linux/netfilter/ipset/ip_set.h +4 -7
@@ -401,33 +401,30 @@ ip_set_get_h16(const struct nlattr *attr)return ntohs (nla_get_be16 (attr)); } -#define ipset_nest_start (skb, attr) nla_nest_start(skb, attr) -#define ipset_nest_end (skb, start) nla_nest_end(skb, start) -static inline int nla_put_ipaddr4 (struct sk_buff *skb,int type,__be32 ipaddr) { -struct nlattr *__nested =ipset_nest_start (skb, type); +struct nlattr *__nested =nla_nest_start (skb, type);int ret;if (!__nested)return -EMSGSIZE ; ret =nla_put_in_addr (skb,IPSET_ATTR_IPADDR_IPV4 , ipaddr);if (!ret) -ipset_nest_end (skb, __nested); +nla_nest_end (skb, __nested);return ret; }static inline int nla_put_ipaddr6 (struct sk_buff *skb,int type,const struct in6_addr *ipaddrptr) { -struct nlattr *__nested =ipset_nest_start (skb, type); +struct nlattr *__nested =nla_nest_start (skb, type);int ret;if (!__nested)return -EMSGSIZE ; ret =nla_put_in6_addr (skb,IPSET_ATTR_IPADDR_IPV6 , ipaddrptr);if (!ret) -ipset_nest_end (skb, __nested); +nla_nest_end (skb, __nested);return ret; }
net/netfilter/ipset/ip_set_bitmap_gen.h +7 -7
@@ -99,7 +99,7 @@ mtype_head(struct ip_set *set, struct sk_buff *skb)struct nlattr *nested;size_t memsize =mtype_memsize (map, set->dsize) + set->ext_size; - nested =ipset_nest_start (skb,IPSET_ATTR_DATA ); + nested =nla_nest_start (skb,IPSET_ATTR_DATA );if (!nested) goto nla_put_failure; if (mtype_do_head(skb, map) ||
@@ -109,7 +109,7 @@ mtype_head(struct ip_set *set, struct sk_buff *skb) goto nla_put_failure;if (unlikely (ip_set_put_flags (skb, set))) goto nla_put_failure; -ipset_nest_end (skb, nested); +nla_nest_end (skb, nested);return 0 ; nla_put_failure:
@@ -213,7 +213,7 @@ mtype_list(const struct ip_set *set,u32 id, first = cb->args[IPSET_CB_ARG0 ];int ret =0 ; - adt =ipset_nest_start (skb,IPSET_ATTR_ADT ); + adt =nla_nest_start (skb,IPSET_ATTR_ADT );if (!adt)return -EMSGSIZE ;/* Extensions may be replaced */
@@ -230,7 +230,7 @@ mtype_list(const struct ip_set *set,#endif ip_set_timeout_expired(ext_timeout(x, set)))) continue; - nested =ipset_nest_start (skb,IPSET_ATTR_DATA ); + nested =nla_nest_start (skb,IPSET_ATTR_DATA );if (!nested) {if (id == first) {nla_nest_cancel (skb, adt);
@@ -244,9 +244,9 @@ mtype_list(const struct ip_set *set, goto nla_put_failure;if (ip_set_put_extensions (skb, set, x,mtype_is_filled (x))) goto nla_put_failure; -ipset_nest_end (skb, nested); +nla_nest_end (skb, nested); } -ipset_nest_end (skb, adt); +nla_nest_end (skb, adt);/* Set listing finished */ cb->args[IPSET_CB_ARG0 ] =0 ;
@@ -259,7 +259,7 @@ mtype_list(const struct ip_set *set, cb->args[IPSET_CB_ARG0 ] =0 ; ret = -EMSGSIZE ; } -ipset_nest_end (skb, adt); +nla_nest_end (skb, adt); out:rcu_read_unlock ();return ret;
net/netfilter/ipset/ip_set_hash_gen.h +7 -7
@@ -1057,7 +1057,7 @@ mtype_head(struct ip_set *set, struct sk_buff *skb) htable_bits = t->htable_bits;rcu_read_unlock_bh (); - nested =ipset_nest_start (skb,IPSET_ATTR_DATA ); + nested =nla_nest_start (skb,IPSET_ATTR_DATA );if (!nested) goto nla_put_failure; if (nla_put_net32(skb, IPSET_ATTR_HASHSIZE,
@@ -1079,7 +1079,7 @@ mtype_head(struct ip_set *set, struct sk_buff *skb) goto nla_put_failure;if (unlikely (ip_set_put_flags (skb, set))) goto nla_put_failure; -ipset_nest_end (skb, nested); +nla_nest_end (skb, nested);return 0 ; nla_put_failure:
@@ -1124,7 +1124,7 @@ mtype_list(const struct ip_set *set,void *incomplete;int i, ret =0 ; - atd =ipset_nest_start (skb,IPSET_ATTR_ADT ); + atd =nla_nest_start (skb,IPSET_ATTR_ADT );if (!atd)return -EMSGSIZE ;
@@ -1150,7 +1150,7 @@ mtype_list(const struct ip_set *set,continue ;pr_debug ("list hash %lu hbucket %p i %u, data %p\n" , cb->args[IPSET_CB_ARG0 ], n, i, e); - nested =ipset_nest_start (skb,IPSET_ATTR_DATA ); + nested =nla_nest_start (skb,IPSET_ATTR_DATA );if (!nested) {if (cb->args[IPSET_CB_ARG0 ] == first) {nla_nest_cancel (skb, atd);
@@ -1163,10 +1163,10 @@ mtype_list(const struct ip_set *set, goto nla_put_failure;if (ip_set_put_extensions (skb, set, e, true)) goto nla_put_failure; -ipset_nest_end (skb, nested); +nla_nest_end (skb, nested); } } -ipset_nest_end (skb, atd); +nla_nest_end (skb, atd);/* Set listing finished */ cb->args[IPSET_CB_ARG0 ] =0 ;
@@ -1180,7 +1180,7 @@ mtype_list(const struct ip_set *set, cb->args[IPSET_CB_ARG0 ] =0 ; ret = -EMSGSIZE ; }else { -ipset_nest_end (skb, atd); +nla_nest_end (skb, atd); } out:rcu_read_unlock ();
net/netfilter/ipset/ip_set_list_set.c +7 -7
@@ -466,7 +466,7 @@ list_set_head(struct ip_set *set, struct sk_buff *skb)struct nlattr *nested;size_t memsize =list_set_memsize (map, set->dsize) + set->ext_size; - nested =ipset_nest_start (skb,IPSET_ATTR_DATA ); + nested =nla_nest_start (skb,IPSET_ATTR_DATA );if (!nested) goto nla_put_failure; if (nla_put_net32(skb, IPSET_ATTR_SIZE, htonl(map->size)) ||
@@ -476,7 +476,7 @@ list_set_head(struct ip_set *set, struct sk_buff *skb) goto nla_put_failure;if (unlikely (ip_set_put_flags (skb, set))) goto nla_put_failure; -ipset_nest_end (skb, nested); +nla_nest_end (skb, nested);return 0 ; nla_put_failure:
@@ -494,7 +494,7 @@ list_set_list(const struct ip_set *set,struct set_elem *e;int ret =0 ; - atd =ipset_nest_start (skb,IPSET_ATTR_ADT ); + atd =nla_nest_start (skb,IPSET_ATTR_ADT );if (!atd)return -EMSGSIZE ;
@@ -506,7 +506,7 @@ list_set_list(const struct ip_set *set, i++;continue ; } - nested =ipset_nest_start (skb,IPSET_ATTR_DATA ); + nested =nla_nest_start (skb,IPSET_ATTR_DATA );if (!nested) goto nla_put_failure;ip_set_name_byindex (map->net, e->id, name);
@@ -514,11 +514,11 @@ list_set_list(const struct ip_set *set, goto nla_put_failure;if (ip_set_put_extensions (skb, set, e, true)) goto nla_put_failure; -ipset_nest_end (skb, nested); +nla_nest_end (skb, nested); i++; } -ipset_nest_end (skb, atd); +nla_nest_end (skb, atd);/* Set listing finished */ cb->args[IPSET_CB_ARG0 ] =0 ; goto out;
@@ -531,7 +531,7 @@ list_set_list(const struct ip_set *set, ret = -EMSGSIZE ; }else { cb->args[IPSET_CB_ARG0 ] = i; -ipset_nest_end (skb, atd); +nla_nest_end (skb, atd); } out:rcu_read_unlock ();
Signature · 1 line
2.21.0
Re: [PATCH net-next 2/3] ipset: drop ipset_nest_start() and ipset_nest_end()
Quoted 11 lines · Michal Kubecek
After the previous commit, both
ipset_nest_start()andipset_nest_end()are just aliases fornla_nest_start()andnla_nest_end()so that there is no need to keep them.Signed-off-by Michal Kubecek <[email protected]>--- include/linux/netfilter/ipset/ip_set.h | 11 ++++------- net/netfilter/ipset/ip_set_bitmap_gen.h | 14 +++++++------- net/netfilter/ipset/ip_set_hash_gen.h | 14 +++++++------- net/netfilter/ipset/ip_set_list_set.c | 14 +++++++------- 4 files changed, 25 insertions(+), 28 deletions(-)
Best regards,
Jozsef
-
E-mail : [email protected], [email protected] PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics, Hungarian Academy of Sciences
H-1525 Budapest 114, POB. 49, Hungary
PATCH 3/3 net: fix two coding style issues
In reply to Michal KubecekThis is a simple cleanup addressing two coding style issues found by checkpatch.pl in an earlier patch. It's submitted as a separate patch to keep the original patch as it was generated by spatch.
--- net/bridge/br_netlink.c | 4 ++-- net/decnet/dn_table.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-)
net/bridge/br_netlink.c +2 -2
@@ -413,9 +413,9 @@ static int br_fill_ifinfo(struct sk_buff *skb, goto nla_put_failure;if (event ==RTM_NEWLINK && port) { -struct nlattr *nest - =nla_nest_start (skb,IFLA_PROTINFO ); +struct nlattr *nest; + nest =nla_nest_start (skb,IFLA_PROTINFO );if (nest ==NULL ||br_port_fill_attrs (skb, port) <0 ) goto nla_put_failure;nla_nest_end (skb, nest);
net/decnet/dn_table.c +2 -1
@@ -348,7 +348,8 @@ static int dn_fib_dump_info(struct sk_buff *skb, u32 portid, u32 seq, int event,struct rtnexthop *nhp;struct nlattr *mp_head; -if (!(mp_head =nla_nest_start_noflag (skb,RTA_MULTIPATH ))) + mp_head =nla_nest_start_noflag (skb,RTA_MULTIPATH ); +if (!mp_head) goto errout;for_nexthops (fi) {
Signature · 1 line
2.21.0
Johannes Berg
maintainerQuoted 6 lines · Michal Kubecek
Another observation was that even if
NLA_F_NESTEDflag was introduced in 2007, only few netlink based interfaces set it in kernel generated messages and even many recently added APIs omit it. That is unfortunate as without the flag, message parsers not familiar with attribute semantics cannot recognize nested attributes and do not see message structure; this affects e.g. wireshark dissector ormnl_nlmsg_fprintf()from libmnl.
Indeed.
I wonder if we should also (start) enforcing that the userspace sender side sets this, if the policy is strict?
johannes
Quoted 9 lines · Johannes Berg
Quoted 6 lines · Michal Kubecek
Another observation was that even if
NLA_F_NESTEDflag was introduced in 2007, only few netlink based interfaces set it in kernel generated messages and even many recently added APIs omit it. That is unfortunate as without the flag, message parsers not familiar with attribute semantics cannot recognize nested attributes and do not see message structure; this affects e.g. wireshark dissector ormnl_nlmsg_fprintf()from libmnl.
Quoted 4 lines
Indeed.
I wonder if we should also (start) enforcing that the userspace sender side sets this, if the policy is strict?
I suppose we should, at least the part that attribute with NLA_NESTED policy has NLA_F_NESTED flag. I'm not so sure about the opposite (i.e. that attributes with other policies do not have the flag) as when I was checking where kernel accesses nlattr::nla_type directly rather than with nla_type(), I stumbled upon an attribute NL80211_ATTR_VENDOR_DATA which has policy NLA_BINARY but is sometimes a nest, AFAICS.
Michal
Johannes Berg
maintainerQuoted 15 lines · Michal Kubecek
Quoted 9 lines · Johannes Berg
Quoted 6 lines · Michal Kubecek
Another observation was that even if
NLA_F_NESTEDflag was introduced in 2007, only few netlink based interfaces set it in kernel generated messages and even many recently added APIs omit it. That is unfortunate as without the flag, message parsers not familiar with attribute semantics cannot recognize nested attributes and do not see message structure; this affects e.g. wireshark dissector ormnl_nlmsg_fprintf()from libmnl.Quoted 4 lines
Indeed.
I wonder if we should also (start) enforcing that the userspace sender side sets this, if the policy is strict?
Quoted 6 lines
I suppose we should, at least the part that attribute with
NLA_NESTEDpolicy hasNLA_F_NESTEDflag. I'm not so sure about the opposite (i.e. that attributes with other policies do not have the flag) as when I was checking where kernel accessesnlattr::nla_typedirectly rather than withnla_type(), I stumbled upon an attributeNL80211_ATTR_VENDOR_DATAwhich has policyNLA_BINARYbut is sometimes a nest, AFAICS.
I guess anyway we can only do it for *new* things, not really for all existing attributes.
Regarding that attribute - I guess we'd have to come up with a policy flag saying "may or may not be nested" (if it was a new one) or so?
johannes
Quoted 23 lines · Johannes Berg
Quoted 15 lines · Michal Kubecek
Quoted 9 lines · Johannes Berg
Quoted 6 lines · Michal Kubecek
Another observation was that even if
NLA_F_NESTEDflag was introduced in 2007, only few netlink based interfaces set it in kernel generated messages and even many recently added APIs omit it. That is unfortunate as without the flag, message parsers not familiar with attribute semantics cannot recognize nested attributes and do not see message structure; this affects e.g. wireshark dissector ormnl_nlmsg_fprintf()from libmnl.Quoted 4 lines
Indeed.
I wonder if we should also (start) enforcing that the userspace sender side sets this, if the policy is strict?
Quoted 6 lines
I suppose we should, at least the part that attribute with
NLA_NESTEDpolicy hasNLA_F_NESTEDflag. I'm not so sure about the opposite (i.e. that attributes with other policies do not have the flag) as when I was checking where kernel accessesnlattr::nla_typedirectly rather than withnla_type(), I stumbled upon an attributeNL80211_ATTR_VENDOR_DATAwhich has policyNLA_BINARYbut is sometimes a nest, AFAICS.
Quoted 2 lines
I guess anyway we can only do it for *new* things, not really for all existing attributes.
Right... but what I wanted to say is that if there is already (at least) one attribute which may or may not be a nest, depending on a context, we should expect there may be also new attributes like that in the future.
Michal
Johannes Berg
maintainerQuoted 7 lines · Michal Kubecek
Quoted 7 lines
Quoted 6 lines
I suppose we should, at least the part that attribute with
NLA_NESTEDpolicy hasNLA_F_NESTEDflag. I'm not so sure about the opposite (i.e. that attributes with other policies do not have the flag) as when I was checking where kernel accessesnlattr::nla_typedirectly rather than withnla_type(), I stumbled upon an attributeNL80211_ATTR_VENDOR_DATAwhich has policyNLA_BINARYbut is sometimes a nest, AFAICS.
Quoted 6 lines
Quoted 2 lines
I guess anyway we can only do it for *new* things, not really for all existing attributes.
Right... but what I wanted to say is that if there is already (at least) one attribute which may or may not be a nest, depending on a context, we should expect there may be also new attributes like that in the future.
Yeah, but we can handle that as we see it?
I just reposted my strict validation series - maybe we can right now, as it's not released yet, quickly add an NL_VALIDATED_NESTED_FLAG or so to it?
Do you want to take a stab at that? I have to go now, but I could check in the next few days.
johannes
Quoted 16 lines · Johannes Berg
Quoted 7 lines · Michal Kubecek
Quoted 7 lines
Quoted 6 lines
I suppose we should, at least the part that attribute with
NLA_NESTEDpolicy hasNLA_F_NESTEDflag. I'm not so sure about the opposite (i.e. that attributes with other policies do not have the flag) as when I was checking where kernel accessesnlattr::nla_typedirectly rather than withnla_type(), I stumbled upon an attributeNL80211_ATTR_VENDOR_DATAwhich has policyNLA_BINARYbut is sometimes a nest, AFAICS.Quoted 6 lines
Quoted 2 lines
I guess anyway we can only do it for *new* things, not really for all existing attributes.
Right... but what I wanted to say is that if there is already (at least) one attribute which may or may not be a nest, depending on a context, we should expect there may be also new attributes like that in the future.
Quoted 8 lines
Yeah, but we can handle that as we see it?
I just reposted my strict validation series - maybe we can right now, as it's not released yet, quickly add an
NL_VALIDATED_NESTED_FLAGor so to it?Do you want to take a stab at that? I have to go now, but I could check in the next few days.
What is a valid use case for an attribute sometimes being a nest and sometimes not? That seems really weird to me (ie., wrong). They should be 2 separate attributes even if the backend processing is the same.
Johannes Berg
maintainerQuoted 4 lines · David Ahern
What is a valid use case for an attribute sometimes being a nest and sometimes not? That seems really weird to me (ie., wrong). They should be 2 separate attributes even if the backend processing is the same.
Yeah, well, in the mentioned case - NL80211_ATTR_VENDOR_DATA - we basically have something that each driver (sometimes each operation that uses it) decides what it means, and most drivers like proper netlink attributes so have nested stuff there. Sometimes not, though in Prague we decided we should make that documented by requiring a nested policy and (perhaps, TBD) using something like an ERR_PTR() for "I really want this to be binary".
I think as far as this particular attribute is concerned the ship has sailed, but in the future I'd probably advocate having two attributes.
johannes
Quoted 14 lines · Johannes Berg
Quoted 4 lines · David Ahern
What is a valid use case for an attribute sometimes being a nest and sometimes not? That seems really weird to me (ie., wrong). They should be 2 separate attributes even if the backend processing is the same.
Yeah, well, in the mentioned case -
NL80211_ATTR_VENDOR_DATA- we basically have something that each driver (sometimes each operation that uses it) decides what it means, and most drivers like proper netlink attributes so have nested stuff there. Sometimes not, though in Prague we decided we should make that documented by requiring a nested policy and (perhaps, TBD) using something like anERR_PTR()for "I really want this to be binary".
Quoted 2 lines
I think as far as this particular attribute is concerned the ship has sailed, but in the future I'd probably advocate having two attributes.
Or put the binary into the nest which would also make it easier to add more data or switch to structured information later.
Michal
David Miller
maintainerFrom: Michal Kubecek <[email protected]>
Date: Fri, 26 Apr 2019 11:13:03 +0200 (CEST)
Quoted 21 lines
One of the comments in recent review of the ethtool netlink series pointed out that proposed
ethnl_nest_start()helper which addsNLA_F_NESTEDto second argument ofnla_nest_start()is not really specific to ethtool netlink code. That is hard to argue with as closer inspection revealed that exactly the same helper already exists in ipset code (except it's a macro rather than an inline function).Another observation was that even if
NLA_F_NESTEDflag was introduced in 2007, only few netlink based interfaces set it in kernel generated messages and even many recently added APIs omit it. That is unfortunate as without the flag, message parsers not familiar with attribute semantics cannot recognize nested attributes and do not see message structure; this affects e.g. wireshark dissector ormnl_nlmsg_fprintf()from libmnl.This is why I'm suggesting to rename existing
nla_nest_start()to different name (nla_nest_start_noflag) and reintroducenla_nest_start()as a wrapper addingNLA_F_NESTEDflag. This is implemented in first patch which is mostly generated by spatch. Second patch drops ipset helper macros which lose their purpose. Third patch cleans up minor coding style issues found by checkpatch.pl in first patch.
Quoted 3 lines
We could leave
nla_nest_start()untouched and simply add a wrapper addingNLA_F_NESTEDbut that would probably preserve the state when even most new code doesn't set the flag.
Series applied, thank you.