]> git.ozlabs.org Git - ppp.git/commitdiff
Export remote_number into REMOTENUMBER environment variable (#521)
authorJaco Kroon <jaco@uls.co.za>
Mon, 14 Oct 2024 08:03:09 +0000 (10:03 +0200)
committerGitHub <noreply@github.com>
Mon, 14 Oct 2024 08:03:09 +0000 (19:03 +1100)
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
pppd/auth.c
pppd/main.c
pppd/pppd.8

index aabab17715fec756ff7cb6d51ec32b3178fffdb9..f69492ea9dbf19693fab6463fe9305dc52c45f10 100644 (file)
@@ -492,6 +492,7 @@ ppp_set_remote_number(const char *buf)
 {
     if (buf) {
         strlcpy(remote_number, buf, sizeof(remote_number));
+        ppp_script_setenv("REMOTENUMBER", remote_number, 0);
     }
 }
 
index 7f73e0dac1e47b958db600384d4ad7a9984567a7..051bac82f090a042e91bfe395aefc25367c7e6b2 100644 (file)
@@ -852,6 +852,8 @@ set_ifunit(int iskey)
        create_pidfile(getpid());       /* write pid to file */
        create_linkpidfile(getpid());
     }
+    if (*remote_number)
+        ppp_script_setenv("REMOTENUMBER", remote_number, 0);
     run_net_script(path_net_init, 1);
 }
 
index c028c22cad7a7d67dbf0bdc7af588b604a34f248..3279e4b944789b0f7baf9faa8cb654a58300f101 100644 (file)
@@ -1780,6 +1780,12 @@ set when IPV6CP has come up.
 The authenticated name of the peer.  This is only set if the peer
 authenticates itself.
 .TP
+.B REMOTENUMBER
+The remote's number as provided to pppd by the remotenumber option.  The
+meaning of this varies based on the type of connection, xl2tpd for example can
+either provide the dialing number AVP or the remote's IP address.  pppoe-server
+typically provides the MAC address.
+.TP
 .B SPEED
 The baud rate of the tty device.
 .TP