Commit Graph

2842 Commits

Author SHA1 Message Date
Sylvain Rochet
ee2ba4e52f Merge branch 'master' into ppp-new 2013-07-20 21:04:49 +02:00
Simon Goldschmidt
ae300c98a4 partially fixed bug #37585: IPv6 compatibility (in socket structs) 2013-06-29 21:47:22 +02:00
Simon Goldschmidt
748b70311e bug #37585/task #12600: fixed struct in6_addr.s6_addr to conform to spec 2013-06-29 21:16:59 +02:00
Simon Goldschmidt
8d0664186a - removed include instead of commenting it out;
- CHANGELOG should contain worthy entries only, a complete log of all source code changes can be found in git (I'm not saying this has always been observed, but I'd like to keep the list of changes as short as possible for anyone to read if interested)
2013-06-19 22:26:29 +02:00
Simon Goldschmidt
2fb5a71efd patch #8030: fixed spelling of "received" 2013-06-19 22:23:05 +02:00
Sylvain Rochet
4fda366b67 PPP, added PPP notify phase support
PPP notify phase support, using compile-time PPP_NOTIFY_PHASE macro.

This can be used for example to set a LED pattern depending on the
current phase of the PPP session.

Callback example:

static void ppp_notify_phase_cb(ppp_pcb *pcb, u8_t phase, void *ctx) {
  switch(phase) {
      case PPP_PHASE_DEAD:  /* Kept off */
      case PPP_PHASE_MASTER:
        /* LED Off */
        break;
      case PPP_PHASE_INITIALIZE:  /* Session opened */
        /* LED FastBlink */
        break;
      case PPP_PHASE_RUNNING:  /* Session running */
        /* LED On */
        break;
      default:
        /* LED SlowBlink */
   }
}
2013-04-30 15:16:09 +02:00
Sylvain Rochet
2ceae6014e PPP, reduced by one buffer PPPoS RX requirements in multithreaded context
Removed one unecessary allocated PBUF per PPPoS RX packet if PPP_INPROC_MULTITHREADED is set by adding the necessary data for
pppos_input_callback() in front of the first pbuf instead of allocating a new buffer.
2013-04-26 23:24:08 +02:00
Sylvain Rochet
cf3162cff1 PPP, moved PPP_INPROC_MULTITHREADED compile time option from ppp.h to opt.h 2013-04-26 21:55:30 +02:00
Sylvain Rochet
2350d941a5 PPP, added PPP_USE_PBUF_RAM compile time option
pbuf_type PPP is using for LCP, PAP, CHAP, EAP, IPCP and IP6CP packets.

Memory allocated must be single buffered for PPP to works, it requires pbuf
that are not going to be chained when allocated. This requires setting
PBUF_POOL_BUFSIZE to at least 512 bytes, which is quite huge for small systems.

Setting PPP_USE_PBUF_RAM to 1 makes PPP use memory from heap where continuous
buffers are required, allowing you to use a smaller PBUF_POOL_BUFSIZE.
2013-04-26 21:51:15 +02:00
Sylvain Rochet
25f9f55878 PPP, removed PPP_INPROC_OWNTHREAD feature, which almost only make things harder
I consider to remove the PPP_INPROC_OWNTHREAD crap in ppp-new,
as said in bugs #37278 and #37353.

1. It requires the ppp_input_thread() function to be modified to match
user system, like some did by adding the vTaskDelete(NULL); FreeRTOS
call at the end of the function, for example.

This is a tiny-tiny fonction that should be, in my opinion, on the user
port, like the Ethernet input thread we see in many Ethernet port.

2. It is actually not that thread safe.

2.1. pcb->phase IS modified by the lwIP core thread so it should at
least be set to volatile, otherwise the pcb->phase copy may live
indefinitely in CPU register. It works because of the sio_read()
function call which without doubt flush pcb->phase copy from CPU
register. I dont want to set ppp_pcb struct to volatile for obvious
performance reasons.

2.2. This function assume PCB still exists whatever is happening, which
is not the case after you called ppp_delete() function outside of this
thread. If sio_read() is blocking waiting data and pcb destroyed, it is
going to read a deallocated pcb which luckily should still have
pcb->phase set to 0 (=PHASE_DEAD) due to preallocated "control block"
structures of lwIP. Even with sio_read_abort(), there might be timings
issue due to a lack of a synchronization mechanism.

3. I dislike the sys_msleep(1), it means that systems should have at
least a 11 chr buffer at 115200/10 byte/s, and bigger with higher serial
speed, for example with 3G/HSDPA modems accessed through SPI, at 20
Mbits/s this is a ~2000 bytes buffer required to keep incoming data
during this sleep, I don't see why we require systems to do so,
sio_read() should obviously be a blocking call. I cannot easily
remove this sleep because some systems might have wrongfully used this
call as a CPU idle feature with a non blocking sio_read() call.
2013-04-26 20:30:01 +02:00
Sylvain Rochet
07540f3386 Merge branch 'master' into ppp-new 2013-04-26 20:01:18 +02:00
Sylvain Rochet
fe63f36656 picked up the wrong commit date in CHANGELOG, fixed 2013-04-26 19:59:05 +02:00
Sylvain Rochet
434daf87c2 Merge branch 'master' into ppp-new 2013-04-26 19:54:01 +02:00
Sylvain Rochet
c681e5e082 reverted dhcp.c from DOS (CRLF) to UNIX (LF) format 2013-04-26 19:52:42 +02:00
Sylvain Rochet
549f97b54a cleared compilation warning, C++ style comments are not allowed in ISO C90 2013-04-26 19:48:57 +02:00
Sylvain Rochet
f47a93b0c1 PPP, cleared compilation warning about unused variable 'pcb' in ppp_drop() if neither VJ nor SNMP support are enabled 2013-04-26 14:02:30 +02:00
Sylvain Rochet
3fe5a99dab Merge branch 'master' into ppp-new 2013-04-25 00:36:12 +02:00
Simon Goldschmidt
097bc4c622 patch #8008 Fix a potential null pointer dereference in assert 2013-04-24 22:28:22 +02:00
Simon Goldschmidt
252126cf76 fixed possible division by zero 2013-04-24 22:20:12 +02:00
Simon Goldschmidt
8609d1e790 fixed bug #38526 Coverity: Recursive Header Inclusion in ip6.h 2013-04-24 21:58:57 +02:00
Simon Goldschmidt
9809f1ff66 Fixed bug #38586 2013-04-24 21:38:01 +02:00
Simon Goldschmidt
796098e4c9 fixed bug #38701 (wrong comment on tcp_pcb::snd_queuelen 2013-04-24 21:28:56 +02:00
Simon Goldschmidt
eb6bcdb3ee Removed the demand to post trivial patches to lwip-users, things keep getting lost there. 2013-04-24 20:55:45 +02:00
Sylvain Rochet
a1555e0615 PPP, added ppp_free()
Free the control block, clean everything except the PPP PCB itself
and the netif, it allows you to change the underlying PPP protocol
(eg. from PPPoE to PPPoS to switch from DSL to GPRS) without losing
your PPP and netif handlers.
2013-04-23 00:19:07 +02:00
Sylvain Rochet
44b527415f PPP, slight API change, great code factorisation
Created new ppp_over_X_create() functions which only prepare the PPP session without starting it
Removed ppp_reopen() and all of its sub ppp_over_X_reopen()
Removed PPPoL2TP reconnect() function, merged to connect()
Added ppp_open() able to start or restart any session
2013-04-22 23:58:51 +02:00
Sylvain Rochet
ed294c5945 PPP, removed ppposapi_input(), unnecessary because pppos_input() is already thread-safe 2013-04-22 21:21:04 +02:00
Sylvain Rochet
bd3ade31fa PPP, added define for u_long, u_int, u_short, u_char for compilers or toolchains which don't have them 2013-04-22 21:16:02 +02:00
Sylvain Rochet
d03d2e6d3d PPP, added ppp_addrs() macro to get the pointer of the ppp->addrs struct 2013-04-22 21:09:28 +02:00
Sylvain Rochet
58ffa8d526 PPP, free input pbuf left in ppp_delete() 2013-02-27 22:29:22 +01:00
Sylvain Rochet
bfe8c15a29 PPP, fixed return code coherency for ppp_netif_output_*() callbacks (using ERR_* as expected by lwIP core instead of PPPERR_*) 2013-02-22 11:52:44 +01:00
Sylvain Rochet
2fa7e003b1 PPP, fixed LCP delayed up feature
LCP is stealing a bit from fsm->flags struct member for LCP delayed up feature.
Bit stealed used to be the 9th bit (0x100) but fsm->flags was reduced to u8_t to save memory,
we are now stealing the 8th bit (0x80).
2013-01-31 15:36:30 +01:00
Sylvain Rochet
ba948669cd Merge branch 'master' into ppp-new 2013-01-29 10:59:39 +01:00
goldsimon
666e84eef2 Improved/fixed comments about timeout. 2013-01-24 09:02:19 +01:00
Sylvain Rochet
69b15c889d Merge branch 'master' into ppp-new 2013-01-20 02:57:57 +01:00
Simon Goldschmidt
ff3bf6d7f5 fixed bug #37665 ip_canforward operates on address in wrong byte order 2013-01-15 21:10:32 +01:00
Simon Goldschmidt
b844129649 fixed bug #38097 pbuf_free_ooseq() warning 2013-01-15 21:07:01 +01:00
Simon Goldschmidt
86059bd5dd fixed more unused variables 2013-01-14 21:06:13 +01:00
Simon Goldschmidt
9927d991ef Fixed bug #37893 Unused variables in tcp_out (and in udp.c/.h) 2013-01-14 20:46:41 +01:00
Simon Goldschmidt
6849b7d555 Added additional sanity check that all headers (without IP- or TCP options) fit into the first pbuf. 2013-01-14 18:05:18 +01:00
Simon Goldschmidt
1efd1ee6ac fixed bug #37705 Possible memory corruption in DNS query 2013-01-14 18:04:04 +01:00
Simon Goldschmidt
d12600fba0 fixed bug #37705 Possible memory corruption in DNS query 2013-01-14 18:03:23 +01:00
Simon Goldschmidt
769b2a3e30 fixed bug #38066 Raw pcbs can alter packet without eating it: added assertion to check that p->payload is unchanged 2013-01-11 21:59:26 +01:00
Simon Goldschmidt
d237ec7e78 Changed C++ comments to C style 2013-01-11 21:27:45 +01:00
Sylvain Rochet
de1375201f PPP, "try" variable used in LCP might conflict with some buggy C++ compiler 2013-01-04 23:08:11 +01:00
Sylvain Rochet
13ba8810c7 PPP, fixed one more IAR warnings 2013-01-04 22:51:13 +01:00
Sylvain Rochet
bdfbac2aa6 PPP, added missing semicolon (dammit) 2012-12-23 22:58:52 +01:00
Sylvain Rochet
6bd0bd2ed1 Merge branch 'master' into ppp-new 2012-12-23 22:56:51 +01:00
Sylvain Rochet
211a889528 PPP, fixed some IAR warnings
these are the compiler warnings I get with the head of ppp-new. All
of them are trivial, [...] (I'm using IAR EWARM 6.4).

ppp.c
Warning[Pe550]: variable "c" was set but never used
lwip\src\netif\ppp\ppp.c 1012

Warning[Pe111]: statement is unreachable
lwip\src\netif\ppp\ppp.c 1132

Warning[Pe111]: statement is unreachable
lwip\src\netif\ppp\ppp.c 1377

Warning[Pe111]: statement is unreachable
lwip\src\netif\ppp\ppp.c 1412

utils.c
Warning[Pe186]: pointless comparison of unsigned integer with zero
lwip\src\netif\ppp\utils.c 210
2012-12-23 22:52:58 +01:00
Ivan Delamer
3bb29bf63a Fix bug #37959: ip6_debug_print prints plen, nexth, hoplim in wrong
byte order
2012-12-19 16:38:44 -07:00
Sylvain Rochet
78d52ad2de Merge branch 'master' into ppp-new 2012-12-19 14:05:59 +01:00