Commit Graph

4565 Commits

Author SHA1 Message Date
Dirk Ziegelmeier
c62bfd8146 Port AUTOIP to new netif client data API 2016-08-17 21:26:08 +02:00
Dirk Ziegelmeier
1db9631e7d Port DHCP to new netif client data API 2016-08-17 21:04:44 +02:00
Dirk Ziegelmeier
c8c804140d Fix possible NULL pointer dereference in mdns.c introduced in my last commit 2016-08-17 21:00:59 +02:00
Dirk Ziegelmeier
ee815e4e7a Finish porting MDNS to new netif client data API 2016-08-17 20:09:28 +02:00
Dirk Ziegelmeier
c28fb298b7 Introduce an API to store arbitrary data pointers in struct netif
Let MDNS to use the new API
TODO: AutoIP, DHCP
2016-08-17 16:37:15 +02:00
Dirk Ziegelmeier
2a90f33757 MDNS responder: two functions can take struct mdns_host instead of netif as argument 2016-08-17 12:32:33 +02:00
Dirk Ziegelmeier
efb7b3d5f8 Rename LWIP_MDNS to LWIP_MDNS_RESPONDER 2016-08-17 12:07:38 +02:00
Dirk Ziegelmeier
02d51e3ac5 Add missing file doxygen header in two mdns files 2016-08-16 09:46:19 +02:00
Dirk Ziegelmeier
fec657bb38 MDNS: Substitute a few strlens by sizeof() 2016-08-16 09:33:53 +02:00
Dirk Ziegelmeier
858287fc3a MDNS: Fix several MSVC warnings 2016-08-16 08:33:16 +02:00
Dirk Ziegelmeier
af6b707e9a mdns_opts.h: Add missing include lwip/opt.h 2016-08-16 08:28:59 +02:00
Dirk Ziegelmeier
ab72ed8517 Fix options #include in mdns code 2016-08-16 08:22:41 +02:00
Dirk Ziegelmeier
482a4d2ce9 MDNS: Correct setting TTL when IGMP is not enabled 2016-08-16 08:09:19 +02:00
Dirk Ziegelmeier
c61c8f3766 Use udp_get_multicast_ttl/udp_set_multicast_ttl accessors where applicable 2016-08-16 08:08:06 +02:00
Dirk Ziegelmeier
39ac8e2c57 Remove some MDNS functions from documentation, they are only visible for unit tests 2016-08-14 17:08:39 +02:00
Dirk Ziegelmeier
52449e12c0 Forgot to save before committing... 2016-08-14 16:56:34 +02:00
Dirk Ziegelmeier
2335c1a73c Port MDNS to new dual-stack API 2016-08-14 16:47:45 +02:00
Dirk Ziegelmeier
ebe0e6f98d Some documentation cosmetics in mdns.c 2016-08-14 15:42:22 +02:00
Dirk Ziegelmeier
b472648e40 Fix wrong copyright header in mdns_opts.h 2016-08-14 15:36:41 +02:00
Dirk Ziegelmeier
a2894ede1c MDNS: make a few arguments const where suitable 2016-08-14 15:31:49 +02:00
Dirk Ziegelmeier
306113c8c3 Add MDNS to doxygen docs 2016-08-14 15:22:05 +02:00
Erik Ekman
4919932c49 Apply patch #8755: Multicast DNS responder support from Erik Ekman 2016-08-14 15:07:45 +02:00
Sylvain Rochet
4af297fc20 PPP: fix don't print valid LCP echo request/reply packets if the link is up
The check for link up was missing, meaning valid LCP echo request/reply
packets are filtered whatever the PPP state is, despite what the comment
says.

Fix it by checking the PPP state as we would like to have done when it
was written.
2016-08-13 16:02:38 +02:00
Sylvain Rochet
4e1f8effaf PPP: fix ppp_write internal documentation
This function returns an err_t, not a number of characters written.
2016-08-13 16:02:38 +02:00
Dirk Ziegelmeier
5493220c93 Move DNS protocol structs to separate header. Needed for Erik Ekman's MDNS implementation. 2016-08-13 09:05:28 +02:00
Dirk Ziegelmeier
ce6ea0df15 Convert SNMP snmp_vb_enumerator_err_t to a typedef and fix resulting compile error 2016-08-12 22:59:21 +02:00
Dirk Ziegelmeier
6dcb2b2415 Work on bug #48730: Enums should be used instead of multiple defines (where applicable) 2016-08-12 22:51:43 +02:00
Dirk Ziegelmeier
b34baff546 Convert state #defines in autoip.h and dhcp.h to enums. May be useful in *_state structs to simplify debugging in the future. 2016-08-11 21:04:39 +02:00
goldsimon
6f62fe5998 ensure the 'prot' headers are as small & portable as possible 2016-08-11 15:11:34 +02:00
goldsimon
dc7340bbd5 started with bug #48728: move protocol definitions to 'include/prot/*.h' files (started with some IPv4 protocols) 2016-08-11 14:36:09 +02:00
Ajay Bhargav
d95ab511d0 netif:ppp: fix mempool build issues when PPP is enabled
During documentation updated LWIP_MEMPOOL_PROTOTYPE was moved inside
"#if MEMP_MEM_MALLOC" which cause ppp build to break. This patch fix that
issue.

ref commit-id: 2f950a7dcc

Signed-off-by: Ajay Bhargav <contact@rickeyworld.info>
2016-08-11 12:54:55 +02:00
goldsimon
bf3e8e6a48 minor coding style fixes in IPv6 code 2016-08-11 09:23:43 +02:00
Sylvain Rochet
3194c9c4cf PPP: filter more packets in ppp_dump_packet
VJ packets, Compressed packets, IPv4 and IPv6 packets are useless in
the PPP packet dump. We properly filtered IPv4 and IPv6 packets but
we forgot filtering VJ and Compressed packets.

Improve the filtering rule to filter packets which are not auth
protocol (< 0xC000) and which are not control protocol (0x8000 bit
not set).
2016-08-10 23:39:28 +02:00
Axel Lin
18fcc1d504 [PATCH] debug: Add braces around empty body in an 'if' statement
I have below code in my cc.h:

 #ifdef MYSDK_LWIP_DEBUG
 #define LWIP_PLATFORM_ASSERT(x) MYSDK_ASSERTION_FAIL_ACTION()
 #else
 #define LWIP_PLATFORM_ASSERT(x)
 #endif /* ifdef MYSDK_LWIP_DEBUG */

I got below error when in non-debug build:
src/include/lwip/debug.h:76:32: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
   LWIP_PLATFORM_ASSERT(message); } while(0)
                                ^
Fix the build error by adding braces around empty body in an 'if' statement.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: sg <goldsimon@gmx.de>
2016-08-09 21:52:13 +02:00
Dirk Ziegelmeier
5c0944e01a Don't document tcp_send_empty_ack and tcp_keepalive - users should never need them 2016-08-09 10:17:16 +02:00
Dirk Ziegelmeier
5a09fd3e35 Don't document ip4_route and ip6_route, users should use ip_route instead 2016-08-09 10:16:40 +02:00
Dirk Ziegelmeier
0005b7c2d0 Revert my last change in sntp.c - allow usage of custom error values in err_t 2016-08-09 08:20:28 +02:00
Dirk Ziegelmeier
61dae47a71 Relete SNMP README and incorporate it's text in doxygen docs 2016-08-08 22:40:57 +02:00
Dirk Ziegelmeier
85ab39985a Fix a few incorrect uses of err_t. Found by converting lwip error codes to an enum, but I'm not sure wether I want to commit the actual enum conversion. 2016-08-08 22:15:01 +02:00
Dirk Ziegelmeier
e5284ec616 Minor: documentation cosmetics 2016-08-08 22:01:38 +02:00
sg
a2fd68098e minor: macros should not end with underscore(s) 2016-08-08 21:47:53 +02:00
Dirk Ziegelmeier
1631307bb3 tcp.c: Partly undo Simon's changes from today (repairs doxygen docs) 2016-08-08 21:42:27 +02:00
Sylvain Rochet
282b8a2b6c PPP: set disconnect state before closing link protocol in ppp_close
If LCP is not started yet, we are only closing the link protocol, in
this case we have to set the disconnect state ourself because PPP
is not actually started yet.
2016-08-08 11:55:31 +02:00
Dirk Ziegelmeier
b1dfd00f92 Minor netif documentation update 2016-08-08 09:16:15 +02:00
goldsimon
eba6ae0122 minor: add a comment about where to define LWIP_RAND() 2016-08-08 09:14:50 +02:00
goldsimon
219438fb24 cleanup: move stdlib.h include to mem.c, where it belongs 2016-08-08 09:11:24 +02:00
Axel Lin
e4c01a064e mem: Include stdlib.h to fix build warnings when MEM_LIBC_MALLOC is set
Include stdlib.h to fix below build warnings when MEM_LIBC_MALLOC is set:
src/core/mem.c:119:3: warning: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   void* ret = mem_clib_malloc(size + MEM_LIBC_STATSHELPER_SIZE);
   ^
src/core/mem.c:96:25: warning: incompatible implicit declaration of built-in function 'malloc'
 #define mem_clib_malloc malloc
                         ^
src/core/mem.c:119:15: note: in expansion of macro 'mem_clib_malloc'
   void* ret = mem_clib_malloc(size + MEM_LIBC_STATSHELPER_SIZE);
               ^
src/core/mem.c: In function 'mem_free':
src/core/mem.c:146:3: warning: implicit declaration of function 'free' [-Wimplicit-function-declaration]
   mem_clib_free(rmem);
   ^
src/core/mem.c:93:23: warning: incompatible implicit declaration of built-in function 'free'
 #define mem_clib_free free
                       ^
src/core/mem.c:146:3: note: in expansion of macro 'mem_clib_free'
   mem_clib_free(rmem);
   ^

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-08-08 09:05:55 +02:00
goldsimon
08378b7d4b Improve LWIP_EVENT_API compilation 2016-08-08 08:49:14 +02:00
David van Moolenbroek
fc66fb830c Fix compilation for LWIP_EVENT_API
Without LWIP_CALLBACK_API, is no error callback function pointer in
the TCP PCB, nor is it needed, so do not attempt to access it.
2016-08-08 08:48:28 +02:00
Dirk Ziegelmeier
fa8797b86d Fix PBUF_LINK_HLEN value in documentation 2016-08-08 08:20:42 +02:00
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
Dirk Ziegelmeier
90a656ed78 Fix several doxygen errors all over the code 2016-05-23 21:18:16 +02:00
Dirk Ziegelmeier
59af802fb6 Add spaces around string concatenation macro (fixes compile on some compilers) 2016-05-23 10:34:58 +02:00
Jan Breuer
ebd103775d ipv6_addr: Render last zero in ip6addr_ntoa_r if not in first empty block 2016-05-23 09:54:54 +02:00
goldsimon
bd177ff38f added comment, fixed coding style 2016-05-23 09:47:14 +02:00
Jan Breuer
ac21a5f370 nd6: add cleanup function 2016-05-23 09:44:27 +02:00
Dirk Ziegelmeier
ac0af0d7c7 Fix return value of sntp_getserver() call to return a pointer 2016-05-20 11:02:02 +02:00
Dirk Ziegelmeier
8e7b8a32f9 Rename LwipMibViewer to MibViewer since it does not depend on lwip specific code 2016-05-15 13:09:57 +02:00
Axel Lin
ab989c3551 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>
2016-05-12 23:08:34 +02:00
Axel Lin
8c0f620d83 dns: Use LWIP_ARRAYSIZE instead of open coded
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-05-11 12:20:15 +02:00
Axel Lin
7e9377a9c7 dhcp: Use LWIP_ARRAYSIZE to get the number of array entries
dhcp_discover_request_options is u8_t array, so the result is the same.
But use LWIP_ARRAYSIZE to get the number of array entries is better
because it works for all types.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-05-11 12:15:12 +02:00
goldsimon
c6949d88d9 fixed unused variable warning in tcpip_api_call() for certain configurations 2016-05-11 09:43:06 +02:00
Sylvain Rochet
b9389c6eaf PPP: remove sio.h from included files
PPP is not using the SIO API anymore for quite a while. Remove now
useless sio.h from included files.
2016-05-11 00:19:27 +02:00
Sylvain Rochet
b08f73be44 snmpv3: replace arch/cc.h to lwip/arch.h in included files
Only "lwip/arch.h" is expected to include "arch/cc.h". This is the same
spirit than "lwip/opt.h" for "lwipopts.h" and "lwip/sys.h" for
"arch/sys_arch.h".
2016-05-10 23:25:14 +02:00
Sylvain Rochet
33fc20cca2 PPP: use mbed TLS sanitize functions if available
mbed TLS offers sanitize functions to zero-ise memory containing
cryptographic keys, use them if built with external mbed TLS library.
2016-05-08 21:58:56 +02:00
Sylvain Rochet
5df4f70a96 PPP: add a new LWIP_USE_EXTERNAL_MBEDTLS PPP option
PPP users can now choose to use an external mbed TLS copy instead of using
our internal old version (but released under a BSDish license) PolarSSL copy.
2016-05-08 21:26:19 +02:00
Sylvain Rochet
9f3aff0cdf PPP: add a new LWIP_USE_EXTERNAL_POLARSSL PPP option
In order to welcome mbed TLS, we need to ease the switch to:
    - embedded PolarSSL 0.10.1-bsd copy
or  - external PolarSSL
or  - external mbed TLS

This change cleanup all our previously used LWIP_INCLUDED_POLARSSL_* defines,
which were not really useful after all, making them internal build triggers
only, and this change provides a new unique global flag to use an external
PolarSSL copy.
2016-05-08 20:23:21 +02:00
Sylvain Rochet
3417a02b25 PPP: add a function map for hashes and ciphers to prepare for mbed TLS support
Unfortunately, all functions were renamed when PolarSSL was renamed to
mbed TLS, breaking the API. In order to continue supporting our embedded
PolarSSL copy while allowing our users to use mbed TLS, we need a function
map to deal with the API break.

This commit add a function map for all hashes and ciphers we are currently
using.
2016-05-08 20:20:42 +02:00
Sylvain Rochet
1dcd5d31d7 pbuf: fix undefined PBUF_POOL_FREE_OOSEQ if TCP_QUEUE_OOSEQ is disabled
lwip/src/core/timers.c: In function ‘sys_check_timeouts’:
lwip/src/core/timers.c:328:5: error: "PBUF_POOL_FREE_OOSEQ" is not defined [-Werror=undef]
 #if PBUF_POOL_FREE_OOSEQ

Fix it by declaring an empty PBUF_CHECK_FREE_OOSEQ() function if feature is
not enabled.
2016-05-08 03:09:51 +02:00
Sylvain Rochet
73b8026cb9 PPP, code cleaning
lwIP indentation is 2 characters, fix ppp_init indentation.
2016-05-07 01:51:52 +02:00
Sylvain Rochet
fc2701ae03 PPP, ppp_init function is back, re-add magic_init
Work on PPP MEMPOOL re-added the previously removed ppp_init function
because we considered it useless. Re-add magic_init which was
previously in ppp_init and removed in commit 15fbfb7363, it does
not hurt doing so and might fill the gap if we failed understanding
the crypto implication about removing it.
2016-05-07 01:48:17 +02:00
Dirk Ziegelmeier
4a6c444a17 httpd: Use newly created LWIP_VERSION_STRING 2016-05-04 10:24:12 +02:00
goldsimon
05961a27cf d'OH! (forgot end of comment) 2016-05-04 10:10:13 +02:00
goldsimon
93665a7659 Change version info from 1.5.0(dev) to 2.0.0(dev), added LWIP_VERSION_STRING ("1.2.3" with a suffix for git dev or rcX unless release version) 2016-05-04 10:03:48 +02:00
Dirk Ziegelmeier
49badf39a1 Fix bug #47805: dhcp_recv can dereference NULL pointer 2016-04-29 11:16:33 +02:00
Dirk Ziegelmeier
2e05856f90 Fix bug #47641: lwIP would accept IPv6 source addresses from the network that are mapped IPv4 adresses 2016-04-27 21:35:34 +02:00
Dirk Ziegelmeier
30e6f908ee Fix bug #47512: MPU_COMPATIBLE may fail on empty pool 2016-04-27 21:14:17 +02:00
Dirk Ziegelmeier
e653ac9db7 Remove netconn_recved() call - it was only needed in sockets implementation and contributed to bug #47512
Simon and I think it can be removed - the receive window handling get a little less precise, but that should be OK for a lightweight stack.
Receive window is now updated with the whole pbuf size (instead of only count of read bytes from socket) as soon as socket implementation gets a pbuf from netconn layer.
Work on bug #47512: MPU_COMPATIBLE may fail on empty pool (still not finished)
2016-04-27 21:02:16 +02:00
Dirk Ziegelmeier
21354af674 Work on bug #47512: MPU_COMPATIBLE may fail on empty pool (still not finished) 2016-04-27 12:49:06 +02:00
goldsimon
c981b726f8 fixed bug #47601 (wrong NS request at DAD) 2016-04-27 10:19:13 +02:00
Dirk Ziegelmeier
21e6e1c824 Fix compile errors found by Erik Ekman's Travis-CI 2016-04-26 22:09:23 +02:00
Dirk Ziegelmeier
b07031479c Revert "tcpip_send_msg_wait_sem() can return void now due to my last changes"
My brain was asleep

This reverts commit 475be665ff.
2016-04-26 22:03:18 +02:00
Dirk Ziegelmeier
475be665ff tcpip_send_msg_wait_sem() can return void now due to my last changes 2016-04-26 21:40:19 +02:00
Dirk Ziegelmeier
3d38af5174 Work on bug #47512: MPU_COMPATIBLE may fail on empty pool (not finished!) 2016-04-26 21:33:02 +02:00
Dirk Ziegelmeier
b28a80375b Fix bug #47446: tcpip api calls: fail if mbox is invalid instead of returning an error 2016-04-26 21:09:03 +02:00
Dirk Ziegelmeier
a5d4a27ae1 Fix compile warnings (==errors) in new httpd 2016-04-26 20:53:25 +02:00
goldsimon
afd9ee9147 fixed bug #47743 (Closing listening tcp pcb is not posible without assert) 2016-04-26 13:27:17 +02:00
Dirk Ziegelmeier
afd1bb938e Fix compile of Simon's last change on MSVC 2016-04-26 13:19:32 +02:00
goldsimon
025d5591eb httpd improvements: added persistent connections, improved asynchronous read mode, compile-time deflate compression, new CGI mode, SSI handler can be called with tag string (instead of tag index) 2016-04-26 13:00:27 +02:00
Dirk Ziegelmeier
7d77a52ea5 Fix compile when PPP is not enabled - Macro MEMP_NUM_PPP_PCB always needs to be #defined 2016-04-25 22:24:33 +02:00
Dirk Ziegelmeier
2b5250dd9d Fix bug #47507: PPP API does not support LWIP_MPU_COMPATIBLE
I'd be glad if someone would test it :-)
Sylvain, if you don't like this patch feel free to revert it
2016-04-25 21:23:14 +02:00
Dirk Ziegelmeier
8ce49499ae tcpip_priv.h: More API improvements 2016-04-25 21:21:16 +02:00
Dirk Ziegelmeier
5a123a3405 tcpip_priv.h: More flexible API by including return value in API_VAR_ALLOC macro 2016-04-25 21:00:28 +02:00
Dirk Ziegelmeier
0d0b935d3d tcpip_priv.h: Add helper macros for APIs that use private mempools 2016-04-25 20:51:26 +02:00
Dirk Ziegelmeier
2be86fbc3e Fix compile of api_lib.c when LWIP_MPU_COMPATIBLE is enabled 2016-04-25 20:50:14 +02:00
Dirk Ziegelmeier
bb908366a5 More PPP cleanups 2016-04-25 20:08:29 +02:00
Dirk Ziegelmeier
73d8f14ebd Fix compile when PPP is not enabled 2016-04-25 20:08:29 +02:00
Dirk Ziegelmeier
ffa340a68c task #13907: PPP cleanups: Move PPP mempools out of lwIP core to PPP code 2016-04-25 20:08:29 +02:00
Dirk Ziegelmeier
b8b83c2994 Move some definitions from tcpip_priv.h to better places since they are of "public interest" (LWIP core locking mode, watchdog trigger) 2016-04-23 10:24:17 +02:00
Dirk Ziegelmeier
4d1a2e6699 Fix projects without PPP do not compile any more 2016-04-22 06:24:01 +02:00
Sylvain Rochet
15fbfb7363 PPP, remove useless ppp_init function
Simon says:

ppp_init() does not seem to be used. The only thing it does is calling
magic_init(), which is not required because it its called again later
from ppp_input().

Also, the time from startup is rather constant, so calling sys_jiffies()
from ppp_init() does not create a random number.
2016-04-21 23:25:48 +02:00
Sylvain Rochet
54f7cae12c PPP, fix reserved identifier violation (removed leading underscores from header include guards) 2016-04-21 23:15:49 +02:00
Dirk Ziegelmeier
76d25befb4 Work on task #13907 PPP cleanups: Move PPP options from opt.h to dedicated ppp_opts.h file 2016-04-21 22:28:14 +02:00
Dirk Ziegelmeier
749f7fae1a Move PPP API files to netif/ppp subdir 2016-04-21 21:47:26 +02:00
Dirk Ziegelmeier
61d07f88f0 Fix bug #47749: #define ETHARP_TRUST_IP_MAC does not compile 2016-04-21 21:21:56 +02:00
Joel Cunningham
8ac1b4825a udp: use netif addr as src for multicast sockets
Sockets bound to a multicast address could not transmit multicast
packets because the pcb local address did not match the netif address
even if the outgoing netif was resolved correctly.

To correct the issue, pcbs with a multicast local address will use
the outgoing netif address as the source address in IPv4.
2016-04-18 16:36:13 -04:00
Dirk Ziegelmeier
87354abf0f snmpv3_mbedtls.c: snmpv3_crypt() is only needed when LWIP_SNMP_V3_CRYPTO is enabled 2016-04-14 08:26:29 +02:00
Dirk Ziegelmeier
0b6370b9b8 SNMPv3: Make receiving DES encrypted frames work, sending still fails because of broken padding 2016-04-11 22:04:28 +02:00
Dirk Ziegelmeier
92f5da8412 two minor fixes in snmpv3_mbedtls.c 2016-04-07 06:58:58 +02:00
Dirk Ziegelmeier
309e072238 Create new IP_IS_V4 macros and use them at instead of !IP_IS_V6 - since we now have an IPADDR_ANY_TYPE, just checking for !V6 does not mean it is V4 2016-04-06 22:31:31 +02:00
Dirk Ziegelmeier
ab2c65549d Avoid divisions / module in SNMP code on stupid compilers
Signed-off-by: goldsimon <goldsimon@gmx.de>
2016-04-06 11:16:54 +02:00
sg
ca1b8288de prepare for overriding current timeout implementation: all stack-internal caclic timers are avaliable in the lwip_cyclic_timers array 2016-04-05 23:01:57 +02:00
sg
8c7f513f4d patch #8358: allow more combinations of listening PCB for IPv6 2016-04-05 22:04:19 +02:00
sg
16c70dd60e fixed bug# 43739 (Accept not reporting errors about aborted connections): netconn_accept() returns ERR_ABRT (sockets: ECONNABORTED) for aborted connections, ERR_CLSD (sockets: EINVAL) if the listening netconn is closed, which better seems to follow the standard 2016-04-05 21:42:10 +02:00
sg
03e9c88488 fixed bug #47625 (Error in compilation of C++ source using netifapi macros) by changing NULL define for __cplusplus 2016-04-05 21:04:06 +02:00
sg
0731eda0b3 make autoip_supplied_address() take a const pointer, too 2016-04-05 20:38:11 +02:00
Dirk Ziegelmeier
083c6123d6 snmpv3_dummy.c: Add newline at end of file 2016-04-05 13:18:54 +02:00
Dirk Ziegelmeier
12a4cae404 Apply [patch #8969] from Freddie Chopin: Constify netif in dhcp_supplied_address() 2016-04-05 13:18:27 +02:00
Dirk Ziegelmeier
3a26e8b6cc Fix build when snmpv3 is not available. One more thanks, Erik :-) 2016-04-04 22:10:59 +02:00
Dirk Ziegelmeier
28652d4d51 Fix build when mbedtls is not available :-) Thanks Erik! 2016-04-04 22:07:50 +02:00
Dirk Ziegelmeier
b67427bd3b Commit Elias Oenal's SNMPv3 work, with some restructuring:
- The abstraction from crypto framework was not well suitable to MBEDTLS, so I decided to move everything into an own file.
- I removed several #defines and created function prototypes instead - this is more type-safe, and users don't need to reinvent the function signatures.
- Header files were splitted into a public and a private part.
- Only SNMPv3 authentication was tested, privacy not yet.
2016-04-04 18:55:32 +02:00
Dirk Ziegelmeier
3a7c998f91 Fix bug #47592: pppapi_do_ppp_set_notify_phase_callback has invalid parameter type
... and one more I missed in my conversion yesterday
2016-04-01 10:38:27 +02:00
Dirk Ziegelmeier
141aeaab3d Fix shadowing warning (when compiling in C++) in TCPIP call API. Reported by Freddie Chopin. 2016-03-31 19:52:20 +02:00
Dirk Ziegelmeier
c8b65f6c1d Fix #define IPADDR_STRLEN_MAX in IPv6 only and dual-stack case 2016-03-30 11:20:54 +02:00
Dirk Ziegelmeier
d70d9bf866 SNTP: Add function to get SNTP enabled state 2016-03-30 11:20:16 +02:00
Dirk Ziegelmeier
4bd57882b0 Fix SNMP compile on Win32 due to missing #includes 2016-03-29 16:51:33 +02:00
Dirk Ziegelmeier
52fdc6bb3e Partly apply Elias Oenal's SNMP V3 patch, part 2: Add SNMPv3 support routines. Crypto does not work yet. 2016-03-29 10:28:33 +02:00
Dirk Ziegelmeier
d0c3baf340 Partly apply Elias Oenal's SNMP V3 patch. There is more to come, the work is incomplete at the moment and does not compile when LWIP_SNMP_V3 is enabled. 2016-03-29 10:28:33 +02:00
Dirk Ziegelmeier
d8784a77b7 Fix bug #47556: snmp agent uses wrong err 'ERR_ABRT' - use ERR_ARG as old code. Was tested to be != ERR_OK only, so actual code did not matter 2016-03-28 16:57:36 +02:00
sg
27f03798b9 Fixed possible problems with tcp_backlog_delayed/tcp_backlog_accepted 2016-03-25 16:19:39 +01:00
goldsimon
5b0a47ca87 removed unused return values of tcp_listen_input & tcp_timewait_input; fixed unused variable warning 2016-03-24 15:06:31 +01:00
Dirk Ziegelmeier
9b0a0841e9 Fix compile of snmp/snmp_mib2.c - don't know why I didn't notice yesterday... 2016-03-24 14:31:33 +01:00
goldsimon
0b4bc5ea31 minor whitespace change only 2016-03-24 07:15:27 +01:00
Dirk Ziegelmeier
cab341976e SNMP: Reduce #includes of snmp_mib2.c 2016-03-23 22:36:02 +01:00
Dirk Ziegelmeier
52a3bf5d43 SNMP: Cleanups after my last changes 2016-03-23 22:32:47 +01:00
Dirk Ziegelmeier
63c2dc926e SNMP: Move MIB2 ip subtree to separate file to get snmp_mib2.c smaller 2016-03-23 22:32:47 +01:00
Dirk Ziegelmeier
cc477361ad SNMP: Move MIB2 system subtree to separate file to get snmp_mib2.c smaller 2016-03-23 22:32:47 +01:00
Dirk Ziegelmeier
377885581f SNMP: Move MIB2 interfaces subtree to separate file to get snmp_mib2.c smaller 2016-03-23 22:32:47 +01:00
Dirk Ziegelmeier
7321420d8c SNMP: Move MIB2 ICMP subtree to separate file to get snmp_mib2.c smaller 2016-03-23 22:32:47 +01:00
Dirk Ziegelmeier
9466d64a9a SNMP: Move MIB2 TCP subtree to separate file to get snmp_mib2.c smaller 2016-03-23 22:32:47 +01:00
Dirk Ziegelmeier
d929a4b17e SNMP: Move MIB2 UDP subtree to separate file to get snmp_mib2.c smaller 2016-03-23 22:32:46 +01:00
Dirk Ziegelmeier
945607e094 SNMP: Move MIB2 SNMP subtree to separate file to get snmp_mib2.c smaller 2016-03-23 22:32:46 +01:00
sg
7721b20179 call accept-callback with ERR_MEM when allocating a pcb fails on passive open to inform the application about this error; ATTENTION: applications have to handle NULL pcb in accept callback! 2016-03-23 21:57:38 +01:00
sg
c6b742812d fixed bug #38203: DHCP options are not recorded in all DHCP ack messages (patch by Florent Matignon) 2016-03-23 21:06:52 +01:00
goldsimon
85d5fbdc7f lwip_accept: fixed returning EOPNOTSUPP instead of -1 (EOPNOTSUPP is set as socket error) 2016-03-23 14:27:40 +01:00
Axel Lin
449fc98a55 tcp_alloc(): Remove superfluous initialization for pcb->keep_cnt_sent
It's already done by memset(0). This was missed in commit 5794ac2340
"tcp_alloc(): remove explicit =0 already done by memset(0)", fix it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-03-23 14:26:32 +01:00
Dirk Ziegelmeier
7e7f2f31ff Cleanup and simplify tcpip_api_call() implementation a bit 2016-03-22 21:52:11 +01:00
Dirk Ziegelmeier
a1fc91afa8 Fix newly introduced tcpip_api_call did not return correct return value 2016-03-22 21:34:05 +01:00
goldsimon
c39ef75cb3 ... and another compiler error: tcp_nagle_enable() must stay at tcpflags_t, not using u16_t 2016-03-22 15:58:00 +01:00
goldsimon
7bda462031 fixed wrong commit: compatibility-define tcp_accepted() was accidentally commented-out 2016-03-22 15:54:14 +01:00
Dirk Ziegelmeier
f97bf85fd6 udp.c: Allow udp_connect() on a dual-stack UDP PCB (type IPADDR_TYPE_ANY). This may be useful in some applications - no need to keep separate storage for target IP. 2016-03-22 15:12:16 +01:00
sg
dd80759bb9 tcp: changed accept handling to be done internally: the application does not have to call tcp_accepted() any more. Instead, when delaying accept (e.g. sockets do), call tcp_backlog_delayed()/tcp_backlog_accepted() (fixes bug #46696) 2016-03-22 07:30:44 +01:00
sg
a1c78ea7bf ignore dns response parsing errors, only abort resolving for correct responses or error responses from correct server (bug #47459) 2016-03-22 07:22:17 +01:00
sg
5794ac2340 tcp_alloc(): remove explicit =0 already done by memset(0) 2016-03-18 22:05:17 +01:00
sg
44e1a2d8e2 define tcp_backlog_set() as dummy-define when backlog feature is disable 2016-03-18 20:05:04 +01:00
sg
149bb36805 fixed bug #47448 (netconn/socket leak if RST is received during close) 2016-03-17 21:49:01 +01:00
Joel Cunningham
93ccba9bcb don't fail closing a socket/netconn when failing to allocate the FIN segment; blocking the calling thread for a while is better than risking leaking a netconn/socket (see bug #46701)
Signed-off-by: sg <goldsimon@gmx.de>
2016-03-17 21:00:18 +01:00
sg
b24e5cd1c8 fixed compiling netconn_write_partly with LWIP_SO_SNDTIMEO==1 after recent api implementation changes (bug #47436, patch by William Hayes) 2016-03-17 20:15:22 +01:00
Dirk Ziegelmeier
7fbb5fc82a Fix netconn API in core locking mode 2016-03-17 09:31:50 +01:00
Dirk Ziegelmeier
464a8c9794 Delete script to compile MOBA MIB 2016-03-17 08:27:45 +01:00
Dirk Ziegelmeier
7aea739f87 PPPAPI: Don't return garbage in *_create calls in case tcpip_api_call() fails;
Let some functions return err_t instead of void because tcpip_api_call() may fail
2016-03-16 23:01:05 +01:00
sg
852d5b9c80 Optimize tcp_output runtime by not calling ip_route() for every segment sent 2016-03-16 22:31:33 +01:00
sg
b4d7238eb8 tcp_output_segment: don't count retransmitted segments in mib2.tcpoutsegs by detecting p->payload != tcphdr pointer; don't try to retransmit segments where p->ref != 1 (as it is invalid to mess up p->len/p->payload when we don't have exclusive access to the pbuf) 2016-03-16 22:22:20 +01:00
Dirk Ziegelmeier
ee87d28252 Rename tcpip_apimsg to netconn_apimsg (better suits naming convention in api_lib.c) 2016-03-16 22:02:47 +01:00
Dirk Ziegelmeier
6ffe12cede Readd struct protoype in api.h 2016-03-16 21:57:25 +01:00
Dirk Ziegelmeier
d6adc1f6cb Rename tcpip_send_api_msg to tcpip_send_msg_wait_sem (hopefully a little bit clearer name) 2016-03-16 21:57:24 +01:00
sg
5f8b5cbb20 reset rto timer on fast retransmission (see task #13757, patch by Joel Cunningham) 2016-03-16 21:49:37 +01:00
sg
7b9cb98bbb LWIP_TCPIP_CORE_LOCKING_INPUT is not experimental any more, as well 2016-03-16 21:48:47 +01:00
Dirk Ziegelmeier
222eb25eb5 Accidentally committed my MIB compiler test, sorry! 2016-03-16 21:38:22 +01:00
Dirk Ziegelmeier
dbfdb13166 LwipMibCompiler: Set MIB compiler as startup project instead of MIB viewer 2016-03-16 21:35:21 +01:00
Dirk Ziegelmeier
d38cdccbcd netconn API: Remove api_msg wrapper struct, it is not needed any more 2016-03-16 21:35:21 +01:00
Dirk Ziegelmeier
2575c7fb5f netconn API: Cleanup, remove lots of #defines, take advantage of new tcpip_send_api_msg function feature to abstract core locking away 2016-03-16 21:35:21 +01:00
Dirk Ziegelmeier
ea174560b1 tcpip.c tcpip_send_api_msg: Handle core locking case internally 2016-03-16 21:35:21 +01:00
Dirk Ziegelmeier
bc51dddcaf Add some comments to functions and #defines. According to Simon, LWIP core locking is not experimental any more. 2016-03-16 21:35:21 +01:00
sg
f09dec5fb7 ethernetif.c: implement SNMP counters, simplify input function: no need to check ethType, ethernet_input() already does this 2016-03-16 21:26:31 +01:00
sg
8e8571da6a fixed bug #46384 Segment size calculation bug with MSS != TCP_MSS 2016-03-16 16:56:15 +01:00
Dirk Ziegelmeier
0d576aa521 Fix bug #47426 incorrect typecast in pppapi.c 2016-03-16 12:37:08 +01:00
goldsimon
0e1b401abe sntp: fixed constness for SNTP_SERVER_DNS==1 2016-03-14 14:29:26 +01:00
Dirk Ziegelmeier
bf7fc41e0f LwipMibCompiler: Add windows command line example 2016-03-14 12:13:44 +01:00
Dirk Ziegelmeier
90bc1da434 LwipMibCompiler: Don't generate empty root nodes 2016-03-14 12:13:24 +01:00
Dirk Ziegelmeier
dc98e31e4d LwipMibCompiler: MibTree: Adapt coding style to the rest of the C# project 2016-03-14 12:13:05 +01:00
Dirk Ziegelmeier
1d7996dc47 tcpip API calls: Implement LWIP_NETCONN_SEM_PER_THREAD support for ALL API calls 2016-03-13 19:43:49 +01:00
Dirk Ziegelmeier
2b3db52c70 pppol2tp.c: Avoid an #ifdef - there is a new UDP API function that can be used here 2016-03-12 12:26:23 +01:00
Jan Breuer
b65a22b32a LwipMibCompiler: Don't preserve upper case on generated variables 2016-03-12 09:09:26 +01:00
Jan Breuer
b849e52c17 LwipMibCompiler: preserve upper case in comments 2016-03-12 09:09:22 +01:00
Jan Breuer
588b11185a LwipMibCompiler: Remove false positive root entities 2016-03-12 09:05:19 +01:00
Jan Breuer
dfc963880a LwipMibCompiler: Fix generating SnmpScalarArrayNode callbacks 2016-03-12 09:03:41 +01:00
Dirk Ziegelmeier
00975769a0 Minor TCPIP API call functions cleanup 2016-03-10 22:44:31 +01:00
Dirk Ziegelmeier
f7a3d6cca5 Port PPP API to new simple tcpip API call method 2016-03-10 22:44:25 +01:00
Dirk Ziegelmeier
8f71795844 Port netifapi to new simple tcpip API call method 2016-03-10 22:42:21 +01:00
Dirk Ziegelmeier
8106413644 tcpip.c: Implement an easier way for TCPIP API calls - client code does not have to deal with semaphores and core locking any more 2016-03-10 22:42:21 +01:00
sg
5e472badf1 Work on bug #44595: remove check for recvmbox != NULL from netconn_recv() to let it return ERR_CLSD for half-closed TCP connections 2016-03-10 21:20:25 +01:00
Axel Lin
2a2f92f7c2 Make ERR_IS_FATAL() test first fatal error instead of last non-fatal error
This way, we don't need to update ERR_IS_FATAL() every time new non-fatal error
is added. Also drop 2 empty lines so the error constants present in 2 groups,
non-fatal errors and fatal errors.
2016-03-10 07:21:34 +01:00
Dirk Ziegelmeier
f3b7bca3cf Fix bug #47370: Port DNS client to IPv6 2016-03-09 19:25:06 +01:00
Dirk Ziegelmeier
9fbf5a4004 SNMP: Support LWIP_TCPIP_CORE_LOCKING sync method 2016-03-09 08:39:56 +01:00
sg
5d637360cc fixed ERR_IS_FATAL() after changing ERR_IF to non-fatal 2016-03-08 21:04:21 +01:00
Dirk Ziegelmeier
7d8f0c781f Fix wrong usage of LWIP_NETCONN_SEM_PER_THREAD macro in api_msg.h 2016-03-08 19:53:37 +01:00
Dirk Ziegelmeier
a212210c35 Add missing #include in memp.c 2016-03-08 19:53:01 +01:00
Dirk Ziegelmeier
ba40925335 tcpip_send_api_msg function is only needed in non-core-locking mode 2016-03-08 19:41:32 +01:00
Dirk Ziegelmeier
eab92ccb03 netifapi: Eliminate wrapper struct netifapi_msg and rename netifapi_msg_msg to netifapi_msg 2016-03-08 19:41:32 +01:00
Dirk Ziegelmeier
fc17d02451 Fix compile with LWIP_TCPIP_CORE_LOCKING 2016-03-08 19:41:32 +01:00
Dirk Ziegelmeier
37d514c949 Minor cleanups in #includes and comments 2016-03-08 19:41:32 +01:00
Dirk Ziegelmeier
a4297ef0fd Reduce includes of tcpip_priv.h 2016-03-08 19:41:32 +01:00
Dirk Ziegelmeier
c65eca58c9 Decouple tcpip.c/tcpip_priv.h from netconn API 2016-03-08 19:41:32 +01:00
Dirk Ziegelmeier
18bb74e5c5 Decouple tcpip.c/tcpip_priv.h from PPP API
PPP API can now be moved to netif/ppp subdir
2016-03-08 19:41:32 +01:00
Dirk Ziegelmeier
af1978fa4e Implement generic API message handling
Add generic tcpip_send_api_msg function
Let netif API and netconn API use it
Decouple tcpip.c and tcpip_priv.h from netif API
2016-03-08 19:41:32 +01:00
sg
5cf802eda0 dns_gethostbyname: return error code if no valid server is set instead of calling the 'found' callback in this case (fixes bug #46887) 2016-03-07 19:47:39 +01:00
Joel Cunningham
80cc988f2f Optimize sendmsg UDP pbuf chain creation
This commit optimizes the sendmsg UDP pbuf chain creation by not
allocating/freeing a netbuf per io vector and instead building a pbuf
chain directly in the sockets layer
2016-03-07 09:26:58 -06:00
sg
076795562e fixed typo in one of the last commits 2016-03-06 20:59:50 +01:00
sg
f5fef6eebc fixed bug #45353: IPv6 router / neighbor relationship is not always consistent - patch by Stian Sebastian Skjelstad 2016-03-06 14:48:41 +01:00
sg
375ec36246 ERR_IF is not necessarily a fatal error (fixes bug #46338: UDP netconns block after fatal error) 2016-03-05 16:15:04 +01:00
sg
b00a17059a fixed icmp_send_response with LWIP_HOOK_IP4_ROUTE_SRC enabled 2016-03-05 15:57:40 +01:00
Dirk Ziegelmeier
bcab7fef84 netifapi.c: Fix compile when IPv4 is not enabled 2016-03-05 15:55:53 +01:00
sg
d2bb569ee4 bug #46094: moved IPv4 routing hook functions down so that they implement actual routing (source-based IPv4 routing is not affected by this change) 2016-03-05 15:52:39 +01:00
Dirk Ziegelmeier
52b426a343 ip_addr.h: Use IP_GET_TYPE macro in other macros 2016-03-05 14:35:29 +01:00
Dirk Ziegelmeier
f4fbc90217 netifapi: Do not pass NULL pointers for IP addresses to subsequent functions
Same as in my last commits - this avoids errors in lwIP code where ip addresses are dereferenced (e.g. for IP type checking) without handling thinking about NULL pointers.
2016-03-05 14:35:29 +01:00
sg
e0ab8c581d fixed bug #46093: Move IP6_ROUTE() hook to after LL processing 2016-03-05 14:11:24 +01:00
Dirk Ziegelmeier
094cdf1c7b netconn: Create API macros to get/set IPV6ONLY flag 2016-03-04 23:06:33 +01:00
Dirk Ziegelmeier
814577fcc6 snmp: Fix snmp_oid_to_ip for IPADDR_ANY_TYPE ips 2016-03-04 22:46:54 +01:00
Dirk Ziegelmeier
15925b66c6 Fix ip_addr_cmp to correctly compare IPADDR_ANY_TYPE ips 2016-03-04 22:46:18 +01:00
Dirk Ziegelmeier
925b280fd2 Apply patch from Elias Önal to fix a few datatypes in SNMP MIB2 2016-03-04 22:35:09 +01:00
sg
6b405eccd0 Tried to fix bug #47270 by accepting all ipv4 multicast packets (at IP level) when LWIP_IGMP is disabled 2016-03-04 21:57:47 +01:00
goldsimon
15326cdbad Added macro to get the ip address type 2016-03-04 09:07:50 +01:00
Dirk Ziegelmeier
bd0b51c9ef Fix my previous netconn_do_listen changes in lwip_netconn_do_listen 2016-03-03 23:16:01 +01:00
Dirk Ziegelmeier
9a4c66006e Fix compile error in raw.c (possible unused arg) 2016-03-03 22:55:42 +01:00
Dirk Ziegelmeier
1c52780b62 snmp_netconn: Use new "socket-like" netconn API dual-stack implementation 2016-03-03 22:52:43 +01:00
Dirk Ziegelmeier
bee5515e9a netconn API: Reimplement dual-stack API to be socket-like.
When IPv6 ANY address is used and the NETCONN_FLAG_IPV6_V6ONLY is NOT set, bind/listen on/to IP_ANY_TYPE
2016-03-03 22:52:04 +01:00
Dirk Ziegelmeier
0a7f404d09 api_lib.c: Don't propagate NULL pointers as ip address to subsequent functions 2016-03-03 22:49:55 +01:00
Dirk Ziegelmeier
1dea649cff Fix comment in tcp.c 2016-03-03 22:48:10 +01:00
Dirk Ziegelmeier
7396d8818b Implement dual-stack in RAW API in the same way as in UDP and TCP 2016-03-03 22:47:27 +01:00
Dirk Ziegelmeier
2d80af1dcb Minor code cleanup in udp.c 2016-03-03 22:44:01 +01:00
Dirk Ziegelmeier
b5cd90a342 Add compatibility macro for tcp_new_ip6() 2016-03-03 21:04:00 +01:00
Dirk Ziegelmeier
5358380c5f Apply patch from Derek Pravala: Fix segfault in ip6_route when there is no default netif 2016-03-03 16:12:20 +01:00
Dirk Ziegelmeier
eead3a7038 Simon says: dual-stack does not work on iperf because there IPs encoded in the payloads and IPv6 is not supported there in the current lwIP implementation -> revert 2016-03-03 13:06:55 +01:00
Dirk Ziegelmeier
ce370ec48f Compile fix lwiperf.c after my last change 2016-03-03 12:23:34 +01:00
Dirk Ziegelmeier
24ebf6bd6f Implement dual-stack in lwiperf, netbiosns and sntp 2016-03-03 12:15:57 +01:00
Dirk Ziegelmeier
b0d4386744 Adapt HTTP server to new dual-stack API 2016-03-02 23:47:09 +01:00
Dirk Ziegelmeier
0c673b6a44 Implement new style TCP dual-stack in netconn API 2016-03-02 23:46:22 +01:00
Dirk Ziegelmeier
e89b48d23f raw.c: Avoid NULL pointer dereference 2016-03-02 23:44:51 +01:00
Dirk Ziegelmeier
f9ce31f98b TCP: Implement dual stack support using new IP_ANY_TYPE introduced at UDP 2016-03-02 23:14:33 +01:00
Dirk Ziegelmeier
bd131e5e4b ip_addr.h: Update ip_addr_copy macro to correctly copy new IP_ANY_TYPE address 2016-03-02 23:11:34 +01:00
Dirk Ziegelmeier
f3132c5290 udp: Fix possible NULL pointer dereference, update comments 2016-03-02 23:10:43 +01:00
Dirk Ziegelmeier
babb247e2a SNMP MIB2: Fix temporary OID buffer size some tables have been too small 2016-03-02 23:09:51 +01:00
Dirk Ziegelmeier
cc4f94f415 lowpan6: Fix incorrect array bounds check (found by Coverity) 2016-03-02 19:45:15 +01:00
Dirk Ziegelmeier
9885d5d9f5 Apply patch from Simon to fix buffer overflow handling tcp_in.c which was discovered by Coverity 2016-02-29 23:34:52 +01:00
Dirk Ziegelmeier
8e5663a32f Minor: Avoid ip_input() call indirection for when only IPv4 or IPv6 are enabled 2016-02-29 22:17:42 +01:00
Dirk Ziegelmeier
4bbfc3857a Implement dual-stack in SNMP for netconn API 2016-02-29 19:31:19 +01:00
Dirk Ziegelmeier
5404ce3c0a Implement support for UDP IP_ANY_TYPE in netconn API 2016-02-29 19:31:19 +01:00
Dirk Ziegelmeier
2289673a30 Implement support for IP_ANY_TYPE in SNMP 2016-02-29 19:31:19 +01:00
Dirk Ziegelmeier
6aed6e659f Rework DHCP PCB handling: Old code registered one UDP PCB per netif where DHCP was active and there was a special case in udp_input() for this. New implementation uses one PCB for all netifs and removes special case in udp_input().
The old approach called udp_bind() on each of the PCBs, which puts them into udp_pcbs list. The PCBs were iterated on all non-DHCP udp_inputs() with no effect.
My cleanup removes the special handling in udp.c, and uses only one DHCP UDP PCB to catch all DHCP messages from all netifs. The dhcp_recv function then checks whether ip_current_input_netif() has DHCP enabled - if not, the message is ignored. The PCB is only created/registered when one or more PCBs have DHCP enabled.
2016-02-29 19:31:19 +01:00
Dirk Ziegelmeier
42c92f80f1 Add compatibility macro for udp_new_ip6() 2016-02-29 13:25:13 +01:00