Skip to content
Snippets Groups Projects
Commit a71eb083 authored by Michael Tuexen's avatar Michael Tuexen
Browse files

Avoid undefined behaviour.

parent f0ebe0e5
No related branches found
No related tags found
No related merge requests found
......@@ -168,12 +168,12 @@ void packet_socket_set_filter(struct packet_socket *psock,
}
/* Fill in the client-side ethernet address to look for. */
bpfcode.filter[1].k = ((client_ether[2] << 24) |
(client_ether[3] << 16) |
(client_ether[4] << 8) |
(client_ether[5]));
bpfcode.filter[3].k = ((client_ether[0] << 8) |
(client_ether[1]));
bpfcode.filter[1].k = (((u32)client_ether[2] << 24) |
((u32)client_ether[3] << 16) |
((u32)client_ether[4] << 8) |
((u32)client_ether[5]));
bpfcode.filter[3].k = (((u32)client_ether[0] << 8) |
((u32(client_ether[1]));
if (debug_logging) {
int i;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment