]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Allow .1q tagged RADIUS packets in the default radsniff filter
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 29 Mar 2018 18:44:17 +0000 (19:44 +0100)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 29 Mar 2018 18:44:17 +0000 (19:44 +0100)
src/main/radsniff.c

index 457a9a0ffbe43594b588fc7e748afd8d50f52eda..f710b691fee09b63872c3ebfed5179a9a948b1b8 100644 (file)
@@ -2137,7 +2137,9 @@ static void NEVER_RETURNS usage(int status)
        fprintf(output, "                        - noreq    - could be matched with the response.\n");
        fprintf(output, "                        - reused   - ID too soon.\n");
        fprintf(output, "                        - error    - decoding the packet.\n");
-       fprintf(output, "  -f <filter>           PCAP filter (default is 'udp port <port> or <port + 1> or %i')\n", FR_COA_UDP_PORT);
+       fprintf(output, "  -f <filter>           PCAP filter (default is 'udp port <port> or <port + 1> or %i'\n",
+               FR_COA_UDP_PORT);
+       fprintf(output, "                                     with extra rules to allow .1Q tagged packets)\n");
        fprintf(output, "  -h                    This help message.\n");
        fprintf(output, "  -i <interface>        Capture packets from interface (defaults to all if supported).\n");
        fprintf(output, "  -I <file>             Read packets from <file>\n");
@@ -2521,8 +2523,13 @@ int main(int argc, char *argv[])
 #endif
 
        if (!conf->pcap_filter) {
-               snprintf(buffer, sizeof(buffer), "udp port %d or %d or %d",
-                        port, port + 1, FR_COA_UDP_PORT);
+               /*
+                *      Using the VLAN keyword strips off the .1q tag
+                *      allowing the UDP filter to work.  Without this
+                *      tagged packaets aren't processed.
+                */
+               snprintf(buffer, sizeof(buffer), "(vlan and (udp port %d or %d or %d)) or (udp port %d or %d or %d)",
+                        port, port + 1, FR_COA_UDP_PORT, port, port + 1, FR_COA_UDP_PORT);
                conf->pcap_filter = buffer;
        }