Skip to content

Commit

Permalink
garp harder (nth time's the charm)
Browse files Browse the repository at this point in the history
  • Loading branch information
yomimono committed Jul 18, 2016
1 parent fb0afed commit 4e2ec45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/arpv4/arpv4.ml
Expand Up @@ -128,9 +128,9 @@ module Make (Ethif : V1_LWT.ETHIF) (Clock : V1.CLOCK) (Time : V1_LWT.TIME) = str
(* Send a gratuitous ARP for our IP addresses *)
let output_garp t =
let sha = Ethif.mac t.ethif in
let tha = sha in
let tpa = Ipaddr.V4.any in
let tha = Macaddr.broadcast in
Lwt_list.iter_s (fun spa ->
let tpa = spa in
let arp = Arpv4_packet.({ op=Arpv4_wire.Request; tha; sha; tpa; spa }) in
Log.debug (fun f -> f "ARP: sending gratuitous from %a" Arpv4_packet.pp arp);
output t ~source:(Ethif.mac t.ethif) ~destination:Macaddr.broadcast arp
Expand Down
4 changes: 2 additions & 2 deletions lib_test/test_arp.ml
Expand Up @@ -112,9 +112,9 @@ let garp src_mac src_ip =
{
op = Arpv4_wire.Request;
sha = src_mac;
tha = src_mac;
tha = Macaddr.broadcast;
spa = src_ip;
tpa = Ipaddr.V4.any;
tpa = src_ip;
}

let fail_on_receipt netif buf =
Expand Down

0 comments on commit 4e2ec45

Please sign in to comment.