List all interface aliases on Windows. All aliases of one interface will be

given the same name, e.g., "eth0". Use -e to choose the interface and -S to
choose the source address.
This commit is contained in:
david 2007-11-26 23:44:20 +00:00
parent d2123e7011
commit d08af8a057
3 changed files with 55 additions and 24 deletions

View file

@ -326,3 +326,23 @@ Index: addr-util.c
if (len < 46)
return (NULL);
o Remember the entry->intf_len before zeroing entry in _ifrow_to_entry.
intf_loop relies on passing the length inside the structure to make sure
interface aliases are accounted for.
Index: src/intf-win32.c
===================================================================
--- src/intf-win32.c (revision 6288)
+++ src/intf-win32.c (working copy)
@@ -103,7 +103,12 @@
struct addr *ap, *lap;
int i;
+ /* The total length of the entry may be passed in inside entry.
+ Remember it and clear the entry. */
+ u_int intf_len = entry->intf_len;
memset(entry, 0, sizeof(*entry));
+ /* Restore the length. */
+ entry->intf_len = intf_len;
for (i = 0; i < intf->ifcombo[ifrow->dwType].cnt; i++) {
if (intf->ifcombo[ifrow->dwType].idx[i] == ifrow->dwIndex)

View file

@ -103,7 +103,12 @@ _ifrow_to_entry(intf_t *intf, MIB_IFROW *ifrow, struct intf_entry *entry)
struct addr *ap, *lap;
int i;
/* The total length of the entry may be passed in inside entry.
Remember it and clear the entry. */
u_int intf_len = entry->intf_len;
memset(entry, 0, sizeof(*entry));
/* Restore the length. */
entry->intf_len = intf_len;
for (i = 0; i < intf->ifcombo[ifrow->dwType].cnt; i++) {
if (intf->ifcombo[ifrow->dwType].idx[i] == ifrow->dwIndex)