[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220314220042.vpicmcrwvexxwk3c@pengutronix.de>
Date: Mon, 14 Mar 2022 23:00:42 +0100
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Vincent Mailhol <vincent.mailhol@...il.com>
Cc: Max Staudt <max@...as.org>,
Wolfgang Grandegger <wg@...ndegger.com>,
linux-can@...r.kernel.org, Oliver Neukum <oneukum@...e.com>,
linux-kernel@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jslaby@...e.com>
Subject: Re: [PATCH v3] can, tty: elmcan CAN/ldisc driver for ELM327 based
OBD-II adapters
On 08.03.2022 16:01:12, Vincent Mailhol wrote:
> > +/* Send a can_frame to a TTY. */
> > +static netdev_tx_t elmcan_netdev_start_xmit(struct sk_buff *skb,
> > + struct net_device *dev)
> > +{
> > + struct elmcan *elm = netdev_priv(dev);
> > + struct can_frame *frame = (struct can_frame *)skb->data;
> > +
> > + if (skb->len != sizeof(struct can_frame))
> > + goto out;
>
> Isn’t this aleardy guaranteed by the upper layers?
You can always inject packets via the packet socket into the kernel,
bypassing e.g. the CAN RAW layer.
regards,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists