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: | Tue, 28 Sep 2004 11:28:27 +0800 |
Hi,
That is a known (but tricky) bug reported some times ago. David Baroso proposed something like :
sum += ((*(u_int8_t *)addr & 0xFF)<<8);
The difficulty is to find something working on both big and little endian systems.
u_int16_t last_byte = 0;
...
if (nleft == 1) {
*(u_int8_t*)&last_byte = *(u_int8_t*)addr;
sum += last_byte;
}I feel this is good.
Best regards,
Yongwei
| <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: | NG & Sparc, Frédéric Raynal |
| Previous by Thread: | Re: IP cheksum and libnet_pblock_coalesce, David Barroso |
| Next by Thread: | Re: IP cheksum and libnet_pblock_coalesce, Frédéric Raynal |
| Indexes: | [Date] [Thread] [Top] [All Lists] |