From: Arran Cudbard-Bell Date: Thu, 29 Mar 2018 18:44:17 +0000 (+0100) Subject: Allow .1q tagged RADIUS packets in the default radsniff filter X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc2454c29bd11022ebfdb29967b1f104dbf9d0fe;p=thirdparty%2Ffreeradius-server.git Allow .1q tagged RADIUS packets in the default radsniff filter --- diff --git a/src/main/radsniff.c b/src/main/radsniff.c index 457a9a0ffbe..f710b691fee 100644 --- a/src/main/radsniff.c +++ b/src/main/radsniff.c @@ -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 PCAP filter (default is 'udp port or or %i')\n", FR_COA_UDP_PORT); + fprintf(output, " -f PCAP filter (default is 'udp port or 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 Capture packets from interface (defaults to all if supported).\n"); fprintf(output, " -I Read packets from \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; }