[RP-PPPoE] Heads-up: New RP-PPPoE version coming soonish; testers wanted

For users of RP-PPPoE client/server software rp-pppoe at lists.skoll.ca
Wed Feb 8 13:26:32 EST 2023


Hi!

On Wed, Feb 08, 2023 at 09:31:17AM -0500, For users of RP-PPPoE client/server software via RP-PPPoE wrote:
> The PPP project is close to releasing PPP 2.5.0 and the public API has
> changed a bit.  You can grab the latest PPP from
I used rev ba7f7e053daae846a54a1d08d3d133a5f1266ace, but the Debian
package was not amenable to the update and the resulting pppd was
in such a sorry state that I'm inclined to say that rp-pppoe didn't
really work because /I/ fucked it, not because it was itself broken.

> If you could grab rp-pppoe master from https://github.com/dfskoll/rp-pppoe
> and give it a test, I'd appreciate it!
Rebased reasonably for me, built compatibly against sid pppd
(2.4.9-1+1.1) on x32, appears to work; I'll keep it running like this on
my site, assume success if no follow-ups.
  Feb 08 19:17:02 szarotka systemd[1]: Starting ppp at testppp.service - PPP connection for testppp...
  Feb 08 19:17:02 szarotka pppd[13501]: Plugin /usr/local/lib/rp-pppoe.so loaded.
  Feb 08 19:17:02 szarotka pppd[13501]: RP-PPPoE plugin version 3.16-dev compiled against pppd 2.4.9
  Feb 08 19:17:02 szarotka pppd[13501]: pppd 2.4.9 started by root, uid 0
  Feb 08 19:17:02 szarotka pppd[13501]: PPP session is 6174 (0x181e)
  ...

One thing I did see is the following warnings:
  gcc -O3 -Wall -Wstrict-prototypes  '-DPPPOE_PATH="/usr/sbin/pppoe"' '-DPPPD_PATH="/sbin/pppd"' '-DPLUGIN_PATH="/etc/ppp/plugins/rp-pppoe.so"' '-DPPPOE_SERVER_OPTIONS="/etc/ppp/pppoe-server-options"' -Ilibevent '-DRP_VERSION="3.16-dev"' -c -o pppoe-server.o pppoe-server.c
  In file included from pppoe-server.c:44:
  pppoe-server.c: In function ‘handle_status’:
  pppoe-server.c:2253:55: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=]
   2253 | #define opt_outp(o, fmt, ...)   cs_ret_printf(client, "%20s: " fmt "\n", o, ## __VA_ARGS__)
        |                                                       ^~~~~~~~
  control_socket.h:38:46: note: in definition of macro ‘cs_printf’
     38 | #define cs_printf(...) control_socket_printf(__VA_ARGS__)
        |                                              ^~~~~~~~~~~
  pppoe-server.c:2253:33: note: in expansion of macro ‘cs_ret_printf’
   2253 | #define opt_outp(o, fmt, ...)   cs_ret_printf(client, "%20s: " fmt "\n", o, ## __VA_ARGS__)
        |                                 ^~~~~~~~~~~~~
  pppoe-server.c:2254:60: note: in expansion of macro ‘opt_outp’
   2254 | #define opt_status(o, fmt, ...) do { if (opt_matches(o)) { opt_outp(o, fmt, ## __VA_ARGS__); }} while(0)
        |                                                            ^~~~~~~~
  pppoe-server.c:2273:5: note: in expansion of macro ‘opt_status’
   2273 |     opt_status("active sessions", "%lu", NumActiveSessions);
        |     ^~~~~~~~~~
  pppoe-server.c:2253:55: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=]
   2253 | #define opt_outp(o, fmt, ...)   cs_ret_printf(client, "%20s: " fmt "\n", o, ## __VA_ARGS__)
        |                                                       ^~~~~~~~
  control_socket.h:38:46: note: in definition of macro ‘cs_printf’
     38 | #define cs_printf(...) control_socket_printf(__VA_ARGS__)
        |                                              ^~~~~~~~~~~
  pppoe-server.c:2253:33: note: in expansion of macro ‘cs_ret_printf’
   2253 | #define opt_outp(o, fmt, ...)   cs_ret_printf(client, "%20s: " fmt "\n", o, ## __VA_ARGS__)
        |                                 ^~~~~~~~~~~~~
  pppoe-server.c:2254:60: note: in expansion of macro ‘opt_outp’
   2254 | #define opt_status(o, fmt, ...) do { if (opt_matches(o)) { opt_outp(o, fmt, ## __VA_ARGS__); }} while(0)
        |                                                            ^~~~~~~~
  pppoe-server.c:2274:5: note: in expansion of macro ‘opt_status’
   2274 |     opt_status("maximum sessions", "%lu", NumSessionSlots);
        |     ^~~~~~~~~~
and, indeed, they're both size_ts being formatted as unsigned longs;
scissor-patch fixing this below.

Best,
-- >8 --
Subject: [PATCH] Format Num{ActiveSessions,SessionSlots} with %zu since
 they're size_ts

---
 src/pppoe-server.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/pppoe-server.c b/src/pppoe-server.c
index 64b775d..c9c525c 100644
--- a/src/pppoe-server.c
+++ b/src/pppoe-server.c
@@ -2270,8 +2270,8 @@ static int handle_status(ClientConnection *client, const char* const* argv, int
     if (opt[wlen-1] == ' ')
 	--wlen;
 
-    opt_status("active sessions", "%lu", NumActiveSessions);
-    opt_status("maximum sessions", "%lu", NumSessionSlots);
+    opt_status("active sessions", "%zu", NumActiveSessions);
+    opt_status("maximum sessions", "%zu", NumSessionSlots);
     opt_status("sessions per mac", "%d", MaxSessionsPerMac);
     opt_status("interface count", "%d", NumInterfaces);
     opt_status("global drain", "%s", drain_string[draining]);
-- 
2.39.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://dianne.skoll.ca/pipermail/rp-pppoe/attachments/20230208/7a381e80/attachment.sig>


More information about the RP-PPPoE mailing list