diff options
author | Ronnie Sahlberg <sahlberg@ronnie> | 2007-10-09 11:56:09 +1000 |
---|---|---|
committer | Ronnie Sahlberg <sahlberg@ronnie> | 2007-10-09 11:56:09 +1000 |
commit | 80cd82f8e42dead148b141ee9b0521f10529c4fe (patch) | |
tree | 1c13a424488791fdf4505caba4b2f88f1fe26315 /ctdb/client | |
parent | 292e9d91095e74a68349089575641fca835d6a3e (diff) | |
download | samba-80cd82f8e42dead148b141ee9b0521f10529c4fe.tar.gz samba-80cd82f8e42dead148b141ee9b0521f10529c4fe.tar.xz samba-80cd82f8e42dead148b141ee9b0521f10529c4fe.zip |
add a control to send gratious arps from the ctdb daemon
(This used to be ctdb commit 563819dd1acb344f95aabb4bad990b36f7ea4520)
Diffstat (limited to 'ctdb/client')
-rw-r--r-- | ctdb/client/ctdb_client.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c index b816d2d720..8957ad3145 100644 --- a/ctdb/client/ctdb_client.c +++ b/ctdb/client/ctdb_client.c @@ -2340,6 +2340,47 @@ int ctdb_ctrl_killtcp(struct ctdb_context *ctdb, } /* + send a gratious arp + */ +int ctdb_ctrl_gratious_arp(struct ctdb_context *ctdb, + struct timeval timeout, + uint32_t destnode, + struct sockaddr_in *sin, + const char *ifname) +{ + TDB_DATA data; + int32_t res; + int ret, len; + struct ctdb_control_gratious_arp *gratious_arp; + TALLOC_CTX *tmp_ctx = talloc_new(ctdb); + + + len = strlen(ifname)+1; + gratious_arp = talloc_size(tmp_ctx, + offsetof(struct ctdb_control_gratious_arp, iface) + len); + CTDB_NO_MEMORY(ctdb, gratious_arp); + + gratious_arp->sin = *sin; + gratious_arp->len = len; + memcpy(&gratious_arp->iface[0], ifname, len); + + + data.dsize = offsetof(struct ctdb_control_gratious_arp, iface) + len; + data.dptr = (unsigned char *)gratious_arp; + + ret = ctdb_control(ctdb, destnode, 0, CTDB_CONTROL_SEND_GRATIOUS_ARP, 0, data, NULL, + NULL, &res, &timeout, NULL); + if (ret != 0 || res != 0) { + DEBUG(0,(__location__ " ctdb_control for gratious_arp failed\n")); + talloc_free(tmp_ctx); + return -1; + } + + talloc_free(tmp_ctx); + return 0; +} + +/* get a list of all tcp tickles that a node knows about for a particular vnn */ int ctdb_ctrl_get_tcp_tickles(struct ctdb_context *ctdb, |