[CTDB] various patches

ronnie sahlberg ronniesahlberg at gmail.com
Thu May 21 02:20:31 GMT 2009


Hi Sumit,

Thanks for your patches!


I have checked in your patches except one.
I applied some trivial modifications to 0006
and reject 0003.


The patch 0003  contains these changes :
-        s = socket(AF_INET, SOCK_PACKET, htons(ETHERTYPE_ARP));
+        s = socket(PF_PACKET, SOCK_RAW, htons(ETHERTYPE_ARP));

These two types of sockets are not equivalent and do not offer compatible
semantics.
In this case the old behaviour is important since we need to craft our own
ethernet headers.

Please see the "unusual" use of using sendto() to send not to a destination,
but specifying an interface to send the frame out through
a few lines further down. This is because we want to issue/send broadcast
ethernet frames.


Thus this patch broke the gratARP feature in CTDB which would have made
failover less efficient.



If you want to test/verify this,   just run wireshark on a different host on
your network and capture ARP packets.
On the CTDB node then run "ctdb gratiousarp 1.2.3.4 eth0" and see if you can
see these ARP packets being sent with/without the patch.
(The sendto() fails with this patch installed, which is also logged to
/var/log/log.ctdb)




best regards
ronnie sahlberg



On Thu, May 21, 2009 at 2:13 AM, Sumit Bose <sbose at redhat.com> wrote:

> Hi,
>
> during a review Jim Meyering <meyering at redhat.com> found a number of
> issues I try to address with the following patches:
>
> 0001: adds a missing dependency in the Makefile which is necessary for
> parallel builds
>
> 0002: netfilter.h uses structs defined in netinet/in.h, but does not
> include it, this means the complie test has to include it
>
> 0003: SOCK_PACKET is deprecated, changed to new style
>
> 0004: member logfile in struct ctdb_context and struct ctdb_log_state is
> not used anywhere and was allocated without a check
>
> 0005: member node_list_file in struct ctdb_context is not used anywhere
> and was allocated without a check
>
> 0006: adds various checks on return values and allocated memory
>
>
> bye,
> Sumit
>


More information about the samba-technical mailing list