[linux-dvb] [PATCH] dvb-core: ULE fixes and RFC4326 additions
cpraehaus at cosy.sbg.ac.at
Wed Apr 19 17:18:02 CEST 2006
Just sent this to linux-dvb-maintainer at linuxtv.org.
> This patch fixes some problems regarding support for Unidirectional
> Lightweight Encapsulation (ULE) in
> The original ULE code was based on a draft. In the meantime, ULE has
> been published in RFC 4326 (ftp://ftp.rfc-editor.org/in-notes/rfc4326.txt).
> With these fixes, and some additions (which are included in the patch),
> the decaps code should now be complient to RFC4326.
> The patch was made against Linux 2.6.16 kernel sources.
> For a more verbose description of this patch, read the attached file
> Patch Signed-off-by: Christian Praehauser <cpraehaus at cosy.sbg.ac.at>
> Kind Regards,
| Christian Praehauser |
| Email: |
| cpraehaus at cosy.sbg.ac.at |
| Address: |
| Institut fuer Computerwissenschaften |
| Jakob-Haringer-Strasse 2 |
| A-5020 Salzburg, Austria |
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 12782 bytes
Desc: not available
Url : http://www.linuxtv.org/pipermail/linux-dvb/attachments/20060419/96e773b0/dvb_net_ule_rfc4326.bin
-------------- next part --------------
README for dvb_net_ule_rfc4326.patch
Fixed bugs in the Unidirectional Lightweight Encapsulation (ULE) code. Also checked compliency with RFC 4326 (ULE).
Changes in dvb_net.c
* Fixed check of SNDU length.
The SNDU length was not checked correctly, thus leaving the possibility for a kernel panic if receiving malformed SNDUs.
Now, the SNDU length is considered invalid if it is less then 5. The reasoning for this is that an SNDU must always carry at least one byte of payload and the CRC32 (4 Bytes).
* Added check of return value from functions which handle mandatory extension headers (e.g. ule_test_sndu)
* Fixed handling of optional extension headers.
When processing optional extension headers, the length of the extension header was not calculated correctly.
Also the next header type field was assumed to be after the optional extension header. In fact, it is a part of it (always the last two bytes).
The length calc. and next header type field access for optional ext. headers have been fixed.
* Added handling of extension header padding (optional extension header with type 1)
* Fixed check of destination address in presence of extension headers.
The destination address was assumed to be after any extension headers. Thus, the extension headers were processed before comparing the destination address with the actual address of the receiver. After that, the total length of the ext. headers was removed from the buffer (skb) also including the destination address.
Now, the destination address (if present) is checked before processing any extension headers. The destination address is saved in a local buffer because it may be required for constructing the ethernet header.
* Fixed/Improved filtering on destination address (if present in ULE SNDU)
(1) Now, everything is passed up the stack if in promiscious mode.
(2) The address of the receiver device and the broadcast address (FF:FF:FF:FF:FF:FF) are always accepted.
(3) If in multicast mode, all addresses in the multicast address list are accepted (in addition to 2).
(4) If in all-multicast mode, all multicast addresses are accepted (in addition to 2).
* Reduced timeout value for TS cells to 10 ms.
* Fixed arguments for setting TS feed properties.
The documentation for DVB-API v3 and what is actually present in the Linux kernel seem to be out of sync.
The set() function for TS feeds differs in the DVB API version 3 document and the Linux kernel version:
int set(dmx ts feed t* feed, u16 pid, size_t callback length, size_t circular buffer size, int descramble, struct timespec timeout);
Actually implemented in the 2.6.15 Kernel:
int dmx_ts_feed_set(struct dmx_ts_feed *ts_feed, u16 pid, int ts_type, enum dmx_ts_pes pes_type, size_t circular_buffer_size, struct timespec timeout);
Paris Lodron University of Salzburg
Signed-off-by: Christian Praehauser <cpraehaus at cosy.sbg.ac.at>
More information about the linux-dvb