Commit 3450df304d6f6ad279a8c9ae98984898ea737a44
1 parent
457772e6
make qemu_announce_self handle non contiguous net tables (Marcelo Tosatti)
With hotplug nd_table might contain holes. Noticed by Eduardo Habkost. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6844 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
3 additions
and
1 deletions
savevm.c
... | ... | @@ -122,7 +122,9 @@ void qemu_announce_self(void) |
122 | 122 | VLANClientState *vc; |
123 | 123 | uint8_t buf[256]; |
124 | 124 | |
125 | - for (i = 0; i < nb_nics; i++) { | |
125 | + for (i = 0; i < MAX_NICS; i++) { | |
126 | + if (!nd_table[i].used) | |
127 | + continue; | |
126 | 128 | len = announce_self_create(buf, nd_table[i].macaddr); |
127 | 129 | vlan = nd_table[i].vlan; |
128 | 130 | for(vc = vlan->first_client; vc != NULL; vc = vc->next) { | ... | ... |