Skip to content

Commit 1f0016a

Browse files
authored
Merge pull request #221 from palainp/update-arp-input
Update arp input
2 parents c1dd62b + dd97c0e commit 1f0016a

File tree

2 files changed

+13
-17
lines changed

2 files changed

+13
-17
lines changed

client_eth.ml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -99,22 +99,18 @@ module ARP = struct
9999
if req_ipv4 = t.client_link#other_ip then (
100100
Log.info (fun f -> pf f "ignoring request for client's own IP");
101101
None)
102-
else
103-
match lookup t req_ipv4 with
104-
| None ->
105-
Log.info (fun f -> pf f "unknown address; not responding");
106-
None
107-
| Some req_mac ->
108-
Log.info (fun f -> pf f "responding with %a" Macaddr.pp req_mac);
109-
Some
110-
{
111-
Arp_packet.operation = Arp_packet.Reply;
112-
(* The Target Hardware Address and IP are copied from the request *)
113-
target_ip = arp.Arp_packet.source_ip;
114-
target_mac = arp.Arp_packet.source_mac;
115-
source_ip = req_ipv4;
116-
source_mac = req_mac;
117-
}
102+
else (
103+
Log.info (fun f ->
104+
pf f "responding with %a" Macaddr.pp t.client_link#my_mac);
105+
Some
106+
{
107+
Arp_packet.operation = Arp_packet.Reply;
108+
(* The Target Hardware Address and IP are copied from the request *)
109+
target_ip = arp.Arp_packet.source_ip;
110+
target_mac = arp.Arp_packet.source_mac;
111+
source_ip = req_ipv4;
112+
source_mac = t.client_link#my_mac;
113+
})
118114

119115
let input_gratuitous t arp =
120116
let source_ip = arp.Arp_packet.source_ip in

qubes-firewall.sha256

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
adb38a193ccfd7df940637fbec755a8abc66114b3721db1da6a011f938b47734 dist/qubes-firewall.xen
1+
2bfb49696e59a8ffbb660399e52bd82ffadbd02437d282eb8daab568b3261999 dist/qubes-firewall.xen

0 commit comments

Comments
 (0)