Commit Graph

4265 Commits

Author SHA1 Message Date
Sylvain Rochet
953dd5b628 PPP, PPPoE: remove useless checks
pppoe_softc_list is always not null when pppoe_find_softc_by_session is
called, furthermore pppoe_softc_list being null here does not hurt.

session is still checked whatsoever in pppoe_find_softc_by_session,
prechecking the session value for a value which can't really happen
except for forged frames does not add any value.
2016-08-08 00:14:45 +02:00
Sylvain Rochet
455a41822e PPP, PPPoL2TP: cleanup connection state reset
Remove unnecessary cleanup at the end of session, cleanup as much as
possible in the connect callback instead. It follows what PPPoE is
currently doing and it makes everything simpler to read.
2016-08-07 23:25:48 +02:00
Sylvain Rochet
1ea1026961 PPP, PPPoE: cleanup connection state reset
Instead of relying on cleanup at the end of session, cleanup as much as
possible in the connect callback. It removes duplicated code and make
everything simpler to read.

While we are at it, remove useless initialization code from create
and connect functions.
2016-08-07 23:25:48 +02:00
Sylvain Rochet
09c22e13fe PPP: close link protocol if LCP is not started in ppp_close
ppp_close might try to close LCP even if LCP is not started, it happens
because because the PPP session might be waiting for the link protocol
to come up and we do not check that.

We say in the PPP documentation that ppp_close() can be called anytime,
so, if link protocol is currently trying to connect, we must cancel
the link connection.

Fix it by calling the link protocol disconnect callback if LCP is not
started yet.
2016-08-07 23:25:48 +02:00
Sylvain Rochet
7c02a85424 PPP, PPPoE: add support for disconnecting in link initiation state in disconnect callback
Disconnect callback does not currently support a disconnect event while
initiation is in progress. Retry timer is not stopped and PADT frame is
sent whatever the current state is. PADT frame can only be sent if we
received a PADS frame, otherwise sc_session is 0 and sending a PADT
frame is meaningless.

Fix both issues to allow calling the disconnect callback whatever the
PPPoE state is.
2016-08-07 23:25:48 +02:00
Sylvain Rochet
d15ebc6a4c PPP: don't restart LCP closing if termination is already in progress
We say in the PPP documentation that ppp_close() can be called anytime,
as of today, this is not entirely true, there are still conditions that
are not handled properly.

If PPP is already disconnecting, ppp_close() must do nothing and returns
ERR_INPROGRESS instead of messing up the PPP disconnection state.
2016-08-07 23:25:48 +02:00
Sylvain Rochet
f185104ac6 PPP: revamp PPP state order
Master state is almost exactly the same thing as dead state, move it
next to dead state. Holdoff state is actually the state just before
initialize, move it before initialize.

The goal is to be able to use > running or => terminate condition to
check a currently running disconnection phase, which is not possible
today without excluding master and holdoff states.
2016-08-07 23:25:48 +02:00
Sylvain Rochet
5811948b0a PPP: remove PPP_PHASE_MASTER conditions if multilink mode is disabled
PPP_PHASE_MASTER state is only used if multilink mode is enabled. Since
we don't support multilink mode checking for this state only add some
code for no value added at all.

Build-out PPP_PHASE_MASTER state check if multilink mode is disabled.
2016-08-07 23:25:48 +02:00
Sylvain Rochet
dd0779c204 PPP, move VJ_SUPPORT disabling if LWIP_TCP is not enabled to PPP options
Van Jacobson TCP header compression only apply if TCP is enabled,
therefore we need to disable VJ compression if TCP is disabled.

We already have conditions to enforce VJ disabling if IPv4 is disabled
or if PPPoS is disabled, add TCP to those conditions and remove
unecessary VJ_SUPPORT && LWIP_TCP conditions.
2016-08-07 23:25:48 +02:00
Dirk Ziegelmeier
f55c0e7864 Move rawapi.txt description to main page - this doc really should be found and read by users 2016-08-07 20:21:27 +02:00
Dirk Ziegelmeier
3ca4eb5cd8 Minor pbuf layer doc update 2016-08-07 20:21:27 +02:00
Axel Lin
0a7db8a9a5 PPP: remove double include for lwip/sys.h
Including it once is enough.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2016-08-07 12:35:50 +02:00
Dirk Ziegelmeier
0673fcdb44 Fix mentioning functions that do not take pbufs as argument in pbuf layer docs 2016-08-07 10:16:18 +02:00
Dirk Ziegelmeier
980a919c9a Don't document IP type specific output functions, users should use IP type independent ones 2016-08-07 10:13:50 +02:00
Dirk Ziegelmeier
8d07629b71 Some documentation cleanups and include more comments that have been already in code into doxygen docs 2016-08-07 10:05:34 +02:00
Dirk Ziegelmeier
cf66233873 PBUF layer documentation clarification 2016-08-06 22:28:12 +02:00
Dirk Ziegelmeier
b94c8ee76f Add some more functions and macros to documentation 2016-08-06 22:16:49 +02:00
Dirk Ziegelmeier
73131b1677 Fix doxygen warning in ip6.c 2016-08-06 20:29:35 +02:00
Dirk Ziegelmeier
87855b0e0e Update doxgen docs: PBUF layers, IPv4 and IPv6 functions, add some missing tcp raw API functions 2016-08-06 20:28:49 +02:00
Dirk Ziegelmeier
70ee63ef3d Documentation: Add example code for NO_SYS use case 2016-08-05 09:53:50 +02:00
Sylvain Rochet
c2a5480ac7 PPP: remove useless ppp_link_start function
This function only set PPP to initialize phase, and it is only called at
the very beginning of functions where it is called. It means we could
as well set the initialize phase before calling those functions in the
PPP core.
2016-08-04 23:52:54 +02:00
Sylvain Rochet
01561b26ef PPP: set phase to establish before starting LCP
PPP is currently in initialize phase until authentication is started
or until we start IPCP negotiation.

It works, because PPP states are mostly used for user information, most
state are actually useless for PPP itself. Being in initialize state
while PPP is started is not very consistent, switch to establish phase
before starting LCP.
2016-08-04 23:43:46 +02:00
Sylvain Rochet
9b47b6393b PPP, PPPoE: remove useless PPPoE state conditions
sc->sc_ethif can't be NULL, it is set definitively in pppoe_create.

PPPoE can't by anything else than PADI sent in pppoe_send_padi, it
is only called when this is true.

PPPoE state can't be anything else than initial state in
pppoe_connect, this function is called from PPP core only when PPP
is in the dead phase, if PPP is in the dead phase it means the link
protocol is dead as well.

PPPoE can't be anything else than data phase in pppoe_disconnect
this function is only called by PPP core only when PPP session is up,
if PPP session is UP it means the link protocol is UP as well.

PPPoE can't by anything else than PADR sent in pppoe_send_padr, it
is only called when this is true.

PPPoE can't by anything else than PADO sent in pppoe_send_pado, it
is only called when this is true.

PPPoE can't by anything else than PADO sent in pppoe_send_pads, it
is only called when this is true.

PPPoE can't be anything else than session phase in pppoe_xmit,
function is only called by pppoe_write and pppoe_netif_output
which are both called by PPP core only when PPP session is up, if
PPP session is UP it means the link protocol is UP as well.
2016-08-04 23:06:30 +02:00
Sylvain Rochet
e8d8c5dcc9 PPP, L2TP: remove useless L2TP state conditions
L2TP state can't be anything else than initial state in
pppol2tp_connect, this function is called from PPP core only when PPP
is in the dead phase, if PPP is in the dead phase it means the link
protocol is dead as well.

L2TP can't be anything else than data phase in pppol2tp_xmit, this
function is only called by pppol2tp_write and pppol2tp_netif_output
which are both called by PPP core only when PPP session is up, if
PPP session is UP it means the link protocol is UP as well.

L2TP can't be anything else than data phase in pppol2tp_disconnect,
this function is only called by PPP core only when PPP session is up,
if PPP session is UP it means the link protocol is UP as well.
2016-08-04 23:03:03 +02:00
Sylvain Rochet
bae67915ab PPP: fix dead phase set too early
When we are disconnecting, we should switch to PPP dead phase at the
very end, because this is our final disconnection phase allowing
reconnect, therefore we should switch to dead phase after the link
protocol finished disconnecting.

We are currently switching to dead phase when LCP detected that the link
is down, this is obviously wrong. Fix this flaw by continuing in
disconnect phase until ppp_link_end is called from link protocol.
2016-08-04 22:06:45 +02:00
sg
5f774270b6 minor: tabs -> spaces 2016-08-03 21:25:32 +02:00
David van Moolenbroek
02221cf5dc Rename IP_HDRINCL to LWIP_IP_HDRINCL
In the BSD socket API world, IP_HDRINCL is a socket option for "raw"
sockets that indicates whether sent packets already include an IP
header.  Within lwIP, "IP_HDRINCL" is redefined as a special value
that indicates to lwIP-internal functions that an IP header is already
included.  While somewhat related, the two meanings are different and,
on platforms that define the IP_HDRINCL socket option, this results in
a conflict.  This patch renames the lwIP one to "LWIP_IP_HDRINCL",
thus resolving the conflict.
2016-08-03 20:51:21 +02:00
sg
dd110309e5 update some FILES list files 2016-08-03 20:21:54 +02:00
Dirk Ziegelmeier
da83946e75 Add one more documentation sentence in tcp.c 2016-08-03 12:34:16 +02:00
goldsimon
3d379c97ec IPv6 is NOT experimental any more :-) 2016-08-03 12:28:56 +02:00
goldsimon
018294d287 remove doubled include (tcpip.h) 2016-08-01 09:44:18 +02:00
goldsimon
247d2e97a0 minor: removed trailing spaces 2016-08-01 09:36:15 +02:00
goldsimon
92f385aaed fixed compiling lowpan6 for NO_SYS==1 2016-08-01 09:35:59 +02:00
Dirk Ziegelmeier
2f7e6d0661 Remove hard reference from netif.c to tcpip.c - avoids pulling in unnecessary code 2016-08-01 09:32:54 +02:00
Dirk Ziegelmeier
501cfbe02b Document netconn API some more 2016-07-31 16:59:12 +02:00
Dirk Ziegelmeier
a7979d7d24 Document lwIP error codes 2016-07-31 16:08:17 +02:00
Dirk Ziegelmeier
52d6d696ae Document lwIP version #defines 2016-07-31 16:05:42 +02:00
Dirk Ziegelmeier
e76b8b2551 Document SNMP MIB2 netif stats counters 2016-07-31 16:02:22 +02:00
Dirk Ziegelmeier
d00609257b Fix doxygen warning in netif.h (forgotten title) 2016-07-31 15:49:32 +02:00
Dirk Ziegelmeier
2c2d11fa4d Update documentation of netif_input function 2016-07-30 10:40:36 +02:00
Dirk Ziegelmeier
4cb7e31d2d Add missing #include in netif.c 2016-07-30 10:36:11 +02:00
Dirk Ziegelmeier
0c7d015ec4 Further improvement to netif input function autoselection: Select between netif_input() and tcpip_input() depending on NO_SYS setting 2016-07-30 10:29:14 +02:00
Dirk Ziegelmeier
4b67c582f6 Create netif_input function that decides according to netif flags where to pass an incoming packet.
Allow to pass a NULL pointer to netif_add() input function - if so, use the function mentioned above as input function.
2016-07-30 10:19:16 +02:00
Dirk Ziegelmeier
5f9c944da4 Add some netif related macros to docs 2016-07-30 10:06:06 +02:00
goldsimon
b7da649944 sio.h: include opt.h for checking #ifndef's 2016-07-29 08:01:41 +02:00
Dirk Ziegelmeier
90fba8773f Revert "Fix my messing of opt.h and the other options files - it was actually caused by a cyclic #include which I did not see"
It still does not work, due to #undef of options in opt.h, the documentation of many files is incomplete
This reverts commit 3f0dae29e9.
2016-07-28 23:34:16 +02:00
Dirk Ziegelmeier
3f0dae29e9 Fix my messing of opt.h and the other options files - it was actually caused by a cyclic #include which I did not see
Read the comments inside opt.h if you are interested.
2016-07-28 18:59:36 +02:00
Dirk Ziegelmeier
9fb9033815 Move MIB compiler to contrib, it's a better place for it 2016-07-28 14:33:15 +02:00
Dirk Ziegelmeier
8c620d9206 Restructure IPv6 config options
Add generate.bat to generate docs quickly under Windows OS
2016-07-28 09:21:16 +02:00
goldsimon
b4efa33b7c Removed the LWIP_HAVE_SLIPIF option: either the linker removes it when not used or you'll have to not compile it 2016-07-28 09:02:19 +02:00
Dirk Ziegelmeier
71dc8f8f53 opt.h loopback options cleanup 2016-07-28 09:00:37 +02:00
Dirk Ziegelmeier
161ee4f4b2 Work on opt.h hierarchy 2016-07-28 08:47:51 +02:00
Dirk Ziegelmeier
eac1005c9c Start to add hierarchy to opt.h doxygen docs 2016-07-28 08:41:21 +02:00
Dirk Ziegelmeier
b0284a6927 Move definition of options group from main_page.h to opt.h - it's more consistent like that 2016-07-28 08:27:49 +02:00
goldsimon
bdaec1691e doxygen: put the new timer defines into their own section 2016-07-28 08:20:18 +02:00
goldsimon
5bcaefddd4 lwiperf: improved documentation, removed unused enum members 2016-07-28 08:07:02 +02:00
Dirk Ziegelmeier
f7e12d835c Add NETBIOSNS options to doxygen docs 2016-07-28 08:05:57 +02:00
Dirk Ziegelmeier
93ad162aa6 Add SNMP and HTTPD options to doxygen docs 2016-07-28 08:03:32 +02:00
Dirk Ziegelmeier
f322e782f8 Add SNTP options to doxygen docs 2016-07-28 07:48:46 +02:00
sg
23cf45d252 d'oh! (fixed messed-up timeouts.h) 2016-07-27 21:48:29 +02:00
sg
56102c1b1c fixed messed-up opt.h 2016-07-27 21:47:36 +02:00
sg
53dc94d570 added LWIP_TIMERS_CUSTOM to override the default implementation of timeouts 2016-07-27 21:46:16 +02:00
sg
a326b057b3 Fix bug #48568 (timeouts does not support late firing properly) by assuming sys_check_timeouts() jitter can' be too bad 2016-07-27 21:17:15 +02:00
Dirk Ziegelmeier
b14032c531 Fix doxygen warning in opt.h 2016-07-27 20:34:23 +02:00
Dirk Ziegelmeier
70927892e1 Fix doxygen warning about debug parameters in memp.c
Remove documentation from them, it is not important
2016-07-27 20:34:23 +02:00
Dirk Ziegelmeier
b2b1ec14f5 Make hook macros visible to doxygen 2016-07-27 20:34:23 +02:00
Dirk Ziegelmeier
a39c040571 opt.h documentation cosmetics 2016-07-27 20:34:23 +02:00
Dirk Ziegelmeier
d89378e3f8 opt.h documentation cleanups 2016-07-27 20:34:23 +02:00
Dirk Ziegelmeier
63fdb3bb62 Document opt.h - due to a bad bug in doxygen, I had to litter the whole file with "|| __DOXYGEN__" to make it work :-(
Doxygen does not handle #ifndef foo #define foo #endif properly. It does not see the #define foo inside.
If someone has objections or a fix for it, please tell me.
2016-07-27 20:34:23 +02:00
Dirk Ziegelmeier
31f941e172 More documentation updates 2016-07-27 20:34:23 +02:00
sg
8ece46d5d2 snmp threadsync_data: "u8" -> "err" (typedef snmp_err_t is an enum, not u8_t) 2016-07-27 20:28:39 +02:00
Dirk Ziegelmeier
0cb1d1144d Integrate README file into doxygen docs instead of duplicating its content in main_page.h 2016-07-27 19:09:52 +02:00
Dirk Ziegelmeier
aece68639a Integrate snmp_agent.txt in doxygen documentation, delete outdated file 2016-07-27 18:58:28 +02:00
Dirk Ziegelmeier
eb3261d6e0 Add some more TCP RAW API functions to documentation 2016-07-27 13:46:54 +02:00
Dirk Ziegelmeier
0b5c393361 Improve documentation grouping in sys abstraction layer 2016-07-27 13:16:24 +02:00
Dirk Ziegelmeier
6c7eef7ac0 More documentation updates 2016-07-27 13:14:31 +02:00
Dirk Ziegelmeier
ef5c1b6590 Work on lwIP documentation 2016-07-27 13:09:33 +02:00
Dirk Ziegelmeier
ccc830c99c Work on lwIP documentation 2016-07-27 13:03:36 +02:00
goldsimon
af97f9b239 fixed gcc compiler error in do_memp_free_pool(): obviously, SYS_ARCH_DECL_PROTECT() must be the last declaration... 2016-07-27 08:26:42 +02:00
Dirk Ziegelmeier
6b524367a3 Documentation review with Simon, minor changes 2016-07-27 08:05:38 +02:00
Dirk Ziegelmeier
1993b0257c Document SNMP MIB2 functions 2016-07-27 06:37:26 +02:00
Dirk Ziegelmeier
6bce7509f7 Fix doxygen warning in sys.h due to wrong @ref 2016-07-26 23:17:07 +02:00
Dirk Ziegelmeier
4a7d07a2e0 Document netdb API, add socket functions implemented by lwip to documentation, just for reference 2016-07-26 22:06:54 +02:00
Dirk Ziegelmeier
765181a97c inet6.c was missing in Filelists.mk 2016-07-26 22:06:04 +02:00
Dirk Ziegelmeier
7b770dd9b6 Document 6LoWPAN and SLIP netif 2016-07-26 20:10:17 +02:00
Dirk Ziegelmeier
7f43fcab71 Document system abstraction layer in doxygen module style 2016-07-26 20:03:04 +02:00
Dirk Ziegelmeier
c7e20150f0 Update and restructure docs of some lwip core functions 2016-07-26 19:42:16 +02:00
Dirk Ziegelmeier
c6831648e2 Document apps in doxygen module style, create more top-level categories to structure documentation 2016-07-26 19:30:05 +02:00
Dirk Ziegelmeier
8a9de94b1f Restructure documentation. Create two top-level sections for thread-safe and callback-style APIs. 2016-07-26 18:39:53 +02:00
Dirk Ziegelmeier
8140c77d7d Document Socket API in doxygen module style 2016-07-26 18:26:58 +02:00
Dirk Ziegelmeier
67d674a59c Document IGMP and MLD6 API in doxygen module style 2016-07-26 18:20:30 +02:00
Dirk Ziegelmeier
dc0859b8d1 Document DHCP and AUTOIP API in doxygen module style 2016-07-26 18:10:05 +02:00
Dirk Ziegelmeier
9c10daba93 Document netif API in doxygen module style 2016-07-26 17:53:07 +02:00
Dirk Ziegelmeier
0fea2bc02e Document netconn API in doxygen module style 2016-07-26 17:40:55 +02:00
Dirk Ziegelmeier
ce19c59bb2 Document ip address function in doxygen module style 2016-07-26 17:11:01 +02:00
Dirk Ziegelmeier
8643782e5d Document netif and lwIP in doxygen module style 2016-07-26 16:53:27 +02:00
Dirk Ziegelmeier
bd79f6c055 Document DNS, memory pools and PBUFs as modules 2016-07-26 16:40:13 +02:00
Dirk Ziegelmeier
40bc80b551 Fix compile of snmp_mib2_system.c after my last SNMP API change 2016-07-26 16:39:34 +02:00
goldsimon
e030118750 moved MEM_LIBC_MALLOC code from mem.h to mem.c:
- it's not worth littering mem.h just to save some bytes to prevent the additional call;
- MEM_STATS now also work when MEM_LIBC_MALLOC is enabled
2016-07-26 15:02:36 +02:00
Dirk Ziegelmeier
59295be4ef Some more RAW API documentation updates
Improve structure of documentation: PPP is now a module, too
2016-07-26 13:53:59 +02:00
Dirk Ziegelmeier
10acd8303d Start to document public RAW API via doxygen 2016-07-26 13:38:43 +02:00
Dirk Ziegelmeier
73ee4cbbf7 MIB compiler: Back to .NET 4.0 to maintain compatibility to VS2010 2016-07-26 12:59:28 +02:00
Dirk Ziegelmeier
f6468510c6 Adapt MIB compiler to changed function signature of my last commit. Done with patch #9044: SNMP response for failed get operation. 2016-07-26 12:59:27 +02:00
Dirk Ziegelmeier
a62e4452a2 Work on patch #9044: SNMP response for failed get operation
Inspired by Marco Veeneman. Change signature of get_value function to return s16_t, where values <0 indicate an error. This is mapped to SNMP_ERR_GENERROR.
2016-07-26 12:59:26 +02:00
goldsimon
168ad22761 fixed custom pools after last memp cleanup 2016-07-26 12:26:52 +02:00
goldsimon
fb75f48751 Make lwip_cyclic_timers[] const 2016-07-26 09:08:29 +02:00
goldsimon
ca71eea56f httpd: reverted accidentally committed change (came in with de9054cb7a when fixing memp things) 2016-07-26 07:29:59 +02:00
sg
00598b0b46 fix mem stats for MEM_USE_POOLS==1 2016-07-25 22:08:32 +02:00
sg
4f5ff37c5d fixed bogus compiler error for MEM_USE_POOLS==1 and MEMP_USE_CUSTOM_POOLS==0 2016-07-25 21:43:45 +02:00
Dirk Ziegelmeier
80be1a6bf8 Add links to new documentation pages in the relevant files 2016-07-25 08:20:39 +02:00
Dirk Ziegelmeier
d75ece2505 Add some of the .txt files in /doc subdir to doxygen documentation 2016-07-25 08:16:39 +02:00
sg
194d624077 Finished aborted sentence on comment about NO_SYS :-) 2016-07-21 22:22:36 +02:00
sg
de9054cb7a memp: cleaned up MEMP_MEM_MALLOC:
- support memp stats when MEMP_MEM_MALLOC==1 (bug #48442);
- hide MEMP_MEM_MALLOC in memp.c instead of messing up the header file;
- make MEMP_OVERFLOW_CHECK work when MEMP_MEM_MALLOC==1
2016-07-21 22:17:32 +02:00
sg
413eeef5fa minor: moved sanity check from mem.c to init.c 2016-07-21 22:16:05 +02:00
sg
6e6ce4fb78 Make SYS_LIGHTWEIGHT_PROT==1 the default since it's more often used like that and it's more safe as default; improved some option's comments 2016-07-21 22:10:02 +02:00
sg
f98c3dd4b5 LWIP_MPU_COMPATIBLE: help dumb compilers to see 'msg' is used (MSVC :( 2016-07-21 21:54:13 +02:00
sg
806298583b Filelists.mk: make init.c the first file compiled, to have the sanity checks first 2016-07-21 20:47:43 +02:00
Sylvain Rochet
764343ebc7 Revert "PPP: restore PPPoE devices without Ethernet ARP support, i.e. PPPoE only devices"
This reverts commit d43c092f17.

We don't actually need it, init.c is including ppp_opts.h and is doing
the following:

  #if !LWIP_ETHERNET && (LWIP_ARP || PPPOE_SUPPORT)
    #error "LWIP_ETHERNET needs to be turned on for LWIP_ARP or PPPOE_SUPPORT"
  #endif

so the LWIP_ETHERNET fixup is not necessary per se, compatibility with
previously used lwipopts.h files is broken but at least user is warned.
2016-07-21 13:53:43 +02:00
goldsimon
523b11e664 fixed bug #48543 (TCP sent callback may prematurely report sent data when only part of a segment is acked) and don't include SYN/FIN in snd_buf counter (patch by Ambroz Bizjak) 2016-07-21 13:47:52 +02:00
Sylvain Rochet
d43c092f17 PPP: restore PPPoE devices without Ethernet ARP support, i.e. PPPoE only devices
Ethernet support is required for PPPoE but Ethernet support is only set
by default in opt.h if ARP is enabled, which is wrong because the right
condition is ARP and/or PPPoE, unfortunately PPPOE_SUPPORT can't be used
in opt.h because it is not defined if ppp_opts.h is not included before
opt.h in user code.

Fixup the LWIP_ETHERNET configuration value in ppp_opts.h in order to
force Ethernet support if PPPoE is enabled.

Fixes: 3ad2ad2329 ("Remove reference to PPPOE_SUPPORT in opt.h - leads
    to compile errors because it has no default definition (only in
    ppp_opts.h)"
2016-07-21 13:19:04 +02:00
Dirk Ziegelmeier
9cc3fb2e63 Fix comment in opt.h 2016-07-21 12:58:03 +02:00
Dirk Ziegelmeier
802a4f2a14 Fix compiling of snmp_mib2_ip.c when ARP is not enabled 2016-07-21 12:54:15 +02:00
Dirk Ziegelmeier
3ad2ad2329 Remove reference to PPPOE_SUPPORT in opt.h - leads to compile errors because it has no default definition (only in ppp_opts.h) 2016-07-21 12:53:33 +02:00
goldsimon
e8ffac852e Fixed bug #48551 (autoip_supplied_address() does not work when address is first assigned); fixed AutoIP timeouts 2016-07-20 08:28:16 +02:00
sg
98d58ffd59 minor: fixed wrong indentation 2016-07-19 22:38:34 +02:00
sg
97b8e88e69 netif_set_addr(): when removing an address (setting address to ANY), we have to remove it *before* changing netmask/gw to ensure that tcp RST segment can be sent correctly 2016-07-19 22:34:22 +02:00
sg
24a339a609 autoip: made private things private, use etharp_* shortcuts instead of etharp_raw() 2016-07-19 22:27:20 +02:00
sg
86e419425b minor: code layout only 2016-07-19 22:06:59 +02:00
sg
d0a79ff085 fixed bug #48477 (ARP input packet might update static entry) 2016-07-19 22:01:42 +02:00
sg
dff46e3816 Fixed bug #48539 (possible crash when packet received in SYN_SENT state) 2016-07-19 21:23:21 +02:00
sg
b06f14c11f worked on UPGRADING for 2.0.0 2016-07-19 20:38:08 +02:00
goldsimon
579fffd2ec fixed task #14084: make dhcp_supplied_address() usable in netif change callbacks triggered by changing the netif address assigned by dhcp 2016-07-19 12:58:21 +02:00
Dirk Ziegelmeier
5d4c1432c2 Fix bug #48436: Naming clash for timers.c (with FreeRTOS)
Rename timers.* to timeouts.*
2016-07-19 12:44:12 +02:00
goldsimon
6adeb706a6 change tcp_pcb->acked to be a global variable: used in one call stack only (idea by Ambroz Bizjak) 2016-07-19 10:38:01 +02:00
Dirk Ziegelmeier
72208cddfa Rename ip_frag.* to ip4_frag.* 2016-07-19 10:12:56 +02:00
Dirk Ziegelmeier
7037b340c1 Move etharp to core/ipv4, which is a more appropriate place for it 2016-07-19 09:29:51 +02:00
Dirk Ziegelmeier
06c7404461 Fix bug #48510, DHCP requires ARP
Use solution 2 proposed by Jens Nielsen
2016-07-19 09:10:21 +02:00
goldsimon
6c0d78caaa Fixed trying to send RST for unconnected (but bound) pcb 2016-07-19 09:05:48 +02:00
Dirk Ziegelmeier
4ec3d29168 Fix bug #48504: tcp_debug_print_pcbs reads nonexisting tcp_pcb fields 2016-07-19 08:54:44 +02:00
Dirk Ziegelmeier
09636c5b92 Let lwip_stats appear in docs 2016-07-19 08:32:13 +02:00
Dirk Ziegelmeier
2f950a7dcc Some documentation updates 2016-07-18 23:00:41 +02:00
Dirk Ziegelmeier
4ea1d62d45 Update some doxygen comments 2016-07-16 17:56:29 +02:00
sg
421dab87e8 fixed bug #48476 (TCP sent callback called wrongly due to picking up old pcb->acked 2016-07-11 21:43:39 +02:00
Dirk Ziegelmeier
01e5d6d819 memp.c: No need to init variables located in BSS section 2016-07-08 11:44:28 +02:00
Ambroz Bizjak
18c332ae51 fixed bug #48402 (Bug in skipping over TCP options)
Signed-off-by: goldsimon <goldsimon@gmx.de>
2016-07-08 11:27:50 +02:00
goldsimon
9a355502e1 snmp: fix compiling traps :-( 2016-07-08 10:56:24 +02:00
goldsimon
52da49cd81 snmp: changed name (snmp_length_outbound_varbind -> snmp_varbind_length) 2016-07-08 10:24:06 +02:00
goldsimon
6293a835e9 fixed compiling: forgot to move one line :-( 2016-07-08 10:16:46 +02:00
goldsimon
2df636fe77 memp: fixed STATS initialization 2016-07-08 10:06:36 +02:00
goldsimon
e302b1bbd2 httpd: fixed using pools, fixed missing default value of LWIP_HTTPD_SSI_RAW, fixed typo 2016-07-08 10:06:35 +02:00
goldsimon
959042aa88 memp: fixed compiling various combinations of memp stats (display etc.) 2016-07-08 08:21:57 +02:00
Dirk Ziegelmeier
a463119597 Revert "MEMP memory can now be declared static since LWIP_DECLARE_MEMORY_ALIGNED was introduced today"
This reverts commit e9b0003085.

It should still be publically accessible to be able to add prototype declarations anyway.
2016-07-08 08:18:37 +02:00
Dirk Ziegelmeier
e0918d706e Re-add a few MEMP stats accessors - users may want to access/display MEMP stats 2016-07-08 08:17:46 +02:00
Dirk Ziegelmeier
b939e9536d Minor: move some macros from memp.h to memp_priv.h 2016-07-07 22:05:30 +02:00
Dirk Ziegelmeier
e9b0003085 MEMP memory can now be declared static since LWIP_DECLARE_MEMORY_ALIGNED was introduced today 2016-07-07 22:01:41 +02:00
Dirk Ziegelmeier
087ecab891 Add some comments to places where we cast through a void* to get rid of alignment warnings 2016-07-07 21:56:43 +02:00
Dirk Ziegelmeier
212eacd9d6 Fix bug #48356: private memp pools have no statistic counters
Implement struct stats_mem instance for each pool, let lwip_stats.mem[] point to these instances
2016-07-07 21:55:51 +02:00
Marco Veeneman
dcd52510ce Reduce code duplication in SNMP agent traps implementation.
See patch #9038: SNMP Traps with varbinds, file #37748 by Marco Veeneman
2016-07-07 21:00:07 +02:00
Dirk Ziegelmeier
98e92f6550 Move alignment related #defines from mem.h to a better place: arch.h.
mem.h should only describe heap API, not architecture/port specific alignment helper macros.
2016-07-07 13:51:34 +02:00
Dirk Ziegelmeier
b91e47b518 Implement portable and overridable allocation of memory buffers
Fixes bug #48300 (Private mempools allocate foreign memory), bug #48354 (Portable alignment defines/include required for static allocation) and bug #47092 (Tag memory buffers like memp_memory_xxx and ram_heap with a macro so that attributes can be attached to their definitions)

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2016-07-07 13:35:13 +02:00
goldsimon
811b237bd7 dns: fixed declaration and usage of DNS_LOOKUP_LOCAL_EXTERN() 2016-07-07 13:02:47 +02:00
goldsimon
7e3de89646 minor: coding style 2016-07-07 13:02:18 +02:00
Dirk Ziegelmeier
4b136d631a Fix (correct) clang warning about increased alignment requirements in netifapi.c and pppapi.c 2016-07-05 08:59:25 +02:00
Dirk Ziegelmeier
5a1b9bf808 SNMP traps quick fix: Do not return err_t as u16_t in snmp_varbind_len. This need further cleanup. 2016-07-05 08:48:59 +02:00
goldsimon
14ca418ac0 minor: coding style fixes 2016-07-05 07:36:51 +02:00
Dirk Ziegelmeier
cb5f7859fd Apply patch #9038: SNMP Traps with varbinds
Applied with modifications. Original patch from Marco Veeneman.
2016-07-04 21:11:20 +02:00
goldsimon
2fdea8b79b fixed bug #48398 (dns: entries reused during found-callback could be aborted if ttl==0) 2016-07-04 13:55:20 +02:00
Michael Brown
2e26fc9224 tcp: Avoid 3-second delay for a half-open connection
If lwIP encounters a half-open connection (e.g. due to a restarted
application reusing the same port numbers) it will correctly send a
RST but will not resend the SYN until one retransmission timeout later
(approximately three seconds).  This can increase the time taken by
lpxelinux.0 to fetch its configuration file from a few milliseconds to
around 30 seconds.

Fix by immediately retransmitting the SYN whenever a half-open
connection is detected.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: goldsimon <goldsimon@gmx.de>
2016-07-04 12:25:22 +02:00
goldsimon
fd83f4fb22 Fix bug #48359 (dns entries are not set to state DONE) 2016-07-04 10:22:20 +02:00
Dirk Ziegelmeier
afa2a96085 Apply patch from Ambroz Bizjak:
I think that "#define SZT_F PRIuPTR" has a much better chance
of being right, making the assumption that uintptr_t is the same as
size_t.
Dirk: I think Ambroz is right.
2016-07-03 09:30:47 +02:00
Sylvain Rochet
9d0546839c init: fix NO_SYS targets build
lwip/src/core/init.c:256:32: error: "LWIP_COMPAT_MUTEX" is not defined [-Werror=undef]
 #if LWIP_TCPIP_CORE_LOCKING && LWIP_COMPAT_MUTEX && !defined(LWIP_COMPAT_MUTEX_ALLOWED)
                                ^
Setting LWIP_TCPIP_CORE_LOCKING is meaningless for NO_SYS targets,
therefore checking if LWIP_COMPAT_MUTEX is set does not make sense.

Introduced by 42dfa71f97: Make LWIP_TCPIP_CORE_LOCKING==1 the default
(and warn if LWIP_COMPAT_MUTEX==1 in that case as mutexes are required
to prevent priority inversion on tcpip_thread operations)
2016-07-02 21:53:24 +02:00
Sylvain Rochet
28aaf2caf4 PPP: introduce ppp_set_neg_pcomp, ppp_set_neg_accomp, ppp_set_neg_asyncmap, ppp_set_asyncmap
We are now able to add as many macros as necessary to change the PPP
configuration. Those are various usually used PPP options.
2016-07-02 21:42:51 +02:00
Sylvain Rochet
40e9eae791 PPP: improve various comments on options 2016-07-02 21:24:26 +02:00
Sylvain Rochet
f0dbba6406 PPP, PPPoE, PPPoL2TP: enforce disabling of silent and passive modes
PPP is just the upper protocol for PPPoE and PPPoL2TP, meaning it is only
started once "E" or L2TP is established. Therefore waiting indefinitely
for LCP packets on the PPP side does not make sense at all, if the lower
level protocol is UP, PPP *MUST* comes up as well or we should restart from
the beginning.
2016-07-02 21:10:24 +02:00
Sylvain Rochet
a99fe1fa32 PPP, LCP: restart flag is not used, build out
We don't support restart mode. Build out unused restart LCP flag.
2016-07-02 21:05:01 +02:00
Sylvain Rochet
e7069d6e82 PPP: introduce ppp_set_passive and ppp_set_silent
There is two passive modes for PPPoS, passive more, for which we will
try to connect and then listen silently, and silent mode, for which we
will listen silently from the beginning.

Introduce ppp_set_passive and ppp_set_silent so the mode can be chosen
before connecting/listening.
2016-07-02 21:03:48 +02:00
Sylvain Rochet
b97c4d96e2 PPP, SERVER: fix build if PAP_SUPPORT is not enabled
If PAP_SUPPORT is not enabled, we can't consider a failed PAP auth as
a null auth.
2016-07-02 20:02:47 +02:00
Sylvain Rochet
f21aede031 PPP: don't build ppp_set_auth if no authenticator are enabled
For our few users which might disable all authenticators to save some
flash, ensure that everything using authentication is build out.
2016-07-02 19:43:08 +02:00
Sylvain Rochet
c1c3d0e1ba PPP: fix build when MSCHAP authentication feature is disabled at compile time
All modules using PolarSSL embedded library are now using pppcrypt.h.
This header use to be only necessary for MSCHAP and was not built if
MSCHAP wasn't enabled, we unfortunately left the build condition.

Introduced by 3417a02b25: PPP: add a function map for hashes and ciphers
to prepare for mbed TLS support.
2016-07-02 19:36:34 +02:00
Sylvain Rochet
50b5b4c4dd PPP, PPPAPI: remove useless pppapi_set_auth function
Setting PPP authentication most only be done when the PPP PCB is in the
dead phase (i.e. disconnected). This is safe to access the PPP PCB
members while the session is down, therefore providing a thread-safe
function of it is meaningless and it might even be misleading.

All our new ppp_set_* functions do not have their equivalent
pppapi_set_* functions and they are not going to have them. At least
we make ppp_set_auth consistent with all others ppp_set_*, so that it
doesn't look like special.
2016-07-02 19:09:50 +02:00
Sylvain Rochet
b9b36084a5 PPP: introduce ppp_set_mppe
Helper function to setup MPPE (Microsoft Point to Point Encryption) for
a PPP link. Allows enabling/disabled MPPE itself, enabling/disabling
stateless support, and whether we are willing to negotiate 40-bit
and/or 128-bit encryptions.
2016-07-02 18:53:59 +02:00
Sylvain Rochet
f226e107a6 PPP: updated pppd followup 2016-07-02 17:13:10 +02:00
Sylvain Rochet
d4f824398c PPP, from PPPD upstream: fix sign-extension when displaying bytes in octal
print_string() displays characters as \\%.03o but without first
casting it from "char" to "unsigned char" so it gets sign-extended
to an int. This causes output like \37777777630 instead of \230.

(Based from pppd commit 5e8c3cb256a7e86e3572a82a75d51c6850efdbdc)
2016-07-02 17:12:38 +02:00
Sylvain Rochet
b438a0d6fd PPP, PPPoE: fix potential out-of-bound if AC cookie is too long
Found by coverity.

Introduced by c0e7d54e37 "Removed 2 mem_mallocs: error string can be a
global variable, include memory for sc_ac_cookie in struct pppoe_softc;
commented out unused code (sc_service_name/sc_concentrator_name)".

Fixes it by bailing out if received AC cookie is to big for us, this
can't really happen anyway.
2016-07-02 16:20:57 +02:00
Sylvain Rochet
7c368b7f36 PPP, PPPoS: use offsetof in place of the traditional NULL hack
There is absolutely no reason I did it this way in the first
place, maybe I feared that not all compilers have a proper
implementation of offsetof() ? It sounds stupid.
2016-07-02 15:11:02 +02:00
goldsimon
06782c699c httpd: fixed persistent connections for files not containing HTTP header 2016-07-01 12:43:03 +02:00
sg
42dfa71f97 Make LWIP_TCPIP_CORE_LOCKING==1 the default (and warn if LWIP_COMPAT_MUTEX==1 in that case as mutexes are required to prevent priority inversion on tcpip_thread operations) 2016-06-30 22:37:37 +02:00
Dirk Ziegelmeier
d3e55185c6 Apply patch #9034: Use stdint.h and inttypes.h in lwip/arch.h
Ports now only need to define datatypes and format strings on compilers that do not provide these two headers. Known good: GCC, IAR. Known bad: MSVC 2010.
2016-06-30 20:15:22 +02:00
goldsimon
e6bc591a1e fixed bug #48170 (Vulnerable to TCP RST spoofing) (original patch by Fabian Koch) 2016-06-30 08:50:42 +02:00
goldsimon
d31d2ee882 Revert "fixed bug #48170 (patch by Fabian Koch)"
This reverts commit 236bc19422.
The fix introduced bug #48328 -> reverted
2016-06-30 08:41:50 +02:00
Dirk Ziegelmeier
91b5d8ad1e Patch by Marco Veeneman: Generic snmpv1 traps should be sent from .1.3.6.1.2.1.11 (iso.org.dod.internet.mgmt.mib-2.snmp). 2016-06-29 22:16:43 +02:00
Dirk Ziegelmeier
aecbefc728 Patch by Marco Veeneman: Tthe variable bindings field is missing in the trap message. Even if there are no varbinds attached to the trap, this field should still be present. 2016-06-29 22:14:37 +02:00
Sylvain Rochet
ecbe45bf43 PPP, VJ: fixes potentially unaligned *u16_t and *u32_t accesses
Unfortunately, there is no standard way to declare a pointer with
potentially unaligned accesses. The only portable way is to create
packed struct.

VJ support uses optimized accesses to IP and TCP struct to check a
whole part of them at once to speed up the (de)compressor.

This commit wrap potentially unaligned *u16_t and *u32_t accesses with
packed struct so all compilers are able to deal with them properly.

Closes: #48308
2016-06-28 22:58:47 +02:00
Dirk Ziegelmeier
a0e8c2dd8f Revert commit e40175ef05: Fix a few more CLANG alignment warnings - clang warns although the target struct is packed (and may therefore be unaligned) :-(
It was caused by a local problem on my PC, I forgot that I modified cc.h... :-( Sorry for that!
2016-06-28 21:54:48 +02:00
Dirk Ziegelmeier
500e748888 Fix [bug #48330] Memory leak in snmp_send_trap function
Forgot to free pbuf after sending it
2016-06-28 21:31:12 +02:00
Erik Ekman
4047702928 Fix clang warning about unreachable code
Do check with preprocessor instead
2016-06-27 22:32:18 +02:00
Dirk Ziegelmeier
5d356c96f5 Minor: cleanup my last commit 2016-06-27 20:57:22 +02:00
Dirk Ziegelmeier
39545d2c6d Fix clang warning about unreachable code 2016-06-27 20:56:21 +02:00
Dirk Ziegelmeier
e40175ef05 Fix a few more CLANG alignment warnings - clang warns although the target struct is packed (and may therefore be unaligned) :-( 2016-06-27 20:54:17 +02:00
goldsimon
2d7a6a5d94 remove "LWIP_HTTPD_MAX_CGI_PARAMETERS" from httpd.h (has already been moved to httpd_opts.h 2016-06-27 11:03:46 +02:00
goldsimon
c164869f6d snmp: use 'tcpip_callback' instead of '.._with_block' 2016-06-27 11:01:34 +02:00
goldsimon
236bc19422 fixed bug #48170 (patch by Fabian Koch) 2016-06-27 10:31:36 +02:00
Sylvain Rochet
ddac5b1895 PPP: introduce ppp_set_listen_time
Wait for up to the specified milliseconds for a valid PPP packet from
the peer. At the end of this  time, or when a valid PPP packet is
received from the peer, we commence negotiation by sending our first
LCP packet.

This is useful because PPP does not deal properly when both peers
are sending the first LCP packet in the exact same time, which causes
delays because they both wait for a reply for their own packet.
2016-06-26 22:51:40 +02:00
Sylvain Rochet
9a70715371 PPP, SERVER: move silent mode set from pppos_listen to ppp_listen
This flag would be required for any low level protocol used. Move it
from pppos_listen to ppp_listen.
2016-06-26 22:37:41 +02:00
Sylvain Rochet
96296947fc PPP: introduce ppp_set_auth_required macro
PPP auth required flag is currently hardcoded to true if PPP is
acting as a server and set to false if PPP is acting as a client.

This is probably the most wanted behavior, but since we now have the
ability to change that at runtime, allow users to do it.

It means we can now have a server which asks the client to authenticate
or vice versa. This is pretty unusual thought. What we don't support
yet is mutual authentication with a different set of user and password
per direction which is even less usual.
2016-06-26 22:31:02 +02:00
Sylvain Rochet
9015c28406 PPP, DNS: introduce ppp_set_usepeerdns macro
PPP use peer DNS setting is currently hardcoded to true if PPP is
acting as a client and set to false if PPP is actinf as a server.

This is probably the most wanted behavior, but since we now have the
ability to change that at runtime, allow users to do it.

We don't have a way to have a different default configuration if the
PPP PCB is going to be used as a client or as a server, therefore the
default configuration should be fine for both of them. Since enabling
peer DNS by default is dangerous for server mode, the default is now
not to ask for DNS servers and it should now be explicitely enabled
if needed, update the documentation accordingly.
2016-06-26 21:36:48 +02:00
Sylvain Rochet
b77fcef1a5 PPP, L2TP: remove unnecessary l2tp->udp null check
l2tp->udp can't be null here, pppol2tp_create returns a NULL L2TP PCB
if UDP PCB failed to be created. Remove useless null check.
2016-06-26 21:17:54 +02:00
Sylvain Rochet
3d684cda23 PPP, PPPoS, SERVER: remove useless struct ppp_addrs* argument from pppos_listen
Now that we have helpers to set those members externaly, pppos_listen
struct ppp_addrs* argument does not add any value. In addition it
was not a well chosen design choice because the user needed to keep a
copy of struct ppp_addrs when listening again for a new connection.
2016-06-26 20:26:35 +02:00
Sylvain Rochet
71ca26b212 PPP, add configuration macros to set IPCP our, his, and DNS IPv4 addresses
Mostly for PPP server support, but not limited too, we need a way to
configure static IPv4 addresses for our side (our), peer side (his),
and two DNS server addresses if peer asks for them.
2016-06-26 19:44:44 +02:00
Sylvain Rochet
4a5422cd11 PPP, PPPoS, SERVER: fix DNS servers support
DNS servers should be set in IPCP allowoptions instead of wantoptions.
In addition if server mode is enabled we need to disable usepeerdns
config flag so we are not asking DNS servers to our client.
2016-06-26 19:16:51 +02:00
Dirk Ziegelmeier
38c0255fa2 Fix a few more CLANG format string warnings (from unix check project) 2016-06-25 13:24:48 +02:00
Dirk Ziegelmeier
102f5882d5 Fix several CLANG format string warnings 2016-06-25 13:06:31 +02:00
Dirk Ziegelmeier
19e2b15c41 Fix alignment warnings in snmp agent - we know these structs are aligned according to requirements when they are casted because they have been instantiated as the target type (clang) 2016-06-24 21:21:38 +02:00
Dirk Ziegelmeier
a929f418e7 Fix format string in httpd.c (clang) 2016-06-24 21:16:44 +02:00
Dirk Ziegelmeier
0116c3cd76 Fix "no newline at end of file" warnings (clang) 2016-06-24 21:16:12 +02:00
Dirk Ziegelmeier
2c1bd363e6 Try again - fix bug #48300: Private mempools allocate foreign memory 2016-06-24 12:33:20 +02:00
Sylvain Rochet
224d5a9f33 PPP, fix comment about opt.h (moved to ppp_opts.h)
PPP defines were moved from opt.h to ppp_opts.h but comments
referencing opt.h in PPP were not updated.
2016-06-23 23:17:39 +02:00
Dirk Ziegelmeier
98c741976b Fix bug #48300: Private mempools allocate foreign memory
Add padding to memory pool mem according to alignment
2016-06-23 20:20:19 +02:00
Dirk Ziegelmeier
502f08cb92 ip.h doxygen documentation updates 2016-06-22 21:22:47 +02:00
Dirk Ziegelmeier
1af40e7de2 SNMP doxygen updates 2016-06-22 21:11:59 +02:00
Dirk Ziegelmeier
75c5829a57 Lots of documentation updates 2016-06-22 20:46:19 +02:00
Dirk Ziegelmeier
8dc77ef558 doxygen updates - include IPv6 in documentation. Exclude include/netif/ppp/polarssl.
Convert TODO -> @todo
2016-06-22 20:18:23 +02:00
Sylvain Rochet
cfe5182380 timers: fix wrong timings for !NO_SYS targets
issue 1:

sys_arch_sem_wait() is supposed to return an elapsed time in ms, what could
happen given a > 1 kHz calling rate for high throughput systems is that it
might always returns 0 ms. This is a problem for systems which compute the
elapsed time from a high precision clock source.

This is what is currently happening in the unix port in sys_arch_sem_wait():

start time -> 1000000000;  // ns
-- less than a ms before an event arrive --
end time   -> 1000xxxxxx;  // ns
return value -> (end time - start time)/1000000 -> 0

The return value is used to reduce the next timer interval, if
sys_arch_sem_wait() always return 0 no more timers are fired anymore

issue 2:

The current timer implementation for !NO_SYS targets only count elapsed
time while -waiting- for semaphore and doesn't count at all the time
spent by the stack to process packets. For CPU bound traffic patterns no
more timers are fired anymore.

Both are serious design issues which cannot be easily fixed without reworking
everything. This patch uses the properly implemented timers for NO_SYS targets
for !NO_SYS targets and merge them both into one single timers implementation.
2016-06-20 16:17:55 +02:00
Sylvain Rochet
2040f4f0b1 PPP, trivial debug messages fixes/add
This change only add one debug message to ppp_link_start function
and fix the message debug string of ppp_link_failed and ppp_link_end.
2016-06-20 00:42:17 +02:00
Sylvain Rochet
7b4bd3343b PPP, rename ppp_clear function to ppp_link_start
This function does not clear anything anymore. What it is now is an
optional way to notify PPP that link layer is started, changing the
PPP state from "dead" to "initialize". Rename it accordingly to what
the function really is.
2016-06-20 00:32:54 +02:00
Sylvain Rochet
1d108b400f PPP, move various connect cleanup from ppp_clear to ppp_start
What we really need here is to cleanup the PPP environment before
starting LCP, we don't care about the PPP state before LCP is
started. Move cleanups from ppp_clear to ppp_start to clean them
just before we need them cleaned.
2016-06-20 00:25:59 +02:00
Sylvain Rochet
42d50eba4e 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.
2016-06-19 23:48:08 +02:00
Sylvain Rochet
7df5496e7b PPP, rework initial/reconnect cleanup
Our previous way of doing it was to clear everything except a small part
of the ppp_pcb structure and then populate the structure with default
values using protocols init functions.

But it means the user is currently not allowed to change the default
configuration except the few flags and values that are currently
available in the ppp_settings structure.

Instead of adding more and more fields to the ppp_settings structure,
actually making them duplicate of already existing structure members
of ppp_pcb, but unfortunately cleaned, we carefully checked that
everything is properly cleaned during protocol lowerdown/close and
replaced our giant memset to selective memset of the few ppp_pcb
members that are not properly cleaned.
2016-06-19 23:26:47 +02:00
Sylvain Rochet
c751802fad PPP, CCP, move user configuration from ccp_init to ccp_resetci
ccp_init() is meant to be called once, providing default configuration
before user specific configuration is applied. In pppd user configuration
is set just after all protocol init functions are called, in lwIP we
use protocol reset functions to do that, which is more or less the same.

Therefore, be consistent and move CCP user configuration from ccp_init
to ccp_resetci.
2016-06-19 19:49:46 +02:00
goldsimon
6d95a34971 icmp ping response: fix invalid checksum (and possible assertion failure) when ip header contains options (is it correct that we mirror back all options) 2016-06-17 10:07:49 +02:00
goldsimon
61e067b98a Check for minimum IPv4 header length in rx packets 2016-06-17 09:36:14 +02:00
goldsimon
fda778f6b6 ip6_reass: don't crash if frag header isn't the first (or not in the first pbuf) 2016-06-16 13:51:38 +02:00
Erik Ekman
d98e25a783 nd6: Handle incorrect ICMP option length in RA
Make sure ICMPv6 options have a valid length before
parsing them.

Found with afl-fuzz.
2016-06-14 15:06:49 +02:00
sg
4e241fbf14 some minor improvements to the tcp options checking code 2016-06-13 20:41:58 +02:00
Henrik Persson
b9a2ee8aaa [PATCH] Drop instead of ASSERT in tcp_input header parsing
Since allowing input validation to trip the ASSERT handler is bad,
let's just drop the packets instead if validation fails.

Signed-off-by: sg <goldsimon@gmx.de>
2016-06-13 20:08:43 +02:00
Erik Ekman
25652254a5 Update PPP after DNS api change 2016-06-13 10:35:27 +02:00
Dirk Ziegelmeier
5e7b343d52 Fix dns_getserver to return a pointer, not a value 2016-06-13 09:00:46 +02:00
Dirk Ziegelmeier
9ddde3ef4a Fix doxygen warnings 2016-06-11 22:57:55 +02:00
goldsimon
5d9f59daa4 httpd makefsdata: make http response server string configurable via command line, tiny fixes to usage and command interpretation 2016-06-10 13:35:38 +02:00
goldsimon
076f1ee89e minor: coding style cleanup in snmp code 2016-06-09 14:28:04 +02:00
goldsimon
010b0e2972 snmp: don't assert-fail on zero-length OID 2016-06-09 11:47:15 +02:00
goldsimon
952da88b84 httpd: explicitly added 2 includes that came in through tcp.h by accident... 2016-05-31 16:18:14 +02:00
Dirk Ziegelmeier
9be133777b Add threading note to api.h 2016-05-25 21:42:59 +02:00
Dirk Ziegelmeier
6be7e221a5 Fix a few doxygen warnings 2016-05-24 22:29:18 +02:00
Dirk Ziegelmeier
451277e7f0 Include all lwIP files in doxygen documentation 2016-05-24 21:03:41 +02:00
Dirk Ziegelmeier
51f3cdfd5a Fix UTF-8 encoding of sntp files (Frédéric Bernon) 2016-05-24 13:14:18 +02:00
goldsimon
344de0e119 fixed comments on netconn_shutdown to prevent using full-duplex wording... 2016-05-24 10:01:03 +02:00
Jan Breuer
bfd3baa20e netif: add additional getters/setters 2016-05-23 22:29:53 +02:00
sg
631c458c55 Fixed invalid DEBUGF level SERIOUS when pbuf_header fails (it returns '1': this is not serious!) 2016-05-23 22:06:02 +02:00
Dirk Ziegelmeier
6c8c3fd48c Fix more doxygen errors 2016-05-23 21:38:18 +02:00