Subject: Re: [patch 5/7] CAN: Add virtual CAN netdevice driver

From: Oliver Hartkopp <[email-masked]>
Date: Thu, 31 May 2007 07:13:14 +0200

Patrick McHardy wrote:
> Oliver Hartkopp wrote:
>   
>> Btw. it's really worth to look at it again. I just had the idea to
>> access the loopback flag via skb->sk->opt->loopback (argpfl!) on the TX
>> path and skb->sk on the RX path. This would avoid skb->sk to be set to
>> NULL but need to have this loopback flag to be implemented in each CAN
>> socket opt.
>>     
>
>
> Yes, thats what I wanted to suggest. You should even be able
> to use skb->sk->opt->loopback on the receive path before you
> queue the packet to the socket.
>   

Using skb->sk->opt->loopback on the receive path is not possible as you
also have to deal with 'real' data received from a 'real' netdevice,
where no sk is bound to the skb. The idea is to check on the rx path ,
if sbk->sk is 'me' and then trash the packet according to my sockopt
settings.

Regards,
Oliver