Commit Graph

325 Commits

Author SHA1 Message Date
sg
39e32ea7c1 fixed const warning for !IPV6_FRAG_COPYHEADER 2015-09-17 21:59:54 +02:00
Dirk Ziegelmeier
f62022cdf3 Compiler warning fixes (mostly constness in dual-stack configurations) 2015-09-17 13:59:52 +02:00
sg
68a1ec2eb1 Fixed passing ip_input() to netif_add() for single-IP-version NO_SYS configurations 2015-09-16 22:09:54 +02:00
Stian Sebastian Skjelstad
aea87a9a2f Forget addresses set up by SLAAC when prefix expires. 2015-09-02 13:12:52 -06:00
sg
aa0e41c389 task #12178: hardware checksum capabilities can be configured per netif (use NETIF_SET_CHECKSUM_CTRL() in your netif's init function) 2015-09-01 22:04:15 +02:00
goldsimon
dd8feb49aa PBUF_REF with "custom" pbufs is now supported for RX pbufs (see pcapif in contrib for an example, LWIP_SUPPORT_CUSTOM_PBUF is required) 2015-08-31 08:29:23 +02:00
Sylvain Rochet
ddba4b90c3 fixed typo: IP6_FRAG_COPYHEADER -> IPV6_FRAG_COPYHEADER 2015-08-28 14:28:04 +02:00
sg
bc8120c864 Add another sanity check for bug #41009 2015-08-27 21:43:42 +02:00
sg
f649172580 fixed bug bug #41009: IPv6 reassembly broken on 64-bit platforms: define IPV6_FRAG_COPYHEADER==1 on these platforms to copy the IPv6 header instead of referencing it, which gives more room for struct ip6_reass_helper 2015-08-26 22:16:23 +02:00
sg
aad76acb68 IPV6_REASS: fix ip6_reass_remove_oldest_datagram() when the first fragment to enqueue has more pbufs than IP_REASS_MAX_PBUFS 2015-08-26 21:20:13 +02:00
sg
94550682d7 more cleanup prework to fix bug #45029 2015-08-24 22:46:34 +02:00
goldsimon
ee2d01ed88 fix compiler warnings when passing u16_t to pbuf_header() 2015-08-24 08:49:51 +02:00
sg
177c06b1f1 - prework for fixing bug #45029: access IPv4 configuration of struct netif via new API (netif_ip4_addr()/netif_ip4_netmask()/netif_ip4_gw()) instead of accessing the struct member directly. This way, we can change the struct member types from ip4_addr_t to ip_addr_t;
- fixed some bugs in calls to ip4_addr*() where the cast to u8_t* did not reveal the wrong address type
2015-08-20 22:39:48 +02:00
goldsimon
8622af77c1 nd6: adapt to constness of IP6_ADDR_ANY6 for IPv6-only configuration 2015-08-20 16:35:49 +02:00
Ivan Delamer
33a51a1bdc Improved IPv6 address formatting in ip6addr_ntoa_r(). 2015-05-05 14:01:38 -06:00
Ivan Delamer
73660f779b changes to ip6addr_aton() to avoid crash with some ill-formatted
strings.
2015-05-05 13:26:17 -06:00
Ivan Delamer
2c79332de7 Only send RS messages if we have a LL address in some state other than
invalid.
2015-05-05 13:05:41 -06:00
Ivan Delamer
2aec025e16 Bug fix: properly use unspecified source address for router solicitation
if needed.
2015-05-05 13:00:17 -06:00
goldsimon
f01dc8cc34 more "const" fixes 2015-04-23 09:59:15 +02:00
goldsimon
e60bc69515 added more missing casts 2015-04-23 07:24:45 +02:00
sg
69c337b31d Fixed ntoa/aton/ntop/pton definitions after making IPv4 optional 2015-04-13 20:52:42 +02:00
sg
c1c65777b6 worked on task #13480: added LWIP_IPV4 define - IPv4 can be disabled, leaving an IPv6-only stack (SNMP is still missing) 2015-04-12 10:43:46 +02:00
Sylvain Rochet
dcdb360a19 ip6_addr.c: fixed IPv6 ip6_addr_any value
0000:0000:0000:0000:0000:0000:0000:0000 instead of
0000:000a:0000:000b:0000:000c:0000:000d
2015-04-11 20:24:56 +02:00
goldsimon
d31dbc6798 Fixed constant initializer problem in ip_addr_t by having ip6 first 2015-04-10 07:41:40 +02:00
sg
ce7e31cd04 task #12722 (improve IPv4/v6 address handling): renamed ip_addr_t to ip4_addr_t, renamed ipX_addr_t to ip_addr_t and added IP version;
ip_addr_t is used for all generic IP addresses for the API, ip(4/6)_addr_t are only used internally or when initializing netifs or when calling version-related functions
2015-04-09 22:21:15 +02:00
sg
93fa268db1 used ip6_addr_t instead of struct ip6_addr, fix const'ness in ip6_route parameters 2015-03-24 21:30:22 +01:00
sg
521c92764d loopif is not required for loopback traffic any more but passed through any netif (ENABLE_LOOPBACK has to be enabled) (task #13515) 2015-03-24 21:22:19 +01:00
sg
71d121fab2 Added input & route hooks for IPv6 to stay in line with IPv4 2015-03-24 20:33:47 +01:00
Sylvain Rochet
f7a5b71dba nd6: fixed compiler warnings
nd6.c: In function ‘nd6_send_rs’:
nd6.c:997:52: warning: suggest parentheses around ‘+’ inside ‘<<’ [-Wparentheses]
   p = pbuf_alloc(PBUF_IP, sizeof(struct rs_header) + lladdr_opt_len << 3, PBUF_RAM);
                                                    ^
nd6.c:998:58: warning: suggest parentheses around ‘+’ inside ‘<<’ [-Wparentheses]
   if ((p == NULL) || (p->len < (sizeof(struct rs_header) + lladdr_opt_len << 3))) {
2015-03-20 20:11:59 +01:00
Ivan Delamer
a4d14fc987 fix bug #44586: nd6_send_rs() pbuf size error 2015-03-20 09:04:22 -06:00
Ivan Delamer
bc08c1d2b7 fixed bug #43095. Check actual link-layer address option length, versus
maximum length defined in struct. Bug would express itself if we have a
netif with 8-byte addresses and other netifs with 6-byte-or-less
addresses.
2015-03-18 13:21:39 -06:00
Ivan Delamer
8451feaa7a fixed bug #42885 nd6_reachability_hint() accepts an address of an
unknown neighbour
2015-03-18 12:22:49 -06:00
Ivan Delamer
12e3b52f4d fixed bug #39226: Validity of netif IPv6 address is not always checked 2015-03-18 11:56:48 -06:00
Ivan Delamer
291f1382c5 fix ip6 part of bug #43904: ip_route() and ip6_route() must detect
linkup status.
2015-03-18 10:56:02 -06:00
sg
f385193a89 Patch #8207 (Don't Use ND6 Prefix Flags Field When LWIP_IPV6_AUTOCONFIG Is Deasserted) 2015-03-06 21:03:21 +01:00
Philip Gladstone
ff078920bc Patch #8360 (Speed up the acquisition of SLAAC addresses) - adapted to bug #43784 2015-03-06 20:58:30 +01:00
sg
72dcdb7655 fixed bug #43784 (a host should send at least one Router Solicitation) 2015-03-04 21:21:49 +01:00
sg
61e0efa0c7 fixed bug #41094 (Byte-order bug in IPv6 fragmentation header test) 2015-03-04 21:02:52 +01:00
sg
90a0590de1 patch by Zach Smith: fixed bug #38153 (nd6_input() byte order issues) 2015-03-04 20:49:02 +01:00
Sylvain Rochet
b4990b5bb4 Fixed warnings on whole project introduced by const pointers on ip_addr_t 2015-02-22 22:50:06 +01:00
sg
ec5cf8593e Continued chrysn's work: changed nearly all functions taking 'ip(X)_addr_t' pointer to take const pointers (changed user callbacks: raw_recv_fn, udp_recv_fn; changed port callbacks: netif_output_fn, netif_igmp_mac_filter_fn) 2015-02-22 21:46:35 +01:00
sg
80b62df0a9 fixed bug #36403 "ip4_input() and ip6_input() always pass inp to higher layers": now the accepting netif is passed up, but the input netif is available through ip_current_input_netif() if required. 2015-02-12 22:04:10 +01:00
goldsimon
1cbd2121e2 Allow to overrid the check for p->ref==1 in TX packets (there *are* netif drivers that can handle this) 2015-01-16 17:58:07 +01:00
goldsimon
4085a3fad4 task #11472 Support PBUF_REF for RX (IPv6 and IPv4/v6 reassembly might not work yet) 2014-12-08 14:45:36 +01:00
Simon Goldschmidt
33237419c1 Parts of patch #8397 Typos corrected in comments and text outputs 2014-09-18 21:15:13 +02:00
Simon Goldschmidt
142cc8fe2a minor: fixed a comment typo only 2014-09-02 21:26:35 +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
Simon Goldschmidt
c3ac875055 Fixed typo-bug introduced some months ago while fixing bug #41041... 2014-05-19 22:03:19 +02:00
goldsimon
e4ddd6cb6d Multiple fixes found by coverity scan 2014-04-30 12:22:31 +02:00
Simon Goldschmidt
4c3b6814dc Fixed compiling broken ip6.c after last commit 2014-04-06 22:33:27 +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
Simon Goldschmidt
7b63878926 Fixed bug #39224 Unused IPv6 address state defines in nd6 2014-02-25 22:26:02 +01:00
Simon Goldschmidt
018719d9d3 patch #8027: Completed HW checksuming for IPv4 and IPv6 ICMP's 2014-01-17 22:32:36 +01:00
Simon Goldschmidt
1e65eb4936 Added IPv6 loopback address to loopback-netif, fixed last commit 2014-01-17 21:55:46 +01:00
Jay Logue
13e40f754c Enable support for IPv6 loopback
Packets are sent through the loopback path when they are addressed to any
of the valid local IPv6 addresses.
2014-01-17 21:32:24 +01:00
Simon Goldschmidt
f311045320 Added an assert that should trigger bug #41009 (IPv6 reassembly broken on 64-bit platforms) 2014-01-10 22:08:01 +01:00
Simon Goldschmidt
381a7b110a fixed bug #41041 Potential use-after-free in IPv6 reassembly 2014-01-10 21:47:42 +01:00
Simon Goldschmidt
8609d1e790 fixed bug #38526 Coverity: Recursive Header Inclusion in ip6.h 2013-04-24 21:58:57 +02: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
"Grant Erickson"
4fe648415f Fixed typo in debug formatting in ip6.c 2012-12-14 16:08:24 -07:00
Ivan Delamer
289566afe8 In ip6_input(), do not accept link-local packets on netifs other than
inp.

Change-Id: I7f3c779e69292bc078890e0acdc37112559644ce
2012-05-04 18:25:22 -06:00
Ivan Delamer
944adc56ee Fixed #define that was commited by mistake.
Change-Id: Ic44560284e932b2d7c503155085160647ac82bb8
2012-05-04 18:19:40 -06:00
Ivan Delamer
6e81f722ad In ip6_input(), accept solicited node packets that match the receiving
netif addresses, when multicast is disabled.

Change-Id: I3f59258ee605a820f0a525b696b1dede0d53948f
2012-05-04 18:11:47 -06:00
Ivan Delamer
bfa28f4c30 fixes bug #36389: Use IPv6 Src Address of Echo Response as Destination
Address in Echo Response
2012-05-04 17:43:54 -06:00
Ivan Delamer
2b4c10e705 Support single-packet queueing in ND6 (similar to ARP), when
!LWIP_ND6_QUEUEING.
2012-03-22 11:14:49 -06:00
Ivan Delamer
ac4c802089 Disable leftover ND6 queueing code when !LWIP_ND6_QUEUING. 2012-03-22 10:25:50 -06:00
Ivan Delamer
773dcae2f9 Missing declarations in supporting IP_HDRINCL. 2012-03-02 09:35:42 -07:00
Ivan Delamer
22e7b674ed Check arguments in nd6, and some other minor fixes nearby. 2012-03-02 09:27:14 -07:00
Ivan Delamer
8c95422204 Early exit when checking if ip6 reassembled packet is valid. 2012-03-02 09:18:54 -07:00
Ivan Delamer
34531a8160 Check that pbuf_header succeeds in IPv6 reassembly. 2012-03-02 09:16:33 -07:00
Ivan Delamer
5c199483cd Support IP_HDRINCL in ip6_output() and ip6_output_hinted(),
previously only supported in ip6_output_if().
2012-03-02 09:06:57 -07:00
Ivan Delamer
c52189557e Fixed error in calculating some IPv6 option header lengths. 2012-03-02 08:59:34 -07:00
Ivan Delamer
bcabe63971 Set ip_data.current_netif earlier to allow ICMPv6 packets in ip6_fwd.
Then set to "accepted" netif, not inp.
2012-03-02 08:53:51 -07:00
goldsimon
26e03b81fe Fixed unused variable warning 2012-02-14 19:41:46 +01:00
goldsimon
5e87126c38 Multiple compilation fixes:
- use C style comments, not C++ style;
- don't use #if with undefined parameter;
2012-02-13 21:38:28 +01:00
Ivan Delamer
1d6347c9b0 Allow unicast NA messages without LLA option, in accordance to RFC2461
section 4.4, and as suggested by Phillip Toelke.

Change-Id: Ic9d9a6ad82ec201d25b9fc024936cfb1b41f1a7a
2012-01-27 14:54:39 -07:00
Ivan Delamer
ce6fb83ef4 bug #34846: time-exceeded was sometimes not sent to original fragment
source, but to the sender of a packet fragment that triggered a buffer
purge.

Change-Id: I4bf20747bd900150491852649918a85cb7bf2aad
2011-11-29 12:49:43 -07:00
goldsimon
96d332e234 Fix icmp6_send_response: cannot assign (packed) ip6_addr_p_t* to ip6_addr_t* -> need to copy the packed address to an aligned address first 2011-11-22 21:41:20 +01:00
Ivan Delamer
cb91705e03 Generate ICMPv6 responses from a context other than input callback
(e.g. timers in IPv6 reassembly). see bug #34846.

Change-Id: I6b4d27c819291d8371c43288310d57c3f2c1c65f
2011-11-17 10:55:45 -07:00
Ivan Delamer
21333d0f18 handle NULL when parsing IPv6 address (check for formatting)
Change-Id: I42e1288689946c295e0bd1490a5eb4d8befb5877
2011-10-28 13:54:16 -06:00
Ivan Delamer
2ce17a724a Fix bug #34526: nd6_queue_packet() frees too much if out-of-memory
Change-Id: Ib7ac0cb1b5a5389dd5449a908485493bd085ba9d
2011-10-26 14:31:48 -06:00
Simon Goldschmidt
6058389974 nd6: use a static buffer to process RA options instead of using mem_malloc() 2011-09-11 13:44:08 +02:00
Simon Goldschmidt
5e8ee7e006 Make LWIP_RAND optional (useful for small targets) 2011-09-03 22:27:30 +02:00
Ivan Delamer
b3f5c8f6b2 Use target address as source address in IPv6 neighbour advertisement
messages.

Change-Id: I06d28eb2903c539de0b51bd7420a81ebf4f28963
2011-08-04 16:36:44 -06:00
Ivan Delamer
4507083148 Fixed bug in serialization of IPv6 addresses.
Change-Id: Ib63540123803317ec25f7cbf580c5159e4100222
2011-08-04 14:18:33 -06:00
Simon Goldschmidt
fc280c7cd6 Fixed bug #33804 LWIP_IPV6_MLD #define missing from mld6.c 2011-07-20 06:56:20 +02:00
Simon Goldschmidt
435ac2a650 Fixed bug #33801 Corruption of nd6 tables 2011-07-19 21:56:19 +02:00
idelamer
4eb5acd9e2 Don't forward IPv6 packets that are larger than outgoing MTU, send ICMPv6 message back for Path MTU discovery. 2011-06-22 12:14:58 +00:00
idelamer
12a948dacb Allow routing IPv6 packets to neighbours with manually-configured non-link-local addresses. 2011-06-17 11:05:38 +00:00
idelamer
137953605e Allow IPv6 addresses with arbitrary prefix. 2011-06-17 11:04:47 +00:00
idelamer
629fad6f5f Minor edits for for IPv6 compilation 2011-06-17 11:03:15 +00:00
goldsimon
89a1420609 Fix compilation error when checking for hidden variable names ('s8_t i' was hidden in some case statements in nd6_input()). 2011-06-08 16:31:55 +00:00
goldsimon
6865806b55 Combined IPv4 and IPv6 code where possible, added defines to access IPv4/IPv6 in non-IP code so that the code is more readable. 2011-05-25 17:16:35 +00:00
goldsimon
90a03a77ad Added new files for IPv6 2011-05-17 19:54:40 +00:00
goldsimon
4bfbe7ebeb ... and finally, we got a first working version of a dual-stack lwIP runnin IPv4 and IPv6 in parallel - big thanks to Ivan Delamer! (this is work in progress, so please beware, test a lot and report problems!) 2011-05-17 19:35:14 +00:00
goldsimon
bcd4b76d31 Moved stack-internal parts of tcp.h to tcp_impl.h, tcp.h now only contains the actual application programmer's API 2010-02-21 11:35:21 +00:00
goldsimon
580f334274 patch #6808: Add a utility function ip_hinted_output() (for smaller code mainly) 2009-04-15 19:32:01 +00:00
goldsimon
4a01122fb7 Use ICMP_STATS_INC instead of #if ICMP_STATS... 2007-11-28 21:21:06 +00:00
goldsimon
4211da00b3 Use IP_STATS_INC instead of #if IP_STATS... 2007-11-28 21:18:37 +00:00
goldsimon
1faf0ab9e3 Moved inet files into ipv4/ipv6 directory; splitted inet.c/inet.h into inet and chksum part; changed includes in all lwIP files as appropriate 2007-11-16 19:31:10 +00:00
fbernon
e3cd1ac1f9 Minor changes (but in lot of files): add #if/#endif for options where they could miss. #if LWIP_xxx if always put after #include "lwip/opt.h" (note this one indirectly include cc.h). Move others includes inside #if/#endif block. 2007-09-07 23:01:59 +00:00
fbernon
ca866c0d7d Integrate "task #7272 : LWIP_ICMP option". The new option LWIP_ICMP enable/disable ICMP module inside the IP stack (enable per default). Be careful, disabling ICMP make your product non-compliant to RFC1122, but help to reduce footprint, and to reduce "visibility" on the Internet. 2007-09-05 17:20:45 +00:00
fbernon
d7da390ae9 Fix coding style (use #if and not #ifdef) for IPv6 2007-08-28 16:03:53 +00:00
goldsimon
eb875de67e Added assertions where PBUF_RAM pbufs are used and an assumption is made that this pbuf is in one piece (i.e. not chained). These assumptions clash with the possibility of converting to fully pool-based pbuf implementations, where PBUF_RAM pbufs might be chained. 2007-07-03 20:28:35 +00:00
goldsimon
255d5a748f Included patch #5920: Create define to override C-library memcpy. 2 Defines are created: MEMCPY() for normal memcpy, SMEMCPY() for situations where some compilers might inline the copy and save a function call. Also replaced all calls to memcpy() with calls to (S)MEMCPY(). 2007-05-10 05:20:05 +00:00
jifl
712a22e18c Applied patch #5832 from Tai-hwa Liang to keep ipv6 building. 2007-04-10 13:18:14 +00:00
kieranm
7294cb080b * Fix all uses of pbuf_header to check the return value. In some
cases just assert if it fails as I'm not sure how to fix them, but
    this is no worse than before when they would carry on regardless
    of the failure.
2007-03-21 12:55:00 +00:00
christiaans
e1b215aa73 Introduced cc.h formatters and removed SO_REUSE from transport layers. 2005-11-25 12:03:38 +00:00
likewise
fd49ee3c8d 2004-11-25 Leon Woestenberg <leon.woestenberg@gmx.net>
* ipv4/ip_addr.h: Renamed ip_addr_maskcmp() to _netcmp() as we are
    comparing network addresses (identifiers), not the network masks
    themselves.
  * ipv4/ip_addr.c: ip_addr_isbroadcast() now checks that the given
    IP address actually belongs to the network of the given interface.
2004-11-25 13:33:07 +00:00
likewise
e1c4bfad05 Merged from DEVEL, except for the API change in etharp.c. 2004-02-07 00:30:03 +00:00
likewise
e4a6d199fe Merged from DEVEL into main tree. 2003-11-14 13:17:23 +00:00
likewise
93dfcdce93 Fixes wrongly cast LWIP_DEBUGF arguments (patch #1596 and more). 2003-06-11 22:34:51 +00:00
likewise
ba786dc49b Applied patch #1596 fixing wrongly cast LWIP_DEBUGF arguments.
(printf expects integers on the var args stack)
2003-06-11 22:11:42 +00:00
kieranm
8014551908 Changed DEBUGF to LWIP_DEBUGF 2003-06-10 10:45:29 +00:00
likewise
df99ce9d98 Replaced all tabs with two spaces (regardless of indentation is correct). 2003-06-09 21:14:47 +00:00
jani
cd65d36822 patches 1492, 1493 and 1494 from Marc 2003-05-19 14:41:54 +00:00
likewise
cda867d52b Applied patches posted by Marc Boucher on lwip-users May 18th 2003. 2003-05-18 22:29:10 +00:00
likewise
03bc7c868b Major stylo search/replace for "One space between keyword and opening bracket." 2003-05-01 13:24:01 +00:00
jani
0ba9a45d32 icmp messages need only PBUF_IP layer 2003-02-25 16:00:21 +00:00
jani
18df3961e9 byte-order handling functions are in inet.c now and the uperrcase counterparts are gone. opt.h has all the
configurable items debug does not need to be directly included.
2003-02-21 16:43:46 +00:00
davidhaas
dd2fa15e8a Add the following features and bugfixes:
Added select() functionality to sockets library.
Support for errno in sockets library.
Byte ordering fixes.
basic lwip_ioctl(), FIONREAD, get/setsockopt() etc. support

- added additional argument to netif_add to pass state pointer so that the
if_init function has access to context information before
the interface is added, without accessing globals.

- added netif_remove()

- to conserve cpu load the tcpip_tcp_timer should only be active
when tcbs that need it exist.

- pass length of available data to callbacks for NETCONN_EVT_RCV events

- added tcpip_link_input(), a hack to allow processing of PPP
packets in tcpip_thread() context. This saves threads and context
switches.

- renamed incompatible ASSERT() macro to LWIP_ASSERT() to avoid name
collision.

- changed a bunch of %d's to %u's in format strings for unsigned values.

- added ip_frag to lwip_stats.

- changed IP_REASS_MAXAGE and IP_REASS_TMO defaults to more realistic
values.

- added sys_timeout_remove() function to cancel timeouts (needed by PPP
amongst other things).

- tolerate NULL returns from sys_arch_timeouts() since some threads might
not need to use or have timeouts.

- added sys_sem_wait_timeout()

- moved mem_malloc() function to end of mem.c to work around tasking
compiler bug.

- automatically bind to local tcp port if 0.

- allow customization of port ranges for automatic local bindings.

- corrected various typos, spelling errors, etc..

Thanks to Marc Boucher for many of these changes.
2003-02-06 22:18:56 +00:00
likewise
cc4df7100d Updated lwIP module copyright years to include 2003. Committers must check theirs. 2003-01-08 10:09:39 +00:00
jani
ef68392388 renamed (hopefully everywhere) stats to lwip_stats.closes bug #1901 2002-12-18 12:49:01 +00:00
jani
4c1069c38b use memset and memcpy instead of bzero and bcopy throughout lwIP core code.Archs need to update.Bug #1899 2002-12-18 10:40:01 +00:00
likewise
f06e955072 Initial revision 2002-10-19 12:59:30 +00:00