kvm tools: Add ivshmem device
[linux-2.6/next.git] / tools / kvm / net / uip / arp.c
blob98423da6cb19b1268b92335423f6e708cbbf3596
1 #include "kvm/uip.h"
3 int uip_tx_do_arp(struct uip_tx_arg *arg)
5 struct uip_arp *arp, *arp2;
6 struct uip_info *info;
7 struct uip_buf *buf;
9 info = arg->info;
10 buf = uip_buf_clone(arg);
12 arp = (struct uip_arp *)(arg->eth);
13 arp2 = (struct uip_arp *)(buf->eth);
16 * ARP replay code: 2
18 arp2->op = htons(0x2);
19 arp2->dmac = arp->smac;
20 arp2->dip = arp->sip;
22 if (arp->dip == htonl(info->host_ip)) {
23 arp2->smac = info->host_mac;
24 arp2->sip = htonl(info->host_ip);
26 uip_buf_set_used(info, buf);
29 return 0;