Skip to content

Commit

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

Unfortunately, pppd < 2.5.0 does not like this option.
It doesn't make any sense to me.
  • Loading branch information
DimitriPapadopoulos committed Nov 3, 2023
1 parent b536bcd commit 1a6d2e9
Show file tree
Hide file tree
Showing 2 changed files with 34 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
26 changes: 23 additions & 3 deletions src/tunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,33 @@ 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:
* pppd < 2.5.0 requires this option to avoid this error:
* Peer refused to agree to our IP address
* This doesn't make sense to me. I feel it should be the
* default because:
* 1. we do not specify a local IP address,
* 2. 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.
* pppd ≥ 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.
*
* pppd ≥ 2.5.0 requires this option to avoid this error:
* Peer refused to agree to his IP address
* This makes perfect sense.
*
* Unfortunately, pppd < 2.5.0 does not like this option.
* Again, this doesn't make sense to me.
*/
"ipcp-accept-remote",
#endif
"noaccomp",
"noauth",
"default-asyncmap",
Expand Down

0 comments on commit 1a6d2e9

Please sign in to comment.