Skip to content

Commit 7dc6dc0

Browse files
committed
pkt-gen: one more FreeBSD fix
1 parent 06832d3 commit 7dc6dc0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

apps/pkt-gen/pkt-gen.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,23 +1268,23 @@ send_arp(struct targ *targ)
12681268
hdr = &arp->ea_hdr;
12691269

12701270
eh->ether_type = htons(ETHERTYPE_ARP);
1271-
memset(eh->ether_dhost, 0xff, ETH_ALEN);
1272-
bcopy(src_mac, eh->ether_shost, ETH_ALEN);
1271+
memset(eh->ether_dhost, 0xff, 6);
1272+
bcopy(src_mac, eh->ether_shost, 6);
12731273
hdr->ar_hrd = htons(ARPHRD_ETHER);
12741274
hdr->ar_pro = htons(ETHERTYPE_IP);
1275-
hdr->ar_hln = ETH_ALEN;
1275+
hdr->ar_hln = 6;
12761276
hdr->ar_pln = 4;
12771277

12781278
if (need == 2) { /* first send a GARP */
12791279
hdr->ar_op = htons(ARPOP_REPLY);
1280-
bcopy(src_mac, arp->arp_sha, ETH_ALEN);
1281-
bcopy(src_mac, arp->arp_tha, ETH_ALEN);
1280+
bcopy(src_mac, arp->arp_sha, 6);
1281+
bcopy(src_mac, arp->arp_tha, 6);
12821282
bcopy(&dst_ip, arp->arp_spa, 4);
12831283
bcopy(&dst_ip, arp->arp_tpa, 4);
12841284
} else { /* then send an ARP request */
12851285
hdr->ar_op = htons(ARPOP_REQUEST);
1286-
bcopy(src_mac, arp->arp_sha, ETH_ALEN);
1287-
bzero(arp->arp_tha, ETH_ALEN);
1286+
bcopy(src_mac, arp->arp_sha, 6);
1287+
bzero(arp->arp_tha, 6);
12881288
bcopy(&src_ip, arp->arp_spa, 4);
12891289
bcopy(&dst_ip, arp->arp_tpa, 4);
12901290
}

0 commit comments

Comments
 (0)