mirror of
https://github.com/simh/simh.git
synced 2026-01-14 07:39:29 +00:00
ETHER: Fix bpf filter generation to not generate an invalid filter if only multicast addresses were provided
This commit is contained in:
parent
f59d86d7c0
commit
949aa30bef
@ -3031,6 +3031,11 @@ if ((addr_count > 0) && (dev->reflections > 0)) {
|
||||
sprintf(&buf2[strlen(buf2)], "%s(ether src %s)", (*buf2) ? " or " : "", mac);
|
||||
}
|
||||
sprintf (&buf[strlen(buf)], ")");
|
||||
if (1 == strlen(buf2)) { /* all addresses were multicast? */
|
||||
buf[strlen(buf)-6] = '\0'; /* Remove "not ()" */
|
||||
if (strlen(buf) > 0)
|
||||
buf[strlen(buf)-5] = '\0'; /* remove " and " */
|
||||
}
|
||||
}
|
||||
if (strlen(buf) > 0)
|
||||
sprintf(&buf[strlen(buf)], ")");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user