<feed xmlns='http://www.w3.org/2005/Atom'>
<title>samba.git/ctdb/protocol, branch talloc-2.2.0</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/'/>
<entry>
<title>ctdb: Initialize addr struct to zero before reparsing as IPV4</title>
<updated>2019-03-15T05:17:13+00:00</updated>
<author>
<name>Zhu Shangzhong</name>
<email>zhu.shangzhong@zte.com.cn</email>
</author>
<published>2019-03-12T12:49:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=539b5ff32b32b7c75dfaaa119e41f5af6ff1e6fc'/>
<id>539b5ff32b32b7c75dfaaa119e41f5af6ff1e6fc</id>
<content type='text'>
Failed to kill the tcp connection that using IPv4-mapped IPv6 address
(e.g. ctdb_killtcp eth0 ::ffff:192.168.200.44:2049
::ffff:192.168.200.45:863).

When the ctdb_killtcp is used to kill the tcp connection, the IPs and
ports in the connection will be parsed to conn.client and conn.server
(call stack: main-&gt;ctdb_sock_addr_from_string-&gt;ip_from_string). In
the ip_from_string, as we are using IPv4-mapped IPv6 addresses, the
ipv6_from_string will be used to parse ip to addr.ip6 first. The next
step the ipv4_from_string will be used to reparse ip to addr.ip.

As a result, the data that dump from conn.server is "2 0 8 1 192 168
200 44 0 0 0 0 0 0 0 0 0 0 255 255 192 168 200 44 0 0 0 0", the data
from conn.client is "2 0 3 95 192 168 200 45 0 0 0 0 0 0 0 0 0 0 255 255
192 168 200 45 0 0 0 0". The connection will be add to conn_list by
ctdb_connection_list_add. Then the reset_connections_send uses conn_list
as parameter to start to reset connections in the conn_list.

In the reset_connections_send, the database "connections" will be
created. The connections from conn_list will be written to the
database(call db_hash_add), and use the data that dump from conn_client
and conn_server as key.

In the reset_connections_capture_tcp_handler, the
ctdb_sys_read_tcp_packet will receive data on the raw socket. And
extract the IPs and ports from the tcp packet. when extracting IP and
port, the tcp4_extract OR tcp6_extract will be used. Then we got the
new conn.client and conn.server. the data that dump from the
conn.server is "2 0 8 1 192 168 200 44 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0", the data from conn.client is "2 0 3 95 192 168 200 45 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0". Finally, we use the data as key to check
if this connection is one being reset(call db_hash_delete). The
db_hash_delete will return ENOENT. Because the two key that being used
by db_hash_delete and db_hash_add are different.

So, the TCP RST will be NOT sent for the connection forever. We should
initialize addr struct to zero before reparsing as IPV4 in the
ip_from_string.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13839

Signed-off-by: Zhu Shangzhong &lt;zhu.shangzhong@zte.com.cn&gt;
Reviewed-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Amitay Isaacs &lt;amitay@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Failed to kill the tcp connection that using IPv4-mapped IPv6 address
(e.g. ctdb_killtcp eth0 ::ffff:192.168.200.44:2049
::ffff:192.168.200.45:863).

When the ctdb_killtcp is used to kill the tcp connection, the IPs and
ports in the connection will be parsed to conn.client and conn.server
(call stack: main-&gt;ctdb_sock_addr_from_string-&gt;ip_from_string). In
the ip_from_string, as we are using IPv4-mapped IPv6 addresses, the
ipv6_from_string will be used to parse ip to addr.ip6 first. The next
step the ipv4_from_string will be used to reparse ip to addr.ip.

As a result, the data that dump from conn.server is "2 0 8 1 192 168
200 44 0 0 0 0 0 0 0 0 0 0 255 255 192 168 200 44 0 0 0 0", the data
from conn.client is "2 0 3 95 192 168 200 45 0 0 0 0 0 0 0 0 0 0 255 255
192 168 200 45 0 0 0 0". The connection will be add to conn_list by
ctdb_connection_list_add. Then the reset_connections_send uses conn_list
as parameter to start to reset connections in the conn_list.

In the reset_connections_send, the database "connections" will be
created. The connections from conn_list will be written to the
database(call db_hash_add), and use the data that dump from conn_client
and conn_server as key.

In the reset_connections_capture_tcp_handler, the
ctdb_sys_read_tcp_packet will receive data on the raw socket. And
extract the IPs and ports from the tcp packet. when extracting IP and
port, the tcp4_extract OR tcp6_extract will be used. Then we got the
new conn.client and conn.server. the data that dump from the
conn.server is "2 0 8 1 192 168 200 44 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0", the data from conn.client is "2 0 3 95 192 168 200 45 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0". Finally, we use the data as key to check
if this connection is one being reset(call db_hash_delete). The
db_hash_delete will return ENOENT. Because the two key that being used
by db_hash_delete and db_hash_add are different.

So, the TCP RST will be NOT sent for the connection forever. We should
initialize addr struct to zero before reparsing as IPV4 in the
ip_from_string.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13839

Signed-off-by: Zhu Shangzhong &lt;zhu.shangzhong@zte.com.cn&gt;
Reviewed-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Amitay Isaacs &lt;amitay@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ctdb-protocol: Use wrapper for string to integer conversion</title>
<updated>2019-03-01T00:32:10+00:00</updated>
<author>
<name>Swen Schillig</name>
<email>swen@linux.ibm.com</email>
</author>
<published>2019-01-29T12:03:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=e96bccc879a675856b3a875db2d718445410caea'/>
<id>e96bccc879a675856b3a875db2d718445410caea</id>
<content type='text'>
In order to detect an value overflow error during
the string to integer conversion with strtoul/strtoull,
the errno variable must be set to zero before the execution and
checked after the conversion is performed. This is achieved by
using the wrapper function strtoul_err and strtoull_err.

Signed-off-by: Swen Schillig &lt;swen@linux.ibm.com&gt;
Reviewed-by: Ralph Böhme &lt;slow@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In order to detect an value overflow error during
the string to integer conversion with strtoul/strtoull,
the errno variable must be set to zero before the execution and
checked after the conversion is performed. This is achieved by
using the wrapper function strtoul_err and strtoull_err.

Signed-off-by: Swen Schillig &lt;swen@linux.ibm.com&gt;
Reviewed-by: Ralph Böhme &lt;slow@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ctdb-protocol: Drop marshalling code for RECEIVE_RECORDS control</title>
<updated>2018-10-08T00:46:21+00:00</updated>
<author>
<name>Amitay Isaacs</name>
<email>amitay@gmail.com</email>
</author>
<published>2018-02-15T01:21:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=2f89bd96fb6c5e50cfc09604ceb6b96a94cb4f56'/>
<id>2f89bd96fb6c5e50cfc09604ceb6b96a94cb4f56</id>
<content type='text'>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13641

Signed-off-by: Amitay Isaacs &lt;amitay@gmail.com&gt;
Reviewed-by: Martin Schwenke &lt;martin@meltin.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13641

Signed-off-by: Amitay Isaacs &lt;amitay@gmail.com&gt;
Reviewed-by: Martin Schwenke &lt;martin@meltin.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ctdb-protocol: Mark RECEIVE_RECORDS control obsolete</title>
<updated>2018-10-08T00:46:21+00:00</updated>
<author>
<name>Amitay Isaacs</name>
<email>amitay@gmail.com</email>
</author>
<published>2018-02-15T02:52:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=81dae71fa74bfd83a5701e4841b5a0a13cbe87a1'/>
<id>81dae71fa74bfd83a5701e4841b5a0a13cbe87a1</id>
<content type='text'>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13641

Signed-off-by: Amitay Isaacs &lt;amitay@gmail.com&gt;
Reviewed-by: Martin Schwenke &lt;martin@meltin.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13641

Signed-off-by: Amitay Isaacs &lt;amitay@gmail.com&gt;
Reviewed-by: Martin Schwenke &lt;martin@meltin.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ctdb-common: Add fd argument to ctdb_connection_list_read()</title>
<updated>2018-07-28T01:50:11+00:00</updated>
<author>
<name>Amitay Isaacs</name>
<email>amitay@gmail.com</email>
</author>
<published>2018-07-18T09:00:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=3bf753e830c20183ef4f3278880d3be362e53bef'/>
<id>3bf753e830c20183ef4f3278880d3be362e53bef</id>
<content type='text'>
This makes testing easier.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13520

Signed-off-by: Amitay Isaacs &lt;amitay@gmail.com&gt;
Reviewed-by: Martin Schwenke &lt;martin@meltin.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes testing easier.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13520

Signed-off-by: Amitay Isaacs &lt;amitay@gmail.com&gt;
Reviewed-by: Martin Schwenke &lt;martin@meltin.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ctdb-protocol: Avoid fgets in ctdb_connection_list_read</title>
<updated>2018-07-28T01:50:11+00:00</updated>
<author>
<name>Amitay Isaacs</name>
<email>amitay@gmail.com</email>
</author>
<published>2018-07-11T08:35:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=c9b42d27e6cf9e6ae36f44970f0a388edc737a7a'/>
<id>c9b42d27e6cf9e6ae36f44970f0a388edc737a7a</id>
<content type='text'>
C library buffering API can behave in unexpected fashion if underlying
fd for stdin, stdout or stderr is closed and re-opened.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13520

Signed-off-by: Amitay Isaacs &lt;amitay@gmail.com&gt;
Reviewed-by: Martin Schwenke &lt;martin@meltin.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
C library buffering API can behave in unexpected fashion if underlying
fd for stdin, stdout or stderr is closed and re-opened.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13520

Signed-off-by: Amitay Isaacs &lt;amitay@gmail.com&gt;
Reviewed-by: Martin Schwenke &lt;martin@meltin.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ctdb-protocol: Add function ctdb_sock_addr_mask_from_string()</title>
<updated>2018-07-27T03:45:20+00:00</updated>
<author>
<name>Martin Schwenke</name>
<email>martin@meltin.net</email>
</author>
<published>2018-06-07T21:13:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=4a1fb7296ca1c32fbb85ade2d5f104690b83929b'/>
<id>4a1fb7296ca1c32fbb85ade2d5f104690b83929b</id>
<content type='text'>
Signed-off-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Amitay Isaacs &lt;amitay@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Amitay Isaacs &lt;amitay@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ctdb-protocol: Fix compilation issue with strncpy()</title>
<updated>2018-07-27T03:45:20+00:00</updated>
<author>
<name>Martin Schwenke</name>
<email>martin@meltin.net</email>
</author>
<published>2018-07-26T01:01:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=3b56f2002a35b55b46958178c79aee519f0c5880'/>
<id>3b56f2002a35b55b46958178c79aee519f0c5880</id>
<content type='text'>
When configured with --picky-developer and using -O3 with gcc 8.1:

../protocol/protocol_util.c: In function ‘ctdb_sock_addr_from_string’:
../protocol/protocol_util.c:282:2: error: ‘strncpy’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
  strncpy(s, str, len+1);
  ^~~~~~~~~~~~~~~~~~~~~~
../protocol/protocol_util.c:277:8: note: length computed here
  len = strlen(str);
        ^~~~~~~~~~~

Use strlcpy() instead and check the result.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13545

Signed-off-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Amitay Isaacs &lt;amitay@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When configured with --picky-developer and using -O3 with gcc 8.1:

../protocol/protocol_util.c: In function ‘ctdb_sock_addr_from_string’:
../protocol/protocol_util.c:282:2: error: ‘strncpy’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
  strncpy(s, str, len+1);
  ^~~~~~~~~~~~~~~~~~~~~~
../protocol/protocol_util.c:277:8: note: length computed here
  len = strlen(str);
        ^~~~~~~~~~~

Use strlcpy() instead and check the result.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13545

Signed-off-by: Martin Schwenke &lt;martin@meltin.net&gt;
Reviewed-by: Amitay Isaacs &lt;amitay@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ctdb-protocol: Remove protocol for old event daemon</title>
<updated>2018-07-05T04:52:44+00:00</updated>
<author>
<name>Amitay Isaacs</name>
<email>amitay@gmail.com</email>
</author>
<published>2018-06-21T06:44:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=8250072a8116e04031e6a161c3bbc2af73fae431'/>
<id>8250072a8116e04031e6a161c3bbc2af73fae431</id>
<content type='text'>
This breaks the build.  The new eventd protocol cannot be introduced without
removing the old eventd protocol.

Signed-off-by: Amitay Isaacs &lt;amitay@gmail.com&gt;
Reviewed-by: Martin Schwenke &lt;martin@meltin.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This breaks the build.  The new eventd protocol cannot be introduced without
removing the old eventd protocol.

Signed-off-by: Amitay Isaacs &lt;amitay@gmail.com&gt;
Reviewed-by: Martin Schwenke &lt;martin@meltin.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ctdb-protocol: Separate protocol-basic subsystem</title>
<updated>2018-07-05T04:52:42+00:00</updated>
<author>
<name>Amitay Isaacs</name>
<email>amitay@gmail.com</email>
</author>
<published>2018-03-01T07:20:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=046d4688231c6a2338e581f0d87f2611c1e9f877'/>
<id>046d4688231c6a2338e581f0d87f2611c1e9f877</id>
<content type='text'>
This includes marshalling code for basic data types.  This will be used
by other daemons.

Signed-off-by: Amitay Isaacs &lt;amitay@gmail.com&gt;
Reviewed-by: Martin Schwenke &lt;martin@meltin.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This includes marshalling code for basic data types.  This will be used
by other daemons.

Signed-off-by: Amitay Isaacs &lt;amitay@gmail.com&gt;
Reviewed-by: Martin Schwenke &lt;martin@meltin.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
