Commit Graph

2701 Commits

Author SHA1 Message Date
Simon Goldschmidt
4335e99f2e netconn_gethostbyname() needs to check for name length when LWIP_MPU_COMPATIBLE==1 2014-09-02 21:40:05 +02:00
Simon Goldschmidt
1fd4b851f5 Moved #define NETDB_ELEM_SIZE from dns.h to netdb.h, where it belongs, and use sizeof() instead of hacked constants that are wrong on 64-bit platforms 2014-09-02 21:27:24 +02:00
Simon Goldschmidt
142cc8fe2a minor: fixed a comment typo only 2014-09-02 21:26:35 +02:00
Simon Goldschmidt
5c37c63cef fixed bug #42117 lwip_fcntl does not set errno 2014-09-02 21:08:30 +02:00
Simon Goldschmidt
39caf630a9 fixed bug #42299 tcp_abort() leaves freed pcb on tcp_bound_pcbs list 2014-09-02 20:59:00 +02:00
goldsimon
b0502d1f3b added optional macros PACK_STRUCT_FLD_8() and PACK_STRUCT_FLD_S() to prevent gcc 4 from warning about struct members that do not need packing 2014-09-02 13:04:36 +02:00
goldsimon
678dcc2ca5 Moved IPv4/IPv6 headers to common include folder, now that their names are unique -> no need to add 3 directories to the include path when compiling lwIP 2014-09-01 17:19:08 +02:00
goldsimon
54d4d9a881 Fix warning for compilers propagating ~'ed u8_t to int... 2014-09-01 15:57:56 +02:00
Simon Goldschmidt
a5e06ed5b7 fixed bug #42987 lwIP is vulnerable to DNS cache poisoning due to non-randomized TXIDs 2014-08-31 20:29:56 +02:00
goldsimon
7cea4d7df6 bug #42998: made NETIF_MAX_HWADDR_LEN overridable for some special networks 2014-08-19 16:09:00 +02:00
goldsimon
936066aa03 tiny formatting correction 2014-08-19 14:25:57 +02:00
Simon Goldschmidt
e7f3224091 again bug #26069: Documentation of tcp_connect() incorrectly describes handling of errors 2014-06-04 20:54:02 +02:00
Simon Goldschmidt
974f6982a1 fixed bug #37969 SYN packet dropped as short packet in tcp_input function 2014-06-03 21:07:49 +02:00
Sylvain Rochet
7fe7e1e984 Merge branch 'ppp-new'
Based from pppd 2.4.5, released 2009-11-17, with huge changes to match
code size and memory requirements for embedded devices, including:
- Gluing together the previous low-level PPP code in lwIP to pppd 2.4.5, which
  is more or less what pppd sys-* files are, so that we get something working
  using the unix port.
- Merged some patchs from lwIP Git repository which add interesting features
  or fix bugs.
- Merged some patchs from Debian pppd package which add interesting features
  or fix bugs.
- Ported PPP timeout handling to the lwIP timers system
- Disabled all the PPP code using filesystem access, replaced in necessary cases
  to configuration variables.
- Disabled all the PPP code forking processes.
- Removed IPX support, lwIP does not support IPX.
- Ported and improved random module from the previous PPP port.
- Removed samba TDB (file-driven database) usage, because it needs a filesystem.
- MS-CHAP required a DES implementation, we added the latest PolarSSL DES
  implementation which is under a BSD-ish license.
- Also switched to PolarSSL MD4,MD5,SHA1 implementations, which are meant to be
  used in embedded devices with reduced memory footprint.
- Removed PPP configuration file parsing support.
- Added macro definition EAP_SUPPORT to make EAP support optional.
- Added macro definition CHAP_SUPPORT to make CHAP support optional.
- Added macro definition MSCHAP_SUPPORT to make MSCHAP support optional.
- Added macro definition PAP_SUPPORT to make PAP support optional.
- Cleared all Linux syscall calls.
- Disabled demand support using a macro, so that it can be ported later.
- Disabled ECP support using a macro, so that it can be ported later.
- Disabled CCP support using a macro, so that it can be ported later.
- Disabled CBCP support using a macro, so that it can be ported later.
- Disabled LQR support using a macro, so that it can be ported later.
- Print packet debug feature optional, through PRINTPKT_SUPPORT
- Removed POSIX signal usage.
- Fully ported PPPoS code from the previous port.
- Fully ported PPPoE code from the previous port.
- Fully ported VJ compression protocol code from the previous port.
- Removed all malloc()/free() use from PPP, replaced by stack usage or PBUF.
- Disabled PPP server support using a macro, so that it can be ported later.
- Switched all PPP debug to lwIP debug system.
- Created PPP Control Block (PPP PCB), removed PPP unit integer everywhere,
  removed all global variables everywhere, did everything necessary for
  the PPP stack to support more than one PPP session (pppd only support
  one session per process).
- Removed the statically allocated output buffer, now using PBUF.
- Improved structure size of all PPP modules, deep analyze of code to reduce
  variables size to the bare minimum. Switched all boolean type (char type in
  most architecture) to compiler generated bitfields.
- Added PPP IPv6 support, glued lwIP IPv6 support to PPP.
- Now using a persistent netif interface which can then be used in lwIP
  functions requiring a netif.
- Now initializing PPP in lwip_init() function.
- Reworked completely the PPP state machine, so that we don't end up in
  anymore in inconsistent state, especially with PPPoE.
- Improved the way we handle PPP reconnection after disconnect, cleaning
  everything required so that we start the PPP connection again from a
  clean state.
- Added PPP holdoff support, allow the lwIP user to wait a little bit before
  reconnecting, prevents connection flood, especially when using PPPoL2TP.
- Added PPPoL2TP LAC support (a.k.a. UDP tunnels), adding a VPN client
  feature to lwIP, L2TP being a widely used tunnel protocol.
- Switched all used PPP types to lwIP types (u8t, u16t, u32t, ...)
- Added PPP API "sequential" thread-safe API, based from NETIFAPI.
2014-05-22 21:25:58 +02:00
Simon Goldschmidt
9148ab79f3 fixed bug #37184 tcp_write problem for pcbs in the SYN_SENT state 2014-05-20 22:12:36 +02:00
goldsimon
1204f15bfa bug #35874 reserved identifier violation, 2nd part 2014-05-20 12:27:18 +02:00
goldsimon
f1c7e73bef fixed last commit (copy & paste from patch broke the code) 2014-05-20 12:22:13 +02:00
Simon Goldschmidt
c18abd4fbe Fixed bug #41686 (ipv4 ip_reass() crash error) introduced some months ago while fixing bug #41041... 2014-05-19 22:07:57 +02:00
Simon Goldschmidt
c3ac875055 Fixed typo-bug introduced some months ago while fixing bug #41041... 2014-05-19 22:03:19 +02:00
Simon Goldschmidt
dbd125c714 Fixed bug #35874 reserved identifier violation (removed leading underscores from header include guards) 2014-05-19 21:46:18 +02:00
Simon Goldschmidt
695e001984 lwip_gethostbyname: fixed using uninitialized variable when LWIP_DNS_API_HOSTENT_STORAGE==1 2014-05-15 21:17:41 +02:00
Sylvain Rochet
33b42872e5 Merge branch 'master' into ppp-new 2014-05-08 14:25:30 +02:00
goldsimon
8bb7602145 SNMP: fix "uninitialized variable" warning 2014-05-06 09:42:41 +02:00
Sylvain Rochet
d9e2edd1df Merge branch 'master' into ppp-new 2014-05-05 20:55:18 +02:00
Simon Goldschmidt
f9d80d5bd2 try to fix another warning from static code analysis 2014-04-30 22:11:49 +02:00
goldsimon
406874b6c2 snmp: added missing default cases (only used for trace output) 2014-04-30 13:50:18 +02:00
goldsimon
e4ddd6cb6d Multiple fixes found by coverity scan 2014-04-30 12:22:31 +02:00
Sylvain Rochet
a7745e9a86 PPP, PPPoE, fixed bug #42138, pppoe_destroy() called with wrong pointer, PPPoE control block was never freed 2014-04-19 23:38:24 +02:00
Sylvain Rochet
3fd7bc8058 PPP, updated pppd followup 2014-04-15 22:57:59 +02:00
Sylvain Rochet
25e398a8f0 PPP, from PPPD upstream, accept IPCP ConfAck packets containing MS-WINS options
pppd: Accept IPCP ConfAck packets containing MS-WINS options

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

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

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

This fixes it.
2014-04-15 22:55:28 +02:00
Sylvain Rochet
c31b03327f PPP, from PPPD upstream, Don't crash if NULL pointer passed to vslprintf for %q or %v
pppd: Don't crash if NULL pointer passed to vslprintf for %q or %v

This is to avoid crashes like that reported in
https://bugs.launchpad.net/ubuntu/+source/ppp/+bug/1244714
2014-04-15 22:50:53 +02:00
Sylvain Rochet
f6d56e2937 PPP, from PPPD upstream, take out unused %r conversion completely,
pppd: Take out unused %r conversion completely

This just removes some code surrounded by #if 0/#endif, which Fedora
apparently feels the need to patch...
2014-04-15 22:34:24 +02:00
Sylvain Rochet
ca7769e041 Merge branch 'master' into ppp-new 2014-04-12 01:25:00 +02:00
Sylvain Rochet
c0aef7dd6b PPP, VJ compression enabled, fixed IP forward from PPP to Ethernet by allocating a PBUF_LINK instead of a PBUF_RAW if IP forwarding is enabled 2014-04-12 01:23:57 +02:00
Sylvain Rochet
4283ecf774 PPP, PPPoS, fixed IP forward from PPP to Ethernet by allocating PBUF_LINK instead of PBUF_RAW if IP forwarding is enabled 2014-04-11 22:31:01 +02:00
Simon Goldschmidt
88a57dc98d Fixed bug #36167 tcp server crash when client closes (maximum window) 2014-04-08 21:26:27 +02:00
Simon Goldschmidt
035ecef8a5 Fixed bug #36210 lwIP does not elicit an empty ACK when received unacceptable ACK 2014-04-06 22:40:51 +02:00
Simon Goldschmidt
4c3b6814dc Fixed compiling broken ip6.c after last commit 2014-04-06 22:33:27 +02:00
Simon Goldschmidt
3f016fcc5a Multiple small/minor issues: bug #36492 Static Analysis on code 1.4.0 2014-04-06 21:43:37 +02:00
Simon Goldschmidt
be75c483d0 Fixed bug #41787 DHCP Discovery is invalid when an IP is set to thet netif (send discover, request and decline from 'any').
Addd functions to send udp/ipv4/ipv6 packets with source address 'any' although netif has an address assigned
2014-04-06 20:32:37 +02:00
Sylvain Rochet
08dd32d32d PPP, most PPP headers are using u_long, u_int, u_short and u_char types, moved typedef of those types before we include any PPP header 2014-04-04 20:42:01 +02:00
Sylvain Rochet
b49584457a Merge branch 'master' into ppp-new 2014-03-23 13:17:55 +01:00
goldsimon
40d25adb88 Added LWIP_HOOK_ETHARP_GET_GW to implement IPv4 routing with multiple gateways 2014-03-17 12:53:31 +01:00
Sylvain Rochet
a38e5a44ec Merge branch 'master' into ppp-new 2014-03-14 20:48:12 +01:00
Simon Goldschmidt
3fceef0936 - fixed bug #36153 TCP Cheksum error if LWIP_CHECKSUM_ON_COPY=1;
- don't fail on small mss or snd_wnd_max
2014-03-14 19:46:24 +01:00
Simon Goldschmidt
c065427ebe fixed bug #35928 BSD sockets functions must set errno for POSIX-compliance (patch by Mason) 2014-03-11 20:53:44 +01:00
Simon Goldschmidt
c82f04f54c fixed bug #40303 DHCP xid renewed when sending a DHCPREQUEST 2014-02-27 22:44:16 +01:00
Simon Goldschmidt
d9d0c52770 fixed bug #41680 raw socket can not receive IPv6 packet when IP_SOF_BROADCAST_RECV==1 2014-02-27 22:18:45 +01:00
Simon Goldschmidt
c60635855d fixed bug #38404 getpeeraddr returns success on unconnected/listening TCP sockets 2014-02-27 21:28:15 +01:00
Simon Goldschmidt
2666d6df90 fixed bug #41729 Some socket functions return Exyz instead of -1 2014-02-27 20:57:37 +01:00
Simon Goldschmidt
8558fa0bcf etharp_entry::ctime must be u16_t after changing ARP_TMR_INTERVAL from 5 seconds to 1 second when fixing bug #34682 2014-02-26 21:51:56 +01:00
Simon Goldschmidt
f36d6b7ef5 fixed bug #39514 ip_route() may return an IPv6-only interface 2014-02-25 22:37:52 +01:00
Simon Goldschmidt
e9908048ec fixed bug #39356 Wrong increment in pbuf_memfind() 2014-02-25 22:34:27 +01:00
Simon Goldschmidt
dceed2ea5c fixed bug #39225 udp.c uses netif_matches_ip6_addr() incorrectly; renamed function netif_matches_ip6_addr() to netif_get_ip6_addr_match() 2014-02-25 22:30:46 +01:00
Simon Goldschmidt
7b63878926 Fixed bug #39224 Unused IPv6 address state defines in nd6 2014-02-25 22:26:02 +01:00
Simon Goldschmidt
01ecd3517e fixed bug #39145 IGMP membership report for 224.0.0.1
-> ensure that we never send a report for 224.0.0.1
2014-02-25 22:21:31 +01:00
Simon Goldschmidt
fbdea8dc71 fixed bug #39076 ETHARP_STATS is not defined when LWIP_STATS is 0 2014-02-25 22:14:26 +01:00
Sylvain Rochet
58d0e8b28f Merge branch 'master' into ppp-new 2014-02-24 20:21:47 +01:00
Simon Goldschmidt
07fbe82305 fixed bug #34681 Limit ARP queue length by ARP_QUEUE_LEN (=3) 2014-02-22 21:38:56 +01:00
Simon Goldschmidt
05a967564a fixed bug #34682 Limit ARP request flood for unresolved entry 2014-02-22 21:23:06 +01:00
Sylvain Rochet
75ef1278e6 Merge branch 'master' into ppp-new 2014-02-21 20:37:10 +01:00
Simon Goldschmidt
fc158ad5c0 Fixed netconn_gethostbyname for LWIP_MPU_COMPATIBLE: removed invalid check on 'addr', copy 'name' since it could be located on the caller's stack 2014-02-21 09:04:39 +01:00
Simon Goldschmidt
4d69d0eda5 Fixed IPv6 raw checksumming after a hint from Philip Gladstone 2014-02-21 08:41:44 +01:00
Sylvain Rochet
d7ba4bbb9b Merge branch 'master' into ppp-new 2014-02-21 00:39:29 +01:00
Simon Goldschmidt
2225b8add7 fixed bug #39683 Assertion "seg->tcphdr not aligned" failed with MEM_ALIGNMENT = 8 2014-02-20 22:35:37 +01:00
Simon Goldschmidt
9572db262c Fixed bug #39718: disconnecting an UDP socket reports an error 2014-02-20 22:32:57 +01:00
Simon Goldschmidt
515e4b9187 fixed bug #39882 No function shall set errno to 0 2014-02-20 22:23:40 +01:00
Simon Goldschmidt
c1dc1a20d6 fixed bug #40050 SNMP problem with MIB arrays > 255 2014-02-20 22:14:10 +01:00
Simon Goldschmidt
a58083b11e Fixed comment on LWIP_HAVE_LOOPIF 2014-02-20 22:09:38 +01:00
Simon Goldschmidt
0f24fba28a IGMP: fixed !define LWIP_RAND case 2014-02-20 22:07:58 +01:00
Simon Goldschmidt
4d774e275d netconn::recv_avail: forgot one line 2014-02-20 22:01:13 +01:00
Simon Goldschmidt
a2d6a50dff fixed bug #41499 netconn::recv_avail can overflow 2014-02-20 21:55:11 +01:00
Freddie Chopin
08b56e8180 SNMP: mib-2.system.sysObjectID is read-only, so make the object "static const" and modify just the pointer; snmp_get_sysobjid_ptr() and snmp_set_sysobjid() take a pointer to "const" object now
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
2014-02-20 21:24:23 +01:00
Freddie Chopin
7a77917df6 SNMP: use MEMCPY() instead of ocstrncpy() and objectidncpy()
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
2014-02-20 21:24:21 +01:00
Erik Ekman
e432014a88 netif: Update header file documentation
IPv6 output method referenced old method name.
2014-02-20 21:22:39 +01:00
Simon Goldschmidt
a89db9872d Added missing IPPROTO_RAW 2014-02-20 21:13:13 +01:00
Simon Goldschmidt
6dcc85dcf4 patch #7993: Added support for transmitting packets with VLAN headers via hook function LWIP_HOOK_VLAN_SET and to check them via hook function LWIP_HOOK_VLAN_CHECK 2014-02-20 21:08:50 +01:00
Simon Goldschmidt
a375ea4ee2 Minor: coding style cleanups... 2014-02-20 20:09:33 +01:00
Grant Erickson
d74464e091 Add RFC3542-style checksum compuation on raw, IPv6 sockets
This patch adds support for RFC3542-style checksum computation on raw,
IPv6 sockets via the IPV6_CHECKSUM socket option.

This allows the development of application-layer utilities such as
ping6 which are unable to compute the raw packet checksum without a
prior knowledge of the source address selection.
2014-02-20 20:01:37 +01:00
Simon Goldschmidt
e2c2afbbe0 patch #7885: modification of api modules to support FreeRTOS-MPU (don't pass stack-pointers to other threads) (based on patch by Artem Pisarenko) 2014-02-20 19:50:17 +01:00
Simon Goldschmidt
cffe54d094 Patch #7815 by James Smith: added inet_ntop/inet_pton 2014-02-20 16:10:55 +01:00
Simon Goldschmidt
2f02120fee Fixed typo. 2014-02-20 15:43:51 +01:00
Simon Goldschmidt
c0b534e531 Minor fixes to init.c preprocessor checks 2014-02-12 22:20:25 +01:00
Erik Ekman
5eaef50a77 Remove newlines in LWIP_ERROR calls 2014-02-12 22:10:36 +01:00
Simon Goldschmidt
ef6ec9de01 Merge branch 'master' of git.sv.gnu.org:/srv/git/lwip 2014-02-12 21:34:43 +01:00
Simon Goldschmidt
751deac9d1 Another fix to window scaling: support queueing more than 64 KByte in ooseq data 2014-02-12 21:34:19 +01:00
Sylvain Rochet
406da499ff Merge branch 'master' into ppp-new 2014-02-09 16:40:43 +01:00
Sylvain Rochet
a6b48d5273 normalize to LF (auto cleaned due to git attributes and must be commited before switching branch) 2014-02-09 16:34:47 +01:00
Simon Goldschmidt
6272b5c58c Fixed misleading comment on sys_untimeout() 2014-02-07 14:03:53 +01:00
Simon Goldschmidt
8c9b99458d Fixed forgotten brackets in last commit 2014-02-07 12:11:36 +01:00
Simon Goldschmidt
3273c68b63 Added comments to clarify the LWIP_TCP_TIMESTAMPS option. 2014-02-07 11:46:23 +01:00
Simon Goldschmidt
a44e2190d6 TCP window scaling: change tcp_pcb::acked to u32_t when window scaling is enabled to prevent an overflow when more than 64 Kbytes are ACKed 2014-02-07 11:32:02 +01:00
Simon Goldschmidt
2dab478c3f Merge branch 'master' of git.sv.gnu.org:/srv/git/lwip
Conflicts:
	src/core/tcp_out.c
	src/include/ipv4/lwip/ip4_addr.h
2014-02-07 09:40:10 +01:00
Simon Goldschmidt
d2a89b424b patch #6537/#7858: TCP window scaling support (OOS queueing still needs special handling) 2014-02-06 22:34:06 +01:00
Sylvain Rochet
9502cd7047 Merge branch 'master' into ppp-new 2014-01-19 14:32:14 +01:00
Sylvain Rochet
cd02450095 recently applied patches changed LF-terminated filed to mostly LF and CR+LF only where the patches changed lines 2014-01-19 14:28:17 +01:00
Sylvain Rochet
03a3412e62 Merge branch 'master' into ppp-new 2014-01-19 03:41:01 +01:00
Simon Goldschmidt
33086e6db0 patch #7920 thread-safe api dhcp calls for dhcp_infor, dhcp_renew and dhcp_release 2014-01-18 22:48:15 +01:00
Stathis Voukelatos
38bfe50508 Fixed size calculation in MALLOC memory pool creation macro.
The LWIP_MALLOC_MEMPOOL macro needs to use the aligned size of the
memp_malloc_helper structure, since mem_alloc() uses it to calculate
the required pool element size. If LWIP_MEM_ALIGN_SIZE(x) is redefined
to align to something larger than 4, then in some cases
the current code can lead to unexpected mem_alloc() failures.
For example:
    #define LWIP_MEM_ALIGN_SIZE(size)       (((size) + 31) & ~31)
and the largest MALLOC pool is of size 60 bytes, e.g.:
    #define LWIP_MALLOC_MEMPOOL(256, 60)
then the following call:
    mem_malloc(58)
will cause an assertion.
2014-01-18 22:40:16 +01:00
Simon Goldschmidt
a70567e74f patch #8009 by chrysn: stats_display_igmp used by ml6d 2014-01-18 22:16:09 +01:00