1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-26 12:01:34 +01:00

Fixed some bugs in Dot11 and DNS. Most of the code uses host_to_be and be_to_host.

This commit is contained in:
Matias Fontanini
2012-08-16 00:34:18 -03:00
parent 892bc0ecd3
commit 27f6eeccd4
23 changed files with 185 additions and 181 deletions

View File

@@ -100,8 +100,8 @@ bool EthernetII::send(PacketSender* sender) {
memset(&addr, 0, sizeof(struct sockaddr_ll));
addr.sll_family = Utils::net_to_host_s(PF_PACKET);
addr.sll_protocol = Utils::net_to_host_s(ETH_P_ALL);
addr.sll_family = Utils::host_to_be<uint16_t>(PF_PACKET);
addr.sll_protocol = Utils::host_to_be<uint16_t>(ETH_P_ALL);
addr.sll_halen = ADDR_SIZE;
addr.sll_ifindex = _iface.id();
memcpy(&(addr.sll_addr), _eth.dst_mac, ADDR_SIZE);
@@ -146,8 +146,8 @@ PDU *EthernetII::recv_response(PacketSender *sender) {
struct sockaddr_ll addr;
memset(&addr, 0, sizeof(struct sockaddr_ll));
addr.sll_family = Utils::net_to_host_s(PF_PACKET);
addr.sll_protocol = Utils::net_to_host_s(ETH_P_ALL);
addr.sll_family = Utils::host_to_be<uint16_t>(PF_PACKET);
addr.sll_protocol = Utils::host_to_be<uint16_t>(ETH_P_ALL);
addr.sll_halen = ADDR_SIZE;
addr.sll_ifindex = _iface.id();
memcpy(&(addr.sll_addr), _eth.dst_mac, ADDR_SIZE);