pppoe-server: MAX_INTERFACES 64 is a problem for ULS. We currently require 77 interfaces, this code just lifts the limit entirely and will keep adding interfaces for as much RAM as you have to store an array as required. Signed-off-by: Jaco Kroon diff -rau rp-pppoe-3.15/src.o/pppoe-server.c rp-pppoe-3.15/src/pppoe-server.c --- rp-pppoe-3.15.o/src/pppoe-server.c 2021-05-07 15:18:00.000000000 +0200 +++ rp-pppoe-3.15/src/pppoe-server.c 2021-12-07 21:53:46.755693003 +0200 @@ -115,8 +115,9 @@ ClientSession *BusySessions = NULL; /* Interfaces we're listening on */ -Interface interfaces[MAX_INTERFACES]; +Interface *interfaces = NULL; int NumInterfaces = 0; +int MaxInterfaces = 0; /* The number of session slots */ size_t NumSessionSlots; @@ -1235,11 +1236,16 @@ exit(1); } - memset(interfaces, 0, sizeof(interfaces)); - /* Initialize syslog */ openlog("pppoe-server", LOG_PID, LOG_DAEMON); + MaxInterfaces = INIT_INTERFACES; + interfaces = malloc(sizeof(*interfaces) * INIT_INTERFACES); + if (!interfaces) { + fprintf(stderr, "Out of memory allocating initial interfaces.\n"); + exit(1); + } + /* Default number of session slots */ NumSessionSlots = DEFAULT_MAX_SESSIONS; MaxSessionsPerMac = 0; /* No limit */ @@ -1406,10 +1412,14 @@ break; case 'I': - if (NumInterfaces >= MAX_INTERFACES) { - fprintf(stderr, "Too many -I options (max %d)\n", - MAX_INTERFACES); - exit(EXIT_FAILURE); + if (NumInterfaces >= MaxInterfaces) { + MaxInterfaces *= 2; + interfaces = realloc(interfaces, sizeof(*interfaces) * MaxInterfaces); + if (!interfaces) { + fprintf(stderr, "Memory allocation failure trying to increase MaxInterfaces to %d\n", + MaxInterfaces); + exit(EXIT_FAILURE); + } } found = 0; for (i=0; i