[Openais] mcastport port not correctly handled
Mathieu Virbel
mathieu.virbel at netasq.com
Tue Sep 23 09:10:37 PDT 2008
Hi
In trunk branch, if you have mcastport:5405 in corosync.conf,
the listen port are 7701 and 7445.
We got 2 bugs in trunk-branch :
A/ corosync is missing htons() when using mcastport.
B/ ports are not contiguous.
Whitetank-branch use htons() when configuration is read : the bug B are
also spotted.
The patch place htons() call in totemip_totemip_to_sockaddr_convert(),
and fix A and B :
udp4 0 0 Firewall_HA2.5405 *.*
udp4 0 0 Firewall_HA2.5404 *.*
Regards,
Mathieu
-------------- next part --------------
--- corosync-trunk/exec/totemip.c.orig 2008-09-18 11:54:59.000000000 +0200
+++ corosync-trunk/exec/totemip.c 2008-09-23 17:35:54.000000000 +0200
@@ -226,7 +226,7 @@
sin->sin_len = sizeof(struct sockaddr_in);
#endif
sin->sin_family = ip_addr->family;
- sin->sin_port = port;
+ sin->sin_port = htons(port);
memcpy(&sin->sin_addr, ip_addr->addr, sizeof(struct in_addr));
*addrlen = sizeof(struct sockaddr_in);
ret = 0;
@@ -240,7 +240,7 @@
sin->sin6_len = sizeof(struct sockaddr_in6);
#endif
sin->sin6_family = ip_addr->family;
- sin->sin6_port = port;
+ sin->sin6_port = htons(port);
sin->sin6_scope_id = 2;
memcpy(&sin->sin6_addr, ip_addr->addr, sizeof(struct in6_addr));
More information about the Openais
mailing list