summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/arp-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-06-15 01:26:01 +0200
committerDaniel Mack <github@zonque.org>2016-06-15 01:26:01 +0200
commit8e38570ebed346c00e58c3fcc998a4b305e83a36 (patch)
treee1c56e0c9b1ff621fb53cd98f48649f3fd999119 /src/libsystemd-network/arp-util.c
parent69281c49eb824b2cc854fdb5b97f134b1371be8d (diff)
tree-wide: htonl() is weird, let's use htobe32() instead (#3538)
Super-important change, yeah!
Diffstat (limited to 'src/libsystemd-network/arp-util.c')
-rw-r--r--src/libsystemd-network/arp-util.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libsystemd-network/arp-util.c b/src/libsystemd-network/arp-util.c
index 4660c7ea09..02028bf28a 100644
--- a/src/libsystemd-network/arp-util.c
+++ b/src/libsystemd-network/arp-util.c
@@ -79,7 +79,7 @@ int arp_network_bind_raw_socket(int ifindex, be32_t address, const struct ether_
};
union sockaddr_union link = {
.ll.sll_family = AF_PACKET,
- .ll.sll_protocol = htons(ETH_P_ARP),
+ .ll.sll_protocol = htobe16(ETH_P_ARP),
.ll.sll_ifindex = ifindex,
.ll.sll_halen = ETH_ALEN,
.ll.sll_addr = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
@@ -112,17 +112,17 @@ static int arp_send_packet(int fd, int ifindex,
bool announce) {
union sockaddr_union link = {
.ll.sll_family = AF_PACKET,
- .ll.sll_protocol = htons(ETH_P_ARP),
+ .ll.sll_protocol = htobe16(ETH_P_ARP),
.ll.sll_ifindex = ifindex,
.ll.sll_halen = ETH_ALEN,
.ll.sll_addr = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
};
struct ether_arp arp = {
- .ea_hdr.ar_hrd = htons(ARPHRD_ETHER), /* HTYPE */
- .ea_hdr.ar_pro = htons(ETHERTYPE_IP), /* PTYPE */
+ .ea_hdr.ar_hrd = htobe16(ARPHRD_ETHER), /* HTYPE */
+ .ea_hdr.ar_pro = htobe16(ETHERTYPE_IP), /* PTYPE */
.ea_hdr.ar_hln = ETH_ALEN, /* HLEN */
.ea_hdr.ar_pln = sizeof(be32_t), /* PLEN */
- .ea_hdr.ar_op = htons(ARPOP_REQUEST), /* REQUEST */
+ .ea_hdr.ar_op = htobe16(ARPOP_REQUEST), /* REQUEST */
};
int r;