Skip to contentSkip to conversation

fix comment in net.c

PATCH New Ron Alder 4 participants 5 messages Nov 9, 2005 – Nov 10, 2005

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 fix comment in net.c

Quoted 6 lines · In message <[email protected]> you wrote:

This patch fixes a comment in net/net.c

CHANGELOG:
* Fix comment in net/net.c
Patch by Ron Alder, 09 Nov 2005

Which problem are you trying to fix?

Best regards,

Wolfgang Denk

Signature · 3 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Often it is fatal to live too long.                          - Racine
#2 lore raw

PATCH 1/1 fix comment in net.c

In reply to Ron Alder
Quoted 13 lines · Ron Alder

This patch fixes a comment in net/net.c

CHANGELOG:
* Fix comment in net/net.c
Patch by Ron Alder, 09 Nov 2005

------------------------------------------------------------------------

net/net.c static ushort CDP_compute_csum(const uch · line 834

Quoted 7 lines
net/net.c +0 -1
@@ -829,7 +829,6 @@ static ushort CDP_compute_csum(const uch
 		}
 		if (len) {
 			leftover = (signed short)(*(const signed char *)buff);
-			/* * XXX CISCO SUCKS big time! (and blows too) */
 			result = (result & 0xffff0000) | ((result + leftover) & 0x0000ffff);
 		}
 		while (result >> 16)

WTF is this? Politically correct day?

Since I wrote the comment in question let me elaborate.

CDP uses the ip checksum algorithm with a twist; for the last byte it *sign* extends and sums. Obviously this is is completely braindead, and warants the comment and much more :)

Regards

Pantelis

#3 lore raw

PATCH 1/1 fix comment in net.c

Quoted 27 lines · Pantelis Antoniou
Quoted 20 lines · Ron Alder

This patch fixes a comment in net/net.c

CHANGELOG:
* Fix comment in net/net.c
Patch by Ron Alder, 09 Nov 2005

------------------------------------------------------------------------

net/net.c +0 -1
@@ -829,7 +829,6 @@ static ushort CDP_compute_csum(const uch
         }
         if (len) {
             leftover = (signed short)(*(const signed char *)buff);
-            /* * XXX CISCO SUCKS big time! (and blows too) */
             result = (result & 0xffff0000) | ((result + leftover) & 
 0x0000ffff);
         }
Quoted 1 line
         while (result >> 16)

WTF is this? Politically correct day?

Quoted 6 lines

Since I wrote the comment in question let me elaborate.

CDP uses the ip checksum algorithm with a twist; for the last byte it *sign* extends and sums. Obviously this is is completely braindead, and warants the comment and much more :)

Perhaps adding this explanation to the code would be much better to explain the existence of the code that follows the comment. Don't get me wrong, you can still keep the politically incorrect comment although I personally think "SUCKS" and "blows" are probably not very professional terms as well. I understand Ron's motivation for the patch in corporate environment sense.

#4 lore raw

PATCH 1/1 fix comment in net.c

Quoted 4 lines · In message <[email protected]> you wrote:

Perhaps adding this explanation to the code would be much better to explain the existence of the code that follows the comment. Don't get me wrong, you can still keep the politically incorrect comment although I

To end this discussion: that's what I did. I added the explanation which makes the code easier to understand, and left the original comment in place.

Thanks.

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
In accord with UNIX philosophy, Perl gives you enough  rope  to  hang
yourself.              - L. Wall & R. L. Schwartz, _Programming Perl_