diff --git a/ctdb/common/system_aix.c b/ctdb/common/system_aix.c index d323e5c9718..2d35a229aad 100644 --- a/ctdb/common/system_aix.c +++ b/ctdb/common/system_aix.c @@ -50,7 +50,7 @@ int ctdb_sys_open_sending_socket(void) int s, ret; uint32_t one = 1; - s = socket(AF_INET, SOCK_RAW, htons(IPPROTO_RAW)); + s = socket(AF_INET, SOCK_RAW, IPPROTO_RAW); if (s == -1) { DEBUG(DEBUG_CRIT,(" failed to open raw socket (%s)\n", strerror(errno))); @@ -127,7 +127,7 @@ int ctdb_sys_send_tcp(const ctdb_sock_addr *dest, - s = socket(AF_INET, SOCK_RAW, htons(IPPROTO_RAW)); + s = socket(AF_INET, SOCK_RAW, IPPROTO_RAW); if (s == -1) { DEBUG(DEBUG_CRIT,(" failed to open raw socket (%s)\n", strerror(errno))); diff --git a/ctdb/common/system_common.c b/ctdb/common/system_common.c index e11bcb23440..a80189cd6c8 100644 --- a/ctdb/common/system_common.c +++ b/ctdb/common/system_common.c @@ -90,7 +90,7 @@ char *ctdb_sys_find_ifname(ctdb_sock_addr *addr) struct ifconf ifc; char *ptr; - 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))); diff --git a/ctdb/common/system_freebsd.c b/ctdb/common/system_freebsd.c index e88e9e2b00f..401c39620fd 100644 --- a/ctdb/common/system_freebsd.c +++ b/ctdb/common/system_freebsd.c @@ -164,7 +164,7 @@ int ctdb_sys_send_tcp(const ctdb_sock_addr *dest, ip4pkt.tcp.th_sum = 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))); diff --git a/ctdb/common/system_gnu.c b/ctdb/common/system_gnu.c index 12462050e86..b99607d10f4 100644 --- a/ctdb/common/system_gnu.c +++ b/ctdb/common/system_gnu.c @@ -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))); diff --git a/ctdb/common/system_kfreebsd.c b/ctdb/common/system_kfreebsd.c index b0303173c73..5d4bb5d36d7 100644 --- a/ctdb/common/system_kfreebsd.c +++ b/ctdb/common/system_kfreebsd.c @@ -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))); diff --git a/ctdb/common/system_linux.c b/ctdb/common/system_linux.c index 55c22c52b6c..20fa02112ef 100644 --- a/ctdb/common/system_linux.c +++ b/ctdb/common/system_linux.c @@ -100,7 +100,7 @@ int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const char *iface) switch (addr->ip.sin_family) { case AF_INET: - s = socket(PF_PACKET, SOCK_RAW, htons(ETHERTYPE_ARP)); + s = socket(PF_PACKET, SOCK_RAW, ETHERTYPE_ARP); if (s == -1){ DEBUG(DEBUG_CRIT,(__location__ " failed to open raw socket\n")); return -1; @@ -194,7 +194,7 @@ int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const char *iface) close(s); break; case AF_INET6: - s = socket(PF_PACKET, SOCK_RAW, htons(ETHERTYPE_ARP)); + s = socket(PF_PACKET, SOCK_RAW, ETHERTYPE_ARP); if (s == -1){ DEBUG(DEBUG_CRIT,(__location__ " failed to open raw socket\n")); return -1; @@ -370,7 +370,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))); @@ -460,7 +460,7 @@ int ctdb_sys_open_capture_socket(const char *iface, void **private_data) int s; /* Open a socket to capture all traffic */ - s = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); + s = socket(AF_PACKET, SOCK_RAW, ETH_P_ALL); if (s == -1) { DEBUG(DEBUG_CRIT,(__location__ " failed to open raw socket\n")); return -1;