Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9cb5fa46 authored by Sean Tranchetti's avatar Sean Tranchetti
Browse files

net: qualcomm: rmnet: only set flags when given



Recent userspace application changes affecting device creation have
exposed a race between changing the data format flags and processing
packets. If new devices were created without specifying the flags
argument, the data format for all rmnet devices would be overwritten,
possibly in the middle of processing. Fix this by only changing the data
format when creating a new rmnet device if a new data format is given to
us. Otherwise, the data format will be left alone.

Change-Id: I7bd5508659503bb69bc3b1b5504bdad98c927745
Signed-off-by: default avatarSean Tranchetti <stranche@codeaurora.org>
parent 2d98cfef
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -163,11 +163,11 @@ static int rmnet_newlink(struct net *src_net, struct net_device *dev,
			 struct nlattr *tb[], struct nlattr *data[],
			 struct nlattr *tb[], struct nlattr *data[],
			 struct netlink_ext_ack *extack)
			 struct netlink_ext_ack *extack)
{
{
	u32 data_format = RMNET_FLAGS_INGRESS_DEAGGREGATION;
	struct net_device *real_dev;
	struct net_device *real_dev;
	int mode = RMNET_EPMODE_VND;
	int mode = RMNET_EPMODE_VND;
	struct rmnet_endpoint *ep;
	struct rmnet_endpoint *ep;
	struct rmnet_port *port;
	struct rmnet_port *port;
	u32 data_format;
	int err = 0;
	int err = 0;
	u16 mux_id;
	u16 mux_id;


@@ -202,10 +202,9 @@ static int rmnet_newlink(struct net *src_net, struct net_device *dev,


		flags = nla_data(data[IFLA_RMNET_FLAGS]);
		flags = nla_data(data[IFLA_RMNET_FLAGS]);
		data_format = flags->flags & flags->mask;
		data_format = flags->flags & flags->mask;
	}

		netdev_dbg(dev, "data format [0x%08X]\n", data_format);
		netdev_dbg(dev, "data format [0x%08X]\n", data_format);
		port->data_format = data_format;
		port->data_format = data_format;
	}


	if (data[IFLA_RMNET_UL_AGG_PARAMS]) {
	if (data[IFLA_RMNET_UL_AGG_PARAMS]) {
		void *agg_params;
		void *agg_params;