Skip to content

Commit

Permalink
Export remote_number into REMOTENUMBER environment variable (#521)
Browse files Browse the repository at this point in the history
Signed-off-by: Jaco Kroon <[email protected]>
  • Loading branch information
jkroonza authored Oct 14, 2024
1 parent 0f6a7c9 commit d540579
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions pppd/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
2 changes: 2 additions & 0 deletions pppd/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
6 changes: 6 additions & 0 deletions pppd/pppd.8
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d540579

Please sign in to comment.