Re: [PATCH v1 2/5] j1939: transport: don't process not local transports

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On vr, 02 nov 2018 12:32:19 +0100, Oleksij Rempel wrote:
> 
> we will drop this packets soon or later... so drop it better ASAP.

This is true, unless you monitor all j1939 traffic in 'promiscuous'
mode. I'm not sure if that hasn't been thrown away yet, and is something
designed to be used on a PC anyway. You could extend the check a bit.

> 
> Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
> ---
>  net/can/j1939/transport.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/net/can/j1939/transport.c b/net/can/j1939/transport.c
> index 27cf1738f77a..ad7677f8c7f1 100644
> --- a/net/can/j1939/transport.c
> +++ b/net/can/j1939/transport.c
> @@ -1237,6 +1237,9 @@ int j1939_tp_recv(struct j1939_priv *priv, struct sk_buff *skb)
>  	struct j1939_sk_buff_cb *skcb = j1939_skb_to_cb(skb);
>  	const u8 *dat;
>  
> +	if (!j1939_tp_im_involved_anydir(skb))
> +		return 0;
> +
>  	switch (skcb->addr.pgn) {
>  	case J1939_ETP_PGN_DAT:
>  		j1939_xtp_rx_dat(priv, skb, J1939_EXTENDED);
> -- 
> 2.19.1
> 



[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux