]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
just use talloc. Fixes #3444
authorAlan T. DeKok <aland@freeradius.org>
Sat, 9 May 2020 12:47:20 +0000 (08:47 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 9 May 2020 12:47:49 +0000 (08:47 -0400)
And use inst->filter for 'and %s', instead of the "filter"

src/modules/proto_arp/proto_arp_ethernet.c

index d3e7170b59f54bc90daeaad1cbcd1d516aba7247..4ede083952b0c89d5d16ef466e426cfadd26a613 100644 (file)
@@ -178,7 +178,6 @@ static int mod_open(fr_listen_t *li)
        CONF_SECTION                    *server_cs;
        CONF_ITEM                       *ci;
        char const                      *filter;
-       char                            buffer[256];
 
        thread->pcap = fr_pcap_init(thread, inst->interface, PCAP_INTERFACE_IN);
        if (!thread->pcap) {
@@ -197,8 +196,7 @@ static int mod_open(fr_listen_t *li)
        if (!inst->filter) {
                filter = "arp";
        } else {
-               filter = buffer;
-               snprintf(buffer, sizeof(buffer), "arp and %s", filter);
+               filter = talloc_asprintf(li, "arp and %s", inst->filter);
        }
 
        if (fr_pcap_apply_filter(thread->pcap, filter) < 0) {