--- qemu-0.9.1-orig/vl.c 2008-01-06 19:38:42.000000000 +0000 +++ qemu-0.9.1/vl.c 2009-01-19 15:56:32.000000000 +0000 @@ -4729,7 +4729,35 @@ if (get_param_value(buf, sizeof(buf), "hostname", p)) { pstrcpy(slirp_hostname, sizeof(slirp_hostname), buf); } - vlan->nb_host_devs++; + /*** BEGIN - Allow mac to be set in NAT ***/ + NICInfo *nd; + uint8_t *macaddr; + + if (nb_nics >= MAX_NICS) { + fprintf(stderr, "Too Many NICs\n"); + return -1; + } + nd = &nd_table[nb_nics]; + macaddr = nd->macaddr; + macaddr[0] = 0x52; + macaddr[1] = 0x54; + macaddr[2] = 0x00; + macaddr[3] = 0x12; + macaddr[4] = 0x34; + macaddr[5] = 0x56 + nb_nics; + + if (get_param_value(buf, sizeof(buf), "macaddr", p)) { + if (parse_macaddr(macaddr, buf) < 0) { + fprintf(stderr, "invalid syntax for ethernet address\n"); + return -1; + } + nd->vlan = vlan; + nb_nics++; + vlan->nb_guest_devs++; + }else { + /*** END - Allow mac to be set in NAT ***/ + vlan->nb_host_devs++; + } ret = net_slirp_init(vlan); } else #endif @@ -7547,7 +7575,7 @@ "-net nic[,vlan=n][,macaddr=addr][,model=type]\n" " create a new Network Interface Card and connect it to VLAN 'n'\n" #ifdef CONFIG_SLIRP - "-net user[,vlan=n][,hostname=host]\n" + "-net user[,vlan=n][,macaddr=addr][,hostname=host]\n" " connect the user mode network stack to VLAN 'n' and send\n" " hostname 'host' to DHCP clients\n" #endif