mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
netmap: pkt-gen: fix ifname before cmp in source_hwaddr
In source_hwaddr(), the configured ifname is compared against all interfaces. However, in main(), the string 'netmap:' is prepended to the interface string if no explicit type is given. Therefore the ifname will not match any system interface and the source MAC address is always empty. Check for the leading 'netmap:' string and skip past it to match against system interfaces. Note that 'tap:' and 'pcap:' devices strip the type string from the ifname in main() so no further work is needed. MFC after: 7 days Submitted by: Brian Poole <brian90013@gmail.com>
This commit is contained in:
parent
95fc11577d
commit
eda8251188
1 changed files with 4 additions and 0 deletions
|
|
@ -684,6 +684,10 @@ source_hwaddr(const char *ifname, char *buf)
|
|||
return (-1);
|
||||
}
|
||||
|
||||
/* remove 'netmap:' prefix before comparing interfaces */
|
||||
if (!strncmp(ifname, "netmap:", 7))
|
||||
ifname = &ifname[7];
|
||||
|
||||
for (ifap = ifaphead; ifap; ifap = ifap->ifa_next) {
|
||||
struct sockaddr_dl *sdl =
|
||||
(struct sockaddr_dl *)ifap->ifa_addr;
|
||||
|
|
|
|||
Loading…
Reference in a new issue