Ethical Hacking Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package. | Computer Forensics Training at InfoSec Institute Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors. |

| Subject: | Re: IP cheksum and libnet_pblock_coalesce |
|---|---|
| Date: | Fri, 24 Sep 2004 15:27:56 +0300 |
Hello,
This is function libnet_in_cksum() from libnet_checksum.c:
41 int
42 libnet_in_cksum(u_int16_t *addr, int len)
43 {
44 int sum;
45
46 sum = 0;
47
48 while (len > 1)
49 {
50 sum += *addr++;
51 len -= 2;
52 }
53 if (len == 1)
54 {
55 sum += *(u_int16_t *)addr;
56 }
57
58 return (sum);
59 }I changed to line 55 to read like this:
55 sum += *(u_int8_t *)addr;
385 /* Add left-over byte, if any */ 386 if( count > 0 ) 387 sum += * (unsigned char *) addr;
Notice the cast to u_int8_t.
-jarppe
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: IP cheksum and libnet_pblock_coalesce, Frédéric Raynal |
|---|---|
| Next by Date: | Re: IP cheksum and libnet_pblock_coalesce, Kenichi MORI |
| Previous by Thread: | Re: IP cheksum and libnet_pblock_coalesce, Kenichi MORI |
| Next by Thread: | Re: IP cheksum and libnet_pblock_coalesce, Frédéric Raynal |
| Indexes: | [Date] [Thread] [Top] [All Lists] |