Skip to content

Commit

Permalink
Add "ipcp-accept-remote" pppd option
Browse files Browse the repository at this point in the history
PPP ≥ 2.5.0 requires this option to avoid this error:
	Peer refused to agree to our IP address
It makes sense to let the remote decide for the remote IP address.

Unfortunately, PPP < 2.5.0 does not like this option.
Of course it doesn't make any sense.
  • Loading branch information
DimitriPapadopoulos committed Oct 24, 2023
1 parent 6181a4a commit 0e31bb1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
11 changes: 11 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ AC_ARG_WITH([pppd],
with_ppp="no"
])
)
# this is specifically for pppd < 2.5.0
AC_ARG_ENABLE([legacy_pppd],
AS_HELP_STRING([--enable-legacy-pppd],
[work around pppd < 2.5.0 issues]))
# and this is for the ppp user space client on FreeBSD
AC_ARG_WITH([ppp],
AS_HELP_STRING([--with-ppp],
Expand Down Expand Up @@ -324,6 +328,13 @@ AS_IF([test "x$with_pppd" = "xyes"], [
AC_DEFINE(HAVE_USR_SBIN_PPPD, 0)
AC_MSG_NOTICE([HAVE_USR_SBIN_PPPD... 0])
])
AS_IF([test "x$enable_legacy_pppd" = "xyes"], [
AC_DEFINE(LEGACY_PPPD, 1)
AC_MSG_NOTICE([LEGACY_PPPD... 1])
],[
AC_DEFINE(LEGACY_PPPD, 0)
AC_MSG_NOTICE([LEGACY_PPPD... 0])
])
AS_IF([test "x$enable_proc" = "xyes"], [
AC_DEFINE(HAVE_PROC_NET_ROUTE, 1)
AC_MSG_NOTICE([HAVE_PROC_NET_ROUTE... 1])
Expand Down
24 changes: 21 additions & 3 deletions src/tunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,31 @@ static int pppd_run(struct tunnel *tunnel)
* of our local IP address, even if the local IP address
* was specified in an option.
*
* This option attempts to fix this:
* PPP < 2.5.0 requires this option to avoid this error:
* Peer refused to agree to our IP address
* This doesn't make sense, it should be the default:
* - we do not specify a local IP address,
* - we use option noipdefault to specifically ask the
* peer to supply the local IP address.
*
* Yet, this doesn't make sense: we do not specify
* a local IP address, and we use noipdefault.
* PPP ≥ 2.5.0 might not require it, but I don't dare
* removing it.
*/
"ipcp-accept-local",
#ifndef LEGACY_PPPD
/*
* With this option, pppd accepts the peer's idea of its
* (remote) IP address, even if the remote IP address was
* specified in an option.
*
* PPP ≥ 2.5.0 requires this option to avoid this error:
* Peer refused to agree to his IP address
*
* Unfortunately, PPP < 2.5.0 does not like this option.
* Again, this doesn't make sense.
*/
"ipcp-accept-remote",
#endif
"noaccomp",
"noauth",
"default-asyncmap",
Expand Down

0 comments on commit 0e31bb1

Please sign in to comment.