Skip to content

Commit

Permalink
support interface monitor mode (ignores incoming packets) on set and …
Browse files Browse the repository at this point in the history
…conf routines
  • Loading branch information
yellowman committed Apr 15, 2021
1 parent b446e4f commit 42b94e3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions commands.c
Expand Up @@ -552,6 +552,9 @@ struct intlist Intlist[] = {
#ifdef IFXF_AUTOCONF6TEMP /* 6.9+ */
{ "autoconfprivacy", "Privacy addresses for IPv6 autoconf", CMPL0 0, 0, intxflags }, /* XXX bkcompat */
{ "temporary", "Temporary addresses for IPv6 autoconf", CMPL0 0, 0, intxflags },
#endif
#ifdef IFXF_MONITOR /* 6.9+ */
{ "monitor", "Monitor mode for incoming traffic", CMPL0 0, 0, intxflags },
#endif
{ "trunkport", "Add child interface(s) to trunk", CMPL0 0, 0, inttrunkport },
{ "trunkproto", "Define trunkproto", CMPL0 0, 0, inttrunkproto },
Expand Down
4 changes: 4 additions & 0 deletions conf.c
Expand Up @@ -751,6 +751,10 @@ void conf_ifxflags(FILE *output, int ifs, char *ifname)
#ifdef IFXF_AUTOCONF6TEMP /* 6.9+ */
if (ifr.ifr_flags & IFXF_AUTOCONF6TEMP)
fprintf(output, " temporary\n");
#endif
#ifdef IFXF_MONITOR /* 6.9+ */
if (ifr.ifr_flags & IFXF_MONITOR)
fprintf(output, " monitor\n");
#endif
if (ifr.ifr_flags & IFXF_WOL)
fprintf(output, " wol\n");
Expand Down
4 changes: 4 additions & 0 deletions if.c
Expand Up @@ -1821,6 +1821,10 @@ intxflags(char *ifname, int ifs, int argc, char **argv)
value = IFXF_AUTOCONF6TEMP;
} else if (isprefix(argv[0], "temporary")) {
value = IFXF_AUTOCONF6TEMP;
#endif
#ifdef IFXF_MONITOR /* 6.9+ */
} else if (isprefix(argv[0], "monitor")) {
value = IFXF_MONITOR;
#endif
} else if (isprefix(argv[0], "autoconf6")) {
value = IFXF_AUTOCONF6;
Expand Down

0 comments on commit 42b94e3

Please sign in to comment.