Re: [PATCH v1 13/34] j1939: socket: drop sanity check for ifindex

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

 



Hi Oliver,

On Tue, Jul 09, 2019 at 07:03:12PM +0200, Oliver Hartkopp wrote:
> Hi Oleksij,
> 
> the topic said what this patch does - but there's no commit message that
> tells the reader why the check can be dropped.
> 
> And the removed comment in the patch leaves me even more lost ...

You right. I'll update the commit message.

Current j1939 stack implementation has one priv structure per interface.
There are no more global structures. All sockets are linked to related
priv. The can_rx call back is also configured with appropriate priv.
It means, we can't get an skb for different ifindex.

> Regards,
> Oliver
> 
> On 09/07/2019 10.58, Oleksij Rempel wrote:
> > Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
> > ---
> >   net/can/j1939/socket.c | 5 -----
> >   1 file changed, 5 deletions(-)
> > 
> > diff --git a/net/can/j1939/socket.c b/net/can/j1939/socket.c
> > index 19e662574b5f..39df867cfe84 100644
> > --- a/net/can/j1939/socket.c
> > +++ b/net/can/j1939/socket.c
> > @@ -272,14 +272,9 @@ static bool j1939_sk_recv_match_one(struct j1939_sock *jsk,
> >   static void j1939_sk_recv_one(struct j1939_sock *jsk, struct sk_buff *oskb)
> >   {
> >   	const struct j1939_sk_buff_cb *oskcb = j1939_skb_to_cb(oskb);
> > -	const struct can_skb_priv *oskb_prv = can_skb_prv(oskb);
> >   	struct j1939_sk_buff_cb *skcb;
> >   	struct sk_buff *skb;
> > -	if (jsk->ifindex != oskb_prv->ifindex)
> > -		/* this socket does not take packets from this iface */
> > -		return;
> > -
> >   	if (!j1939_sk_recv_match_one(jsk, oskcb))
> >   		return;
> > 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



[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