<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to feature-requests</title><link>https://sourceforge.net/p/libnids/feature-requests/</link><description>Recent changes to feature-requests</description><atom:link href="https://sourceforge.net/p/libnids/feature-requests/feed.rss" rel="self"/><language>en</language><lastBuildDate>Wed, 02 Feb 2005 09:48:00 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/libnids/feature-requests/feed.rss" rel="self" type="application/rss+xml"/><item><title>Bug/Problem with optional checksum</title><link>https://sourceforge.net/p/libnids/feature-requests/1/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Dear Rafal,&lt;/p&gt;
&lt;p&gt;when using your nids library (by the way: great work), I &lt;br /&gt;
encountered the following situation:&lt;/p&gt;
&lt;p&gt;A router skipped the calculation of check sums due to &lt;br /&gt;
performance issues. That's not really nice ;-), but under &lt;br /&gt;
certain circumstances the checksum may be omitted &lt;br /&gt;
(see below). When using libnids all packets with a value &lt;br /&gt;
of  zero (0) in the checksum field of the UDP header are &lt;br /&gt;
silently discarded.&lt;br /&gt;
My proposal is to include a differentiation between zero &lt;br /&gt;
(0) and it's 1's complement (65535) into libnids. What do &lt;br /&gt;
you think about it? For my project I've made a small &lt;br /&gt;
patch (I hope it works fine with version 1.19, I currently &lt;br /&gt;
use 1.18), perhaps it is good and you like it - just have &lt;br /&gt;
a look.&lt;/p&gt;
&lt;p&gt;My patch (I've adapted the line numbers to version &lt;br /&gt;
1.19):&lt;/p&gt;
&lt;p&gt;diff libnids.c libnids_patch.c&lt;br /&gt;
316a317&lt;br /&gt;
&amp;gt; #define UH_CSUM uh_sum&lt;br /&gt;
320a322&lt;br /&gt;
&amp;gt; #define UH_CSUM check&lt;br /&gt;
338c340&lt;br /&gt;
&amp;lt;     if (my_udp_check&lt;br /&gt;
---&lt;br /&gt;
&amp;gt;     if ((udph-&amp;gt;UH_CSUM) &amp;amp;&amp;amp; (my_udp_check&lt;br /&gt;
340c342&lt;br /&gt;
&amp;lt;        iph-&amp;gt;ip_dst.s_addr)) return;&lt;br /&gt;
---&lt;br /&gt;
&amp;gt;        iph-&amp;gt;ip_dst.s_addr))) return;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;
rmp&lt;/p&gt;
&lt;p&gt;Excerpt from RFC 1122:&lt;br /&gt;
---snip&lt;/p&gt;
&lt;p&gt;4.1.3.4 UDP Checksums&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;IMPLEMENTATION:&lt;br /&gt;
There is a common implementation error in UDP &lt;br /&gt;
checksums. Unlike the TCP checksum, the UDP &lt;br /&gt;
checksum is optional; the value zero is transmitted in &lt;br /&gt;
the checksum field of a UDP header to indicate the &lt;br /&gt;
absence of a checksum. If the transmitter really &lt;br /&gt;
calculates a UDP checksum of zero, it must transmit the &lt;br /&gt;
checksum as all 1's (65535). No special action is required &lt;br /&gt;
at the receiver, since zero and 65535 are equivalent in &lt;br /&gt;
1's complement arithmetic. &lt;/p&gt;
&lt;p&gt;---snap&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">rmp</dc:creator><pubDate>Wed, 02 Feb 2005 09:48:00 -0000</pubDate><guid>https://sourceforge.netae8b0d8b602743a430d2805e3fb244ac9bcec54d</guid></item></channel></rss>