History log of /seL4-camkes-master/projects/lwip/src/netif/ppp/ipcp.c
Revision Date Author Comments
# 1e6c4ac0 06-Nov-2016 Sylvain Rochet <gradator@gradator.net>

PPP, IPCP: check that the peer is allowed to use the IP address it wants

This is done in the pppd upstream and was disabled because we don't have
the allowed addresses list required for the auth_ip_addr function.

This is mostly necessary for PPP in server mode to prevent the peer to
use the IP address it wants instead of the one we want, which is
currently allowed.

Rewrite auth_ip_addr in a simple way where we forbid PPP peer to use
loopback net, a multicast address or a reserved class address. Added
to that we consider that PPP in server mode with peer required to
authenticate must provide the peer IP address, reject any IP address
wanted by peer different than the one we wanted. This is actually
an allowed addresses "list" of one entry that follows what is done
in the unused auth_ip_addr function.


# b978d17c 05-Nov-2016 Sylvain Rochet <gradator@gradator.net>

PPP, IPCP: remove obvious FIXME

No-op. This is now unused code and it is pretty self explanatory what
int_option do; it checks that passed parameter is an unsigned integer.


# dde55c6c 05-Nov-2016 Sylvain Rochet <gradator@gradator.net>

PPP, IPCP: fix reset state before reconnecting

Commit 7df5496e7b revealed a regression introduced in commit 5a71509353
which broke IPCP reset state.

ask_for_local was set to 0 if ouraddr initial value is 0, if
ask_for_local was false go->ouraddr was cleared in reset callback,
commit 5a71509353 breaks it by removing this clearing. This regression
was silent because the whole ppp pcb runtime data was cleared before
reconnecting until commit 7df5496e7b which removed this giant clearing.

Fix it by reintroducing ask_for_local boolean value, with proper initial
value following what unused function ip_check_options do.

Fixes: 7df5496e7b ("PPP, rework initial/reconnect cleanup")
Fixes: 5a71509353 ("PPP, CORE, IPCP: removed useless ask_for_local boolean")


# 13fb616b 05-Oct-2016 Dirk Ziegelmeier <dirk@ziegelmeier.net>

Cleanup hton*/ntoh* function handling and platform abstraction
Let lwip use functions/macros prefixed by lwip_ internally to avoid naming clashes with external #includes.
Remove over-complicated #define handling in def.h
Make functions easier to override in cc.h. The following is sufficient now (no more LWIP_PLATFORM_BYTESWAP):
#define lwip_htons(x) <your_htons>
#define lwip_htonl(x) <your_htonl>


# 8dc77ef5 22-Jun-2016 Dirk Ziegelmeier <dirk@ziegelmeier.net>

doxygen updates - include IPv6 in documentation. Exclude include/netif/ppp/polarssl.
Convert TODO -> @todo


# 42d50eba 19-Jun-2016 Sylvain Rochet <gradator@gradator.net>

PPP, move protocols initialization from ppp_clear to ppp_new

What protocols init functions are meant to is to be called once to set
the default configuration before user specific configuration is set.

Until now, we reset to the default configuration just before
reconnecting, thus without allowing any time frame to let users change
it. That was fine until one user asked to be able to do that.

This change move protocols init functions calls from ppp_clear to
ppp_new, meaning user configuration is not overwritten anymore.


# ab989c35 12-May-2016 Axel Lin <axel.lin@ingics.com>

PPP: Use LWIP_ARRAYSIZE at appropriate places

Use LWIP_ARRAYSIZE to simplify the code.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Sylvain Rochet <gradator@gradator.net>
[Sylvain Rochet <gradator@gradator.net>: added missing casts]
Signed-off-by: Sylvain Rochet <gradator@gradator.net>


# 76d25bef 21-Apr-2016 Dirk Ziegelmeier <dirk@ziegelmeier.net>

Work on task #13907 PPP cleanups: Move PPP options from opt.h to dedicated ppp_opts.h file


# 83cddd89 18-Sep-2015 Sylvain Rochet <gradator@gradator.net>

PPP: more const and mixed u_char/char types fixes


# 41ee45d9 09-Sep-2015 Sylvain Rochet <gradator@gradator.net>

PPP: fix constness in PPP related files when PRINTPKT_SUPPORT is enabled


# fd53cad2 29-Apr-2015 Sylvain Rochet <gradator@gradator.net>

PPP, sifnpmode() is only useful if on demand is supported, build out if not

We don't support PPP on demand, don't build sifnpmode() which is only
useful for on demand if on demand is not supported.


# 1b6d6d0d 29-Apr-2015 Sylvain Rochet <gradator@gradator.net>

PPP, removed unnecessary memset()

Everything is cleared in ppp_clear(), we don't need to clear all
structures twice.


# 737a6921 23-Apr-2015 Sylvain Rochet <gradator@gradator.net>

PPP, place print packet debug codenames in ROM


# 99bcce78 08-Mar-2015 Sylvain Rochet <gradator@gradator.net>

PPP, IPCP, removed proxy ARP support


# 0e2ea94f 08-Mar-2015 Sylvain Rochet <gradator@gradator.net>

PPP, IPCP, removed WINS support


# 9cd7abdd 08-Mar-2015 Sylvain Rochet <gradator@gradator.net>

PPP, IPCP, fully removed DNS support from IPCP if LWIP_DNS is disabled


# dbacfe0a 08-Mar-2015 Sylvain Rochet <gradator@gradator.net>

PPP, IPCP, fully removed VJ support from IPCP if VJ_SUPPORT is disabled


# b3218d45 07-Mar-2015 Sylvain Rochet <gradator@gradator.net>

PPP, make DNS a little more optional if LWIP_DNS is unset


# 5a715093 27-Feb-2015 Sylvain Rochet <gradator@gradator.net>

PPP, CORE, IPCP: removed useless ask_for_local boolean

We don't need ask_for_local boolean, this is only useful for setup which
can determine the local IP address from the system hostname, which is
probably meaningless for embedded devices (and probably any devices).

It was actually only set by ip_check_options() which is commented out in
lwIP because we don't parse a config file nor check PPP configuration
(user is responsible about writing a configuration which is logical ;-).
Furthermore ask_for_local boolean never set actually had the wrong
default for PPP server setups.


# a1c5415f 21-Feb-2015 Sylvain Rochet <gradator@gradator.net>

PPP, CORE, disable VJ is PPP IPV4 is compiled out

VJ compression is only supported for PPP IPv4, compile out VJ support
if PPP IPv4 is not compiled.


# 00e8988b 21-Feb-2015 Sylvain Rochet <gradator@gradator.net>

PPP, IPv4 support is now optional

New compile time option: PPP_IPV4_SUPPORT

PPP IPv4 support can now be compiled out.


# 5e73068e 18-Feb-2015 Sylvain Rochet <gradator@gradator.net>

PPP, CORE, Removed (*datainput) from struct protent if not used

Data input is only used by CCP and ECP, which are not supported at this time,
remove this entry from struct protent to save some flash.


# b71d9ce3 18-Feb-2015 Sylvain Rochet <gradator@gradator.net>

PPP, CORE, Removed useless enabled_flag from struct protent

Our struct protent are const everywhere to save RAM, enable/disable
flag on a const struct is useless, saving some flash, removed.


# 369e9fbf 24-Dec-2014 Sylvain Rochet <gradator@gradator.net>

PPP, from PPPD upstream, Eliminate some unnecessary ifdefs


# 2b3e0201 24-Dec-2014 Sylvain Rochet <gradator@gradator.net>

PPP, fixed some compiler warnings

Using -Wall -pedantic -Wparentheses -Wsequence-point
-Wswitch-default -Wextra -Wundef -Wshadow -Wpointer-arith
-Wbad-function-cast -Wc++-compat -Wwrite-strings -Wold-style-definition
-Wmissing-prototypes -Wredundant-decls -Wnested-externs -Wno-address


# 36f47038 11-Nov-2014 chrysn <chrysn@fsfe.org>

use u32_t instead of u_int32_t

The style u_int32_t is not used anywhere else in the project, and is not
supported by the C standard, now using lwIP u32_t type. It was introduced
in 25e398a.


# da19974e 12-Oct-2014 Sylvain Rochet <gradator@gradator.net>

fixed bug #43235, cleared compiler warnings when using gcc with -Wextra option


# 25e398a8 15-Apr-2014 Sylvain Rochet <gradator@gradator.net>

PPP, from PPPD upstream, accept IPCP ConfAck packets containing MS-WINS options

pppd: Accept IPCP ConfAck packets containing MS-WINS options

Since last week I'm seeing IPCP negotiations going like this (and
eventually failing) when connecting to my ISP:

Jul 11 20:03:25 * pppd[4833]: sent [IPCP ConfReq id=0x2 <addr 0.0.0.0> <ms-dns1
0.0.0.0> <ms-dns2 0.0.0.0>]
Jul 11 20:03:26 * pppd[4833]: sent [IPCP ConfReq id=0x2 <addr 0.0.0.0> <ms-dns1
0.0.0.0> <ms-dns2 0.0.0.0>]
Jul 11 20:03:26 * pppd[4833]: rcvd [IPCP ConfNak id=0x2 <addr 10.167.246.198>
<ms-dns1 213.162.69.1> <ms-dns2 213.162.69.169> <ms-wins 124.6.168.55> <ms-wins
17.17.17.17>]
Jul 11 20:03:26 * pppd[4833]: sent [IPCP ConfReq id=0x3 <addr 10.167.246.198>
<ms-dns1 213.162.69.1> <ms-dns2 213.162.69.169> <ms-wins 124.6.168.55> <ms-wins
17.17.17.17>]
Jul 11 20:03:26 * pppd[4833]: rcvd [IPCP ConfAck id=0x3 <addr 10.167.246.198>
<ms-dns1 213.162.69.1> <ms-dns2 213.162.69.169> <ms-wins 124.6.168.55> <ms-wins
17.17.17.17>]
Jul 11 20:03:27 * pppd[4833]: sent [IPCP ConfReq id=0x3 <addr 10.167.246.198>
<ms-dns1 213.162.69.1> <ms-dns2 213.162.69.169> <ms-wins 124.6.168.55> <ms-wins
17.17.17.17>]
...

with the last two lines repeating until the IPCP error limit is
reached. As you can see, the peer added two extra fields in the
ConfNak reply. This is allowed, and indeed the following sent
ConfReq packet reflects this. However, when the ConfAck packet
is received, pppd discards it as invalid, because of the ms-wins
fields.

This fixes it.


# e5a554f0 13-Oct-2012 Sylvain Rochet <gradator@gradator.net>

PPP, adding const pragma to FSM callbacks, saving about 350 bytes in .data segment


# 9e4aa792 13-Oct-2012 Sylvain Rochet <gradator@gradator.net>

PPP, adding const pragma to struct protent, saving about 200 bytes in .data segment


# e9b29184 21-Aug-2012 Sylvain Rochet <gradator@gradator.net>

PPP, renamed all functions using common names in utils.c that can conflict with lwIP user code during link operation


# 1ddebcc8 18-Aug-2012 Sylvain Rochet <gradator@gradator.net>

Moved PPP headers into include/netif/ppp/, fixing bug #37040.


# 9e021cd1 14-Jul-2012 Sylvain Rochet <gradator@gradator.net>

improved PPP default interface management, added ppp_set_default() API call


# b4df26a7 09-Jul-2012 Sylvain Rochet <gradator@gradator.net>

some buggy compiler get confused with duplicated labels used in enum tcp_state and fsm.h, prepending PPP's ones


# 90faecd8 03-Jul-2012 Sylvain Rochet <gradator@gradator.net>

replaced u_int{8,16,32}_t to lwIP u{8,16,32}_t types

added padding to compiler generated bitfield, this is seen as best practice,
maybe it helps buggy compilers


# 2e069429 03-Jul-2012 Sylvain Rochet <gradator@gradator.net>

removed bool type, replaced by u8_t


# be2d3b58 16-Jun-2012 Sylvain Rochet <gradator@gradator.net>

moved back temporarily moved structure definitions from various headers to ppp.h during unit to ppp_pcb transition


# 3065b9f9 15-Jun-2012 Sylvain Rochet <gradator@gradator.net>

no more pcb->unit, new user selectable pcb->num for debugging purpose (like netif does)


# 93559a54 15-Jun-2012 Sylvain Rochet <gradator@gradator.net>

IPCP global variables moved to ppp_pcb


# f10ddea3 15-Jun-2012 Sylvain Rochet <gradator@gradator.net>

removed fsm->unit


# 4a8ff6d8 15-Jun-2012 Sylvain Rochet <gradator@gradator.net>

protent prototype switched from unit to ppp_pcb


# 4b7e3af7 15-Jun-2012 Sylvain Rochet <gradator@gradator.net>

IPCP and LCP structures moved to ppp_pcb


# 51bfac71 13-Jun-2012 Sylvain Rochet <gradator@gradator.net>

auth.c functions now use ppp_pcb* as first argument


# 6e2722a6 10-Jun-2012 Sylvain Rochet <gradator@gradator.net>

started the unit to ppp_pcb replacement


# 444646b6 09-Jun-2012 Sylvain Rochet <gradator@gradator.net>

renamed ppp_control to ppp_pcb, replaced unit number to ppp_pcb in all ppp.h declared functions


# 8bd508a7 09-Jun-2012 Sylvain Rochet <gradator@gradator.net>

moved ppp_settings to ppp_control, improved PPP API to really allow multiple PPP sessions


# 945f2912 09-Jun-2012 Sylvain Rochet <gradator@gradator.net>

using PPP_DEBUG instead of debug global variable


# 2ec79c03 08-Jun-2012 Sylvain Rochet <gradator@gradator.net>

unused ifunit global variable removed


# 2e6fa7f8 07-Jun-2012 Sylvain Rochet <gradator@gradator.net>

dns server support is done, clearing FIXME entries


# 7d7513c7 04-Jun-2012 Sylvain Rochet <gradator@gradator.net>

re-enabled DNS support


# d6e5ca72 04-Jun-2012 Sylvain Rochet <gradator@gradator.net>

setting default route by default


# 093c7b43 03-Jun-2012 Sylvain Rochet <gradator@gradator.net>

cleaned depreacted __P() and __V() macros, removed the legacy varargs.h header


# eb020656 03-Jun-2012 Sylvain Rochet <gradator@gradator.net>

disabled all plugins hooks


# 31456a6d 03-Jun-2012 Sylvain Rochet <gradator@gradator.net>

removed CamelCase in ppp.c and ppp_impl.h, added compat macro in ppp.h (but disabled for now)


# 3bad9ff5 03-Jun-2012 Sylvain Rochet <gradator@gradator.net>

ppp_impl.h is back!


# 2f5f86d6 03-Jun-2012 Sylvain Rochet <gradator@gradator.net>

don't build any PPP file if PPP support is disabled


# e1261c96 02-Jun-2012 Sylvain Rochet <gradator@gradator.net>

removed all system headers except the strict minimum


# 5531bca0 02-Jun-2012 Sylvain Rochet <gradator@gradator.net>

make it build with avr32-gcc

Disabled Unix-centric non necessary include files

Changed some include paths

Removed all printf() I put there and there for debugging.

It builds with the avr32 gcc toolchain, meaning we removed
all the pppd code requiring a unix base.


# 44c2a0a7 02-Jun-2012 Sylvain Rochet <gradator@gradator.net>

fixed most PPP compilation warnings with -pedantic


# d143acfc 02-Jun-2012 Sylvain Rochet <gradator@gradator.net>

fixed all PPP compilation warnings with -Wall


# 86ebc8e4 02-Jun-2012 Sylvain Rochet <gradator@gradator.net>

removed pppd.h and ppp.c, renamed pppmy.c to ppp.c and pppmy.h to ppp.h


# 7f9fea18 02-Jun-2012 Sylvain Rochet <gradator@gradator.net>

added pppmy.h in all .c files to easily find conflicts


# adb8b881 02-Jun-2012 Sylvain Rochet <gradator@gradator.net>

resolve conflit, ipcp.c defines ip_ntoa() which is already defined by lwIP, disabled ipcp.c::ip_ntoa() and using lwIP one


# 922d3716 02-Jun-2012 Sylvain Rochet <gradator@gradator.net>

PPP statistics optional (non working) compile time option added


# 6727c434 02-Jun-2012 Sylvain Rochet <gradator@gradator.net>

PPP notifier support is now a compile time option

However, as of now, the notify() function is empty, so it requires
some work if someone want to use it.

The notify feature allows someone to be able to follow the
state of the PPP stack (auth ok, ipcp up, initialise, ...), this
is like the callback feature set by pppOverEthernetOpen() and others,
but with more details.


# 668d5d9d 01-Jun-2012 Sylvain Rochet <gradator@gradator.net>

removed set/getenv functions


# 6c908ac7 01-Jun-2012 Sylvain Rochet <gradator@gradator.net>

removed more protent fields only used by print packets functions


# 2c4bd716 01-Jun-2012 Sylvain Rochet <gradator@gradator.net>

print packet functions are now optional


# 8b866bea 01-Jun-2012 Sylvain Rochet <gradator@gradator.net>

demand support is now a compile-time option

Obviously, it requires some wiring to know if there is new activity
on a not-yet established PPP interface with the default route
already set.

I don't think any lwIP user will ever need that, all should know
when to bring the link up and down.


# ee5fca7a 01-Jun-2012 Sylvain Rochet <gradator@gradator.net>

removed pathnames.h and pidfile support


# 7736cdae 22-May-2012 Sylvain Rochet <gradator@gradator.net>

replaced BCOPY to lwip-MEMCPY


# 42827cde 22-May-2012 Sylvain Rochet <gradator@gradator.net>

more and more ppp options removal


# b88dad40 21-May-2012 Sylvain Rochet <gradator@gradator.net>

disabled almost all PPP options strings and support as well as useless file-based auth code


# 4885b391 17-May-2012 Sylvain Rochet <gradator@gradator.net>

removed run_program() support


# a1d80c29 17-May-2012 Sylvain Rochet <gradator@gradator.net>

fixed demand_rexmit() with new IP addr, maybe we will never support demand or drop it, but it is already patched just in case


# ef59e952 17-May-2012 Sylvain Rochet <gradator@gradator.net>

added IPCP no/replace default route option from Debian patches, I like the idea


# eb75ae05 15-May-2012 Sylvain Rochet <gradator@gradator.net>

Early development stage of an attempt to port PPPd 2.4.5 to lwIP.

PPPoE works, PPPoS code is not ported at all.

I am using the RP-PPPoE server to do my tests using the following
configuration:

$ cat /etc/ppp/pppoe-server-options
debug
login
lcp-echo-interval 10
lcp-echo-failure 10
ms-dns 192.168.4.130
ms-dns 192.168.4.231
netmask 255.255.255.0
defaultroute
noipdefault
usepeerdns

$ cat /etc/ppp/allip
192.168.4.1-200

$ pppoe-server -C isp -L 192.168.4.254 -p /etc/ppp/allip -I tap0

Plus the usual auth-lines in /etc/ppp/pap-secrets and
/etc/ppp/chap-secrets .

And the unix port minimal "echo" project slightly modified to use
the "tcpip" API, so with threads, which I am going to commit with
NO_SYS as a -Dmacro.

It still use some of the linux'ism, such as syslog() and crypt(),

I do not want to drop the syslog() supports at the moment, this is
pretty useful to debug, and we may just convert the way the syslog() is
done to provide a trace feature to our PPP users, as a compile-time
option.


# d6227aec 11-Sep-2011 Simon Goldschmidt <goldsimon@gmx.de>

splitted ppp.h to an internal and external header file to get a clear separation of which functions an application or port may use (task #11281)


# 8d9fa634 22-Feb-2010 goldsimon <goldsimon>

PPP: use LWIP_DEBUGF() instead of ppp_trace()


# ea78d69c 22-Feb-2010 goldsimon <goldsimon>

Added debug output and missing casts


# 5fa0347e 29-Jan-2010 goldsimon <goldsimon>

Cleanly separate the portability file inet.h and its contents from the stack: moved htonX- functions to def.h (and the new def.c - they are not ipv4 dependent), let inet.h depend on ip_addr.h and not the other way round. This fixes bug #28732.


# 61e5301d 24-Jan-2010 goldsimon <goldsimon>

bug #26523: Compiler Warnings


# 1d45aa8d 31-Dec-2009 goldsimon <goldsimon>

Reorganised PPP source code from ucip structure to pppd structure to easily compare our code against the pppd code (around v2.3.1)


# 1d580967 06-Dec-2009 goldsimon <goldsimon>

Various small improvements from patch #6965 (removed _inet_ntoa, set PPP netif down before removing, change log message and comment)


# fc2d28b8 19-Dec-2007 fbernon <fbernon>

Minor changes in PPP (coding style, tabs, idents...)


# b714cd5f 29-Nov-2007 fbernon <fbernon>

First fix for bug #21664 "PPP code is broken".


# 7932bf48 11-Apr-2007 goldsimon <goldsimon>

Ongoing fix to patch #5822: converted more statements like (void)arg; into LWIP_UNUSED_ARG(arg);


# 45e36d9f 04-Jul-2004 likewise <likewise>

Dependencies on C library memset() etc., so include <string.h>.


# 30e5dfdd 10-Mar-2004 jani <jani>

fix inet_ntoa prototype to be standard, and fix ppp code that used the non-standard version


# 3c71c378 14-Nov-2003 likewise <likewise>

An overriden merge from DEVEL to main was needed as small changes had been made to main.


# 26d9b28f 02-Jun-2003 jani <jani>

sio and PPP updates from Marc


# ff63557d 30-May-2003 jani <jani>

Cleanups in PPP: C++ comments removed, make it compile for unixsim too. Does not work yet only compiles


# 31776e23 27-May-2003 jani <jani>

add PPP stack from Marc. Work in progress