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

Commit db863ea8 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 590a1f5d
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -170,11 +170,11 @@ static int rmnet_newlink(struct net *src_net, struct net_device *dev,
			 struct nlattr *tb[], struct nlattr *data[],
			 struct netlink_ext_ack *extack)
{
	u32 data_format = RMNET_FLAGS_INGRESS_DEAGGREGATION;
	struct net_device *real_dev;
	int mode = RMNET_EPMODE_VND;
	struct rmnet_endpoint *ep;
	struct rmnet_port *port;
	u32 data_format;
	int err = 0;
	u16 mux_id;

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

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

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

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