[linux-dvb] IPv6 support in DVB drivers

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

 



matthieu castet wrote:
> I don't know how is encapsulated ip in dvb, but this patch seem quite 
> ugly : why we can't read the protocol in the llc header ?
> 
> For the atm it is done like that :
>         if (!clip_vcc->encap || skb->len < RFC1483LLC_LEN || 
> memcmp(skb->data,
>             llc_oui,sizeof(llc_oui))) skb->protocol = htons(ETH_P_IP);
>         else {
>                 skb->protocol = ((u16 *) skb->data)[3];
>                 skb_pull(skb,RFC1483LLC_LEN);
>         }
> 
> where RFC1483LLC_LEN=8 and
> static const unsigned char llc_oui[] = {
>         0xaa,   /* DSAP: non-ISO */
>         0xaa,   /* SSAP: non-ISO */
>         0x03,   /* Ctrl: Unnumbered Information Command PDU */
>         0x00,   /* OUI: EtherType */
>         0x00,
>         0x00 };
> 
> In sumary if there no llc header we are in vcmux mode and we assume IPV4 
> and otherwise we read the protocol in the LLC header.

Yeah, we should do it that way. Thanks for the information!

> Also instead of removing the first 8 Bytes by hand which could be 
> expensive, couldn't use the kernel network utils like skb_pull ?

I'll simply change the skb_put() call to skip the LLC/SNAP header.

Thanks,
Johannes



[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux