1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

ctdbd_conn: simplify ctdbd_register_ips

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Volker Lendecke 2015-05-20 08:12:46 +02:00
parent d669bd8243
commit 7ce9f3f3f5

View File

@ -1496,7 +1496,7 @@ NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn,
void *private_data)
{
struct ctdb_control_tcp_addr p;
TDB_DATA data;
TDB_DATA data = { .dptr = (uint8_t *)&p, .dsize = sizeof(p) };
NTSTATUS status;
struct sockaddr_storage client;
struct sockaddr_storage server;
@ -1513,14 +1513,10 @@ NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn,
case AF_INET:
memcpy(&p.dest.ip, &server, sizeof(p.dest.ip));
memcpy(&p.src.ip, &client, sizeof(p.src.ip));
data.dptr = (uint8_t *)&p;
data.dsize = sizeof(p);
break;
case AF_INET6:
memcpy(&p.dest.ip6, &server, sizeof(p.dest.ip6));
memcpy(&p.src.ip6, &client, sizeof(p.src.ip6));
data.dptr = (uint8_t *)&p;
data.dsize = sizeof(p);
break;
default:
return NT_STATUS_INTERNAL_ERROR;