Hi Simon,

with some help of a collegue at work I looked into the problem more in detail.

In row 486 following of heartbeat-2.1.3/resources/OCF/IPv6addr.c the mask is determined. We have played around quite some time. I have a plen of 0x40 (64) and so it should shift to 0 in row 490. Somehow if s is 32 in this line, it doesn't shift at all and the value stays at 0xffffffff.

More desturbing, if I specify s=32; above this line by hand it works. Maybe the compiler is optimizing something here, but removing -O2 from the compiler didn't solve this mystery.

I am running this on amd64. I am not sure if it is an amd64 bug or something.

I have solved this mystery by the following patch for now:

--- IPv6addr.c_ORIG 2009-02-17 14:28:45.000000000 +0100
+++ IPv6addr.c 2009-02-17 14:29:24.000000000 +0100
@@ -487,7 +487,10 @@
n = plen / 32;
memset(mask.s6_addr32 + n + 1, 0, (3 - n) * 4);
s = 32 - plen % 32;
- mask.s6_addr32[n] = 0xffffffff << s;
+ if (s == 32)
+ mask.s6_addr32[n] = 0x0;
+ else
+ mask.s6_addr32[n] = 0xffffffff << s;
mask.s6_addr32[n] = htonl(mask.s6_addr32[n]);
}

I know it's ugly, but it solves this issue for me.

If you come up with a proper solution, I'd really appreciate it.

thanks
Philipp



--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to