ctdb-common: Use documented names for protocol family in socket()
[samba.git] / ctdb / common / system_gnu.c
index f38e622b3c85dd2f3af5cd8e0f6eeb8653df5d35..e5b8e05cfed47f7c12b7710d53d8ec397712c8d6 100644 (file)
 
 #include "lib/util/debug.h"
 
-#include "ctdb_logging.h"
-#include "ctdb_private.h"
+#include "protocol/protocol.h"
 
 #include <net/ethernet.h>
 #include <netinet/ip6.h>
 #include <net/if_arp.h>
 #include <pcap.h>
 
+#include "common/logging.h"
 #include "common/system.h"
 
 #ifndef ETHERTYPE_IP6
@@ -80,7 +80,7 @@ static uint16_t tcp_checksum6(uint16_t *data, size_t n, struct ip6_hdr *ip6)
  */
 int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const char *iface)
 {
-       /* FIXME GNU/Hurd: We dont do gratuitous arp yet */
+       /* FIXME GNU/Hurd: We don't do gratuitous arp yet */
        return -1;
 }
 
@@ -162,7 +162,7 @@ int ctdb_sys_send_tcp(const ctdb_sock_addr *dest,
                ip4pkt.tcp.check    = tcp_checksum((uint16_t *)&ip4pkt.tcp, sizeof(ip4pkt.tcp), &ip4pkt.ip);
 
                /* open a raw socket to send this segment from */
-               s = socket(AF_INET, SOCK_RAW, htons(IPPROTO_RAW));
+               s = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
                if (s == -1) {
                        DEBUG(DEBUG_CRIT,(__location__ " failed to open raw socket (%s)\n",
                                 strerror(errno)));
@@ -209,13 +209,13 @@ int ctdb_sys_send_tcp(const ctdb_sock_addr *dest,
                ip6pkt.tcp.window   = htons(1234);
                ip6pkt.tcp.check    = tcp_checksum6((uint16_t *)&ip6pkt.tcp, sizeof(ip6pkt.tcp), &ip6pkt.ip6);
 
-               s = socket(PF_INET6, SOCK_RAW, IPPROTO_RAW);
+               s = socket(AF_INET6, SOCK_RAW, IPPROTO_RAW);
                if (s == -1) {
                        DEBUG(DEBUG_CRIT, (__location__ " Failed to open sending socket\n"));
                        return -1;
 
                }
-               /* sendto() dont like if the port is set and the socket is
+               /* sendto() don't like if the port is set and the socket is
                   in raw mode.
                */
                tmpdest = discard_const(dest);
@@ -368,9 +368,3 @@ int ctdb_get_peer_pid(const int fd, pid_t *peer_pid)
        /* FIXME GNU/Hurd: get_peer_pid not implemented */
        return 1;
 }
-
-int ctdb_set_process_name(const char *name)
-{
-       /* FIXME GNU/Hurd: set_process_name not implemented */
-       return -ENOSYS;
-}