Dirk Ziegelmeier
ed239c4e71
Apply patch #9139 : Invalid format string in dhcp.c
...
by Thomas Mueller
2016-10-10 09:57:07 +02:00
Dirk Ziegelmeier
695c81762c
Minor: Fix comment in etharp.c
2016-10-09 12:28:34 +02:00
Dirk Ziegelmeier
f6e27940bd
Make lwIP compile with clang -Wdocumentation -> several documentation fixes
2016-10-09 12:21:39 +02:00
Dirk Ziegelmeier
13fb616bb2
Cleanup hton*/ntoh* function handling and platform abstraction
...
Let lwip use functions/macros prefixed by lwip_ internally to avoid naming clashes with external #includes.
Remove over-complicated #define handling in def.h
Make functions easier to override in cc.h. The following is sufficient now (no more LWIP_PLATFORM_BYTESWAP):
#define lwip_htons(x) <your_htons>
#define lwip_htonl(x) <your_htonl>
2016-10-06 12:55:57 +02:00
Elias Reichart
60a507f88b
ETHARP_TABLE_MATCH_NETIF is also used in the etharp_output shortcut
2016-10-04 22:15:59 +02:00
Axel Lin
5e15125b3d
igmp: Fix optimized code by always skipping the first entry in the linked groups list
...
commit 8c52afb6ca
("igmp: Optimize code by always skipping the first entry in the linked groups list - it is always the "allsystems" entry")
accidently changes the code logic. it should check groupref rather than group.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-10-02 19:36:59 +02:00
Dirk Ziegelmeier
8f8f56914b
Fix bug #47731 : IGMP state transition missing
...
Set state variable according to RFC 2236 on timeout in delaying member state
2016-10-01 21:27:00 +02:00
Dirk Ziegelmeier
8c52afb6ca
igmp: Optimize code by always skipping the first entry in the linked groups list - it is always the "allsystems" entry
2016-10-01 17:28:36 +02:00
Dirk Ziegelmeier
149701b347
Fix bug #49218 : pbuf_clen() overflow as a result of tcp_write concatenation
...
Let pbuf_clen() return u16_t
2016-09-30 09:04:36 +02:00
Dirk Ziegelmeier
633696c153
Implement consistent IPx_ADDR_ANYx macro naming between IPv4 and IPv6
...
- rename IP4_ADDR_ANY to IP4_ADDR_ANY4
- IP4_ADDR_ANY (= IP_ADDR_ANY) is now IPv4 any address in ip_addr_t format
2016-09-28 12:56:57 +02:00
Dirk Ziegelmeier
c7c6b7ce93
Rework IGMP and MLD6 code to store group info per-netif.
...
Reasoning:
- Makes code in single-netif case perform better and smaller
- IGMP / MLD6 code is a little bit easier to read and understand
- Easier to get multicast groups per netif when implementing drivers
Downside: In multi-netif mode, there are two more pointers on each netif, even if IGMP/MLD6 is not used on it. But these systems should not be so memory-constrained that this will matter.
2016-09-21 13:33:33 +02:00
Dirk Ziegelmeier
623f9ce046
Remove one debug message from Daniel's patch
2016-09-19 12:32:43 +02:00
Daniel Elstner
4d4710dadf
Bug #49125 addendum: Remove group from list before callback
...
When leaving a multicast group, remove the group from the list
before invoking the MAC filter callback. This avoids the need
for the callee to skip over the group that is about to be deleted.
2016-09-19 12:26:51 +02:00
Dirk Ziegelmeier
ee4cd45c98
Fix bug #49125 : Need a way to iterate multicast groups for MAC filtering
...
-> let list heads be a public symbol
2016-09-19 08:45:57 +02:00
sg
34682facd1
Remove ip4_frag IP_FRAG_USES_STATIC_BUF code: nearly the same as the other code, but IP_FRAG_USES_STATIC_BUF doesn't work when queuing pbufs
2016-08-31 21:00:10 +02:00
Dirk Ziegelmeier
8d45162a59
Fix usage of uninitialized data in dhcp.c by checking pbuf_copy_partial() return value
2016-08-30 21:33:43 +02:00
Dirk Ziegelmeier
0d510dd66d
Add API macros for netif client data handling and update documentation accordingly
2016-08-26 11:21:49 +02:00
Dirk Ziegelmeier
c719c466b3
Remove SIZEOF_ETHARP_PACKET_TX #define, it is not needed any more after my last cleanups
2016-08-23 20:41:37 +02:00
Dirk Ziegelmeier
31778193da
Work on bug #48868 : Cleanup etharp.c not to use struct eth_hdr: Cleanup etharp_input() to use ethernet_output()
2016-08-23 17:23:21 +02:00
Dirk Ziegelmeier
6caa7b9927
Cleanup etharp_arp_input() signature to match the sig of other input functions (pbuf, netif). Rename to etharp_input()
2016-08-23 17:03:51 +02:00
Dirk Ziegelmeier
979bee386c
Work on bug #48868 : Cleanup etharp.c not to use struct eth_hdr: Cleanup etharp_raw() to use ethernet_output()
2016-08-23 16:58:17 +02:00
goldsimon
fd5b34ae43
ip4_forward(): fixed compiling IP_FORWARD_ALLOW_TX_ON_RX_NETIF==1
2016-08-23 15:26:05 +02:00
goldsimon
306171c93b
DHCP: fixed compiling LWIP_DHCP_BOOTP_FILE==1
2016-08-23 15:25:39 +02:00
goldsimon
d99d91dae9
removed ETHARP_TRUST_IP_MAC since it is insecure and we don't need it any more after implementing unicast ARP renewal towards arp entry timeout
2016-08-23 13:00:15 +02:00
Dirk Ziegelmeier
4456c7d230
Fix regression in etharp.c: Allocate correct pbuf layer
2016-08-23 12:32:57 +02:00
Dirk Ziegelmeier
bae4d6398c
Fix some comments to reference ethernet_output now
2016-08-23 10:23:59 +02:00
Dirk Ziegelmeier
18136c047b
Work on bug #48824 : ethernet.c extensions: Implement ethernet_output();
...
Fixes bug #48862 : ethip6 does not support setting vlan
2016-08-23 10:15:03 +02:00
goldsimon
6b1e1af3d1
combine MAC filter actions for IGMP and MLD6 (IGMP has compatibility defines for old code, MLD6 filter functions must be adapted)
2016-08-19 13:54:14 +02:00
Dirk Ziegelmeier
6688033bc4
Move IGMP protocol struct to prot/igmp.h
2016-08-19 12:50:41 +02:00
goldsimon
ed566cceaa
minor cleaup in (eth)arp
2016-08-19 12:49:02 +02:00
goldsimon
14fb48cd7a
minor: whitespace cleanups
2016-08-19 09:41:34 +02:00
Dirk Ziegelmeier
8eb9db18a2
Reduce usage of netif/ethernet.h header, mostly lwip/prot/ethernet.h is sufficient
2016-08-19 08:36:00 +02:00
Dirk Ziegelmeier
97fae7e41b
Code cleanup in autoip.c and dhcp.c
2016-08-18 12:49:59 +02:00
Dirk Ziegelmeier
7f60cb3889
Improve netif client data API for lwIP internal clients - these can use a compile-time constant to access their data now
2016-08-18 12:37:21 +02:00
Dirk Ziegelmeier
c9ad58308a
Minor documentation fixes
2016-08-18 10:59:18 +02:00
Dirk Ziegelmeier
fa6a2d48cc
Fix DHCP unit test after my last changes
2016-08-18 06:09:02 +02:00
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
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
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
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
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
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
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
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
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
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
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
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
14ca418ac0
minor: coding style fixes
2016-07-05 07:36: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
8dc77ef558
doxygen updates - include IPv6 in documentation. Exclude include/netif/ppp/polarssl.
...
Convert TODO -> @todo
2016-06-22 20:18:23 +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
Dirk Ziegelmeier
6be7e221a5
Fix a few doxygen warnings
2016-05-24 22:29:18 +02:00
Dirk Ziegelmeier
90a656ed78
Fix several doxygen errors all over the code
2016-05-23 21:18:16 +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
Dirk Ziegelmeier
49badf39a1
Fix bug #47805 : dhcp_recv can dereference NULL pointer
2016-04-29 11:16:33 +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
sg
0731eda0b3
make autoip_supplied_address() take a const pointer, too
2016-04-05 20:38:11 +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
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
sg
b00a17059a
fixed icmp_send_response with LWIP_HOOK_IP4_ROUTE_SRC enabled
2016-03-05 15:57:40 +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
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
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
70f3e5ed05
Cleanup: Create new file ip.c and move dual-stack code from ipv4 and ipv6 folder in there
2016-02-26 23:04:51 +01:00
Dirk Ziegelmeier
d5778bad2f
No need for dual-stack code in ip4.c and icmp.c -> use ip4 only versions
2016-02-26 22:50:20 +01:00
Dirk Ziegelmeier
1c1587eef6
ICMP: Fix responses were always sent to default netif because of uninitialized source IP (found by Coverity)
2016-02-10 20:35:58 +01:00
Dirk Ziegelmeier
11b810721a
ICMP: Fix unused value in icmp_input (found by Coverity)
2016-02-10 20:34:44 +01:00
Stephan Linz
2c31beb6e7
IPv4: fix some meaningless debug messages
...
Signed-off-by: Stephan Linz <linz@li-pro.net>
2016-01-18 21:34:13 +01:00
Stephan Linz
80375e68dd
ip_frag: fix compiler warnings, unused variable
...
In case of IP_REASS_FREE_OLDEST==0, the argument clen of
ip_reass_enqueue_new_datagram() will not used and leads
the compiler to a warning.
Signed-off-by: Stephan Linz <linz@li-pro.net>
2016-01-18 11:55:54 +01:00
Dirk Ziegelmeier
123c8dbd6a
Fix bug #46837 Don't send dhcp_release message in dhcp_release function
2016-01-13 08:54:54 +01:00
Joel Cunningham
a82c6122d5
Correct comment word usage in ip4_frag.c
...
This corrects word usage in ip4_frag.c:
* 'On' was used when it should have been 'one'
* 'Whole' was used when it should have 'hole'
2015-12-08 10:13:56 -06:00
Axel Lin
2e56f2d780
igmp: Optimize the implementation of igmp_start_timer
...
When LWIP_RAND is defined, calling LWIP_RAND() is not necessary if max_time <= 2
because group->timer will be set to 1 anyway.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2015-12-06 21:47:09 +01:00
Axel Lin
7f92660598
icmp: Fix memory leak in icmp_input() error paths
...
Ensure the newly allocated packet buffer is freed in error paths.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2015-12-05 21:25:15 +01:00
Axel Lin
764bf251cd
igmp: Drop unneeded initialization for *group in igmp_lookup_group()
...
It's assigned to the return value of igmp_lookfor_group() immediately.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2015-12-02 22:32:50 +01:00
sg
c12fa7b4c4
started to move "private" header files containing implementation details to "lwip/priv/" include directory to seperate the API from the implementation.
2015-10-09 21:58:58 +02:00
sg
b32751a693
moved dhcp.c to src/core/ipv4/ since it is IPv4 only
2015-10-09 21:06:08 +02:00
goldsimon
b401f42520
minor: fixed coding style (lwip style)
2015-10-07 10:03:12 +02:00
sg
2b971400fa
minor: coding style
2015-10-06 21:57:40 +02:00
sg
22df34fc70
minor/coding style: removed spaces before line ending (from file header)
2015-10-06 21:13:15 +02:00
sg
490581a0eb
minor/coding style: removed spaces before line ending
2015-10-06 21:08:28 +02:00
sg
fecd1bde83
ip4_route: fixed checking twice for a valid default_netif, fixed checking loopback traffic before checking for a valid default netif
2015-10-01 21:17:59 +02:00
goldsimon
389831218e
Finished task #13731 : fix usage of "snmp_inc_*"
2015-09-30 15:54:43 +02:00
goldsimon
7b5ef3ae58
implement/remove missing IP counters in stats_mib2 (see task #13731 )
2015-09-30 15:05:52 +02:00
goldsimon
3dd0977635
minor: fixed coding style in igmp.c
2015-09-30 14:37:37 +02:00
Erik Ekman
ba71ac78d9
Add functions to join/leave IGMP group by netif
...
Existing functions are based on IP address, but the address is used
only to look up which netif to act on. The netif-based core code is
extracted to new exported functions.
If you have a netif handle, this makes it easier to join/leave
groups, without the need to convert to IP address first only for the
IGMP code to convert back to netif.
2015-09-30 14:29:37 +02:00
goldsimon
927b72abd2
fixed bug #46072 : ip4addr_aton() does not check the number range of all address parts
2015-09-30 14:15:36 +02:00
goldsimon
f89e859415
minor: fixed coding style in ip4addr_aton()
2015-09-30 14:13:05 +02:00
goldsimon
dae73e21b8
minor: fixed coding style in ip4addr_aton()
2015-09-30 14:11:50 +02:00
sg
bb91bd2279
fixed coding style: use more ()
2015-09-24 21:04:20 +02:00
Sylvain Rochet
8b2c73de4e
ip4: routing: check peer for point to point interfaces
...
gw netif field for point to point interfaces is the peer IP address.
Check if the destination is equals to the gw field of point to point
interfaces (broadcast flag is not set) when routing an IP packet.
2015-09-24 21:01:52 +02:00
goldsimon
b0917d987a
Cleaned up using struct netif.ip_addr by creating API functions for it
2015-09-24 14:57:16 +02:00
goldsimon
262a641396
eliminate temporary storage when using netif addresses for ip_addr_t* now that they have the correct type (ATTENTION: ip6_select_source_address() and ip4_netif_get_local_ip() now return ip_addr_t*!)
2015-09-24 14:34:24 +02:00
goldsimon
ed4130bd2f
Fixed const errors after changing netif_ip4_addr/netif_ip6_addr to return cont pointers
2015-09-24 08:06:50 +02:00
goldsimon
e6b6543c33
igmp: use netif_ip4_addr() instead of directly accessing struct netif member
2015-09-23 16:26:56 +02:00
sg
0454950564
fixed compiling for various config combinations
2015-09-17 22:19:37 +02:00
Dirk Ziegelmeier
f62022cdf3
Compiler warning fixes (mostly constness in dual-stack configurations)
2015-09-17 13:59:52 +02:00
goldsimon
726af89168
minor compiler warning fixes and coding style
2015-09-17 11:00:21 +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
goldsimon
8a0fb03e21
Separate mib2 counter/table callbacks from snmp agent. This both cleans up the code and should allow integration of a 3rd party agent/mib2.
2015-09-08 09:47:30 +02: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
sg
a01a1b4556
support IPv4 source based routing: define LWIP_HOOK_IP4_ROUTE_SRC to point to a routing function
2015-08-30 21:54:39 +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
3b21f469ca
fix bug #45120 in a cleaner way
2015-08-20 13:05:59 +02:00
sg
05abfc8ded
Fixed icmp.c after 1.4.0-based patch #45120
2015-08-19 22:14:37 +02:00
sg
de8e810792
fixed bug #45120 : Broadcast & multiple interfaces handling
2015-08-19 20:55:03 +02:00
goldsimon
2a6f31a84e
fix that LWIP_MULTICAST_TX_OPTIONS must be used in ip4_route instead of LWIP_IGMP
2015-08-18 16:35:06 +02:00
sg
4edade8079
allow multicast socket options IP_MULTICAST_TTL, IP_MULTICAST_IF and IP_MULTICAST_LOOP to be used without IGMP
2015-08-05 22:52:23 +02:00
goldsimon
4dc3c7a6a0
Fixed warnings about NULL check not required (ip_addr_isany) and implicit conversion (~)
2015-08-03 08:35:01 +02:00
tabascoeye
7856141fc4
icmp: fix checksum on replies of echo request with ID 0, sequence 0 and either no data or any amount of 0x00 Bytes as data ( closes : #45322 )
...
When a client sends an ICMP echo request with ID 0, sequence 0 and
either no data or any amount of 0x00 bytes as data, the checksum in the
reply is wrong (off-by-one).
Expected checksum is 0xffff in that case, observed is 0x0000.
2015-06-15 15:53:14 +02:00
sg
e20a071977
added functions dhcp/autoip_supplied_address() to check for the source of address assignemnt (replacement for NETIF_FLAG_DHCP)
2015-04-24 21:23:15 +02:00
goldsimon
f01dc8cc34
more "const" fixes
2015-04-23 09:59:15 +02:00
goldsimon
b16316ae37
fixed more (tiny) warnings...
2015-04-22 14:56:58 +02:00
goldsimon
f468c492b9
fixed missing casts found with msvc /Wall
2015-04-22 13:38:10 +02:00
goldsimon
5410838793
igmp.c: fixed -Waddress, removed dead code
2015-04-22 12:50:26 +02:00
goldsimon
beabd3c6b7
Added some macros with extension "_val" that work on actual instances and leave away the "if != NULL" check to get rid of gcc "-Waddress" warnings in the core code at least (I might not have caught all of them, yet)
2015-04-22 12:43:03 +02:00
goldsimon
a81c7bf04b
fixed compiling icmp.c (variable has to be declared at the beginning of a scope)
2015-04-22 11:29:35 +02:00
goldsimon
902d190a11
Many const fixes throughout the stack (although these are not all, yet)
2015-04-22 10:29:43 +02:00
Sylvain Rochet
632de523de
Fixed PBUF_LINK_ENCAPSULATION_HLEN support
...
PBUF_LINK_ENCAPSULATION_HLEN support was introduced by 6ef7563f
and
missed the fact that header size calculation/reservation using
computation like PBUF_LINK_HLEN + PBUF_IP_HLEN + ... are used all over
the source code. Hopefully fixed all of them.
2015-04-20 23:43:33 +02:00
goldsimon
d31dbc6798
Fixed constant initializer problem in ip_addr_t by having ip6 first
2015-04-10 07:41:40 +02:00
Sylvain Rochet
135631d29d
fixed some obvious compiler warnings
...
lwip/src/include/lwip/autoip.h:52:1: error: C++ style comments are not allowed in ISO C90 [-Werror]
//#include "lwip/udp.h"
lwip/src/core/ipv4/autoip.c:70:1: error: C++ style comments are not allowed in ISO C90 [-Werror]
//#include "lwip/udp.h"
lwip/src/include/lwip/api.h:239:25: error: declaration of ‘lev’ shadows a previous local [-Werror=shadow]
SYS_ARCH_DECL_PROTECT(lev); \
2015-04-09 23:27:36 +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
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
905f1609b3
fixed the IPv4 part of bug #43904 (ip_route() must detect linkup status)
2015-03-09 21:35:57 +01:00
sg
4e520cdd30
fixed bug #37068 (netif up/down handling is unclear): correclty separated administrative status of a netif (up/down) from 'valid address' status ATTENTION: netif_set_up() now always has to be called, even when dhcp/autoip is used!
2015-03-05 20:57:43 +01:00
sg
5984c996a8
fixed bug #40177 (System hangs when dealing with corrupted packets), implemented task #12357 (Ensure that malicious packets don't assert-fail): improved some pbuf_header calls to not assert-fail.
2015-02-25 22:58:27 +01:00
Greg Renda
4eb9efdd33
fixed bug #38210 (ip reassembly while remove oldest datagram)
2015-02-25 21:43:39 +01:00
sg
612e33c499
fixed bug #38061 (wrong multicast routing in IPv4) by adding an optional default netif for multicast routing
2015-02-25 20:58:11 +01:00
sg
c87efb77bc
patch by Jens Nielsen: fixed bug #38803 (Source address in broadcast ping reply)
2015-02-22 22:02:17 +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
chrysn
9f065c0ea5
(api break) qualify ip_addr_t as const where feasible
...
this changes the callback signatures of the ip_output and the
{udp,raw}_recv functions.
changes were made by going through all header files, searching for
occurrences of ip_addr_t, qualifying them as const and if required
modifying the corresponding c files, looking for other uses of ip_addr_t
that would be required.
the following header files were not treated as i'm not using them and
wouldn't see them compiled: api.h api_msg.h dhcp.h dns.h igmp.h
netifapi.h pppapi.h snmp.h snmp_msg.h snmp_structs.h ppp.h pppol2tp.h
test/*
no modifications were done on ip6_addr_t.
2015-02-22 21:46:02 +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
sg
974a853f40
patch #8423 "arch/perf.h" should be made an optional item
2015-02-11 21:25:47 +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
sg
f38352f1af
fixed bug #43596 IGMP queries from 0.0.0.0 are discarded
2014-12-09 20:56:39 +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
goldsimon
ec93b03d8d
Fixed multiple smaller compiler warnings
2014-11-07 14:29:53 +01:00
Simon Goldschmidt
33237419c1
Parts of patch #8397 Typos corrected in comments and text outputs
2014-09-18 21:15:13 +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
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
goldsimon
e4ddd6cb6d
Multiple fixes found by coverity scan
2014-04-30 12:22:31 +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
Simon Goldschmidt
f36d6b7ef5
fixed bug #39514 ip_route() may return an IPv6-only interface
2014-02-25 22:37:52 +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
0f24fba28a
IGMP: fixed !define LWIP_RAND case
2014-02-20 22:07:58 +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
Simon Goldschmidt
381a7b110a
fixed bug #41041 Potential use-after-free in IPv6 reassembly
2014-01-10 21:47:42 +01:00
Simon Goldschmidt
252126cf76
fixed possible division by zero
2013-04-24 22:20:12 +02:00
Simon Goldschmidt
ff3bf6d7f5
fixed bug #37665 ip_canforward operates on address in wrong byte order
2013-01-15 21:10:32 +01:00
goldsimon
c622985fda
Better fix for bug #35927 (missing refragmentaion in ip_forward) when IP_FRAG is disabled.
2012-03-25 15:12:42 +02:00
goldsimon
d95bcab053
fixed bug #35927 : missing refragmentaion in ip_forward
2012-03-22 19:35:04 +01:00
goldsimon
fe08467e45
Removed unused variable in ip_debug_print()
2012-02-14 21:29:14 +01:00
goldsimon
69d61eda01
Added option CHECKSUM_GEN_ICMP
2012-01-16 09:40:15 +01:00
goldsimon
d1fa13ed52
fix compilation of ip_canforward on 8-/16-bit platforms (where constants are 16-bit and thus cannot be left-shifted by 24)
2011-11-23 09:09:22 +01:00
Simon Goldschmidt
9d31401d47
fixed bug #34447 LWIP_IP_ACCEPT_UDP_PORT(dst_port) wrong
2011-10-09 14:30:49 +02:00
Simon Goldschmidt
5e8ee7e006
Make LWIP_RAND optional (useful for small targets)
2011-09-03 22:27:30 +02:00
Simon Goldschmidt
41c785d77a
IPv4: splitted IPv4 header fields version/len and tos, made macros depend on BYTE_ORDER to prevent unnecessary calls to htons()
2011-07-26 20:55:32 +02:00
Simon Goldschmidt
78ac382fdf
bug #33634 ip_forward() have a faulty behaviour: Added pbuf flags to mark incoming packets as link-layer broadcast/multicast. Also added code to allow ip_forward() to forward non-broadcast packets to the input netif (set IP_FORWARD_ALLOW_TX_ON_RX_NETIF==1).
2011-07-21 21:47:25 +02:00
goldsimon
2bd498524d
Fixed bug #33653 (ip_data.current_ip_header_tot_len calculation errors!) introduced while mergin IPv4 and IPv6
2011-06-29 19:46:21 +00:00
goldsimon
91532b2d5c
Removed unused static function
2011-06-07 19:19:24 +00:00
goldsimon
5b04860b8b
Moved common call to pbuf_header outside the switch()
2011-06-07 19:10:10 +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
9546e65617
Removed autoip_init() since it does nothing; minor coding style changes
2011-05-21 16:01:19 +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
856ccb5bb7
Added missing U/UL modifiers to fix 16-bit-arch portability.
2011-02-18 13:31:28 +00:00
goldsimon
fee0c6afe9
Fixed constant not being 32 bit.
2011-02-17 17:03:12 +00:00
goldsimon
b49cf5e7a2
patch #7328 : Autoip: ETHADDR16_COPY can be used
2010-11-22 17:35:57 +00:00
goldsimon
3c5723e49d
Fixed invalid fix for bug #30402 (CHECKSUM_GEN_IP_INLINE does not add IP options)
2010-07-21 12:11:22 +00:00
goldsimon
a99219ad1f
added missing casts
2010-07-12 09:34:17 +00:00
goldsimon
691410ba18
task #10495 : Added support for IP_MULTICAST_LOOP at socket- and raw-API level.
2010-07-12 09:34:11 +00:00
goldsimon
714a43b18c
Fixed bug #30402 : CHECKSUM_GEN_IP_INLINE does not add IP options
2010-07-10 12:02:28 +00:00
goldsimon
60a456f757
Added ip_addr_netmask_valid() to check if a netmask is valid (starting with ones, then only zeros)
2010-07-05 14:20:58 +00:00
kieranm
e2f014f457
cleanup: fix minor build failures on unix
2010-06-28 13:24:14 +00:00
goldsimon
f61b80ca6a
Fixed bug #29361 (ip_frag has problems with zero-copy DMA MACs) by adding custom pbufs and implementing custom pbufs that reference other (original) pbufs. Additionally set IP_FRAG_USES_STATIC_BUF=0 as default to be on the safe side.
2010-06-21 18:50:16 +00:00
goldsimon
1aba9f031d
nicer code for the last fix
2010-06-17 11:53:16 +00:00
goldsimon
2ffcc52f03
Fixed bug #30159 : WomnIP_ACCEPT_LINK_LAYER_ADDRESSING
2010-06-16 19:53:07 +00:00
goldsimon
72518a0d6e
fixed typos that MSVS did not complain about
2010-06-16 12:53:46 +00:00
goldsimon
1242575f0f
Added an optional define (LWIP_IP_ACCEPT_UDP_PORT) that can allow link-layer-addressed UDP traffic to be received while a netif is down (just like DHCP during configuration)
2010-06-16 12:25:00 +00:00
goldsimon
5ab40f016d
Fixed bug #30039 : AutoIP does not reuse previous addresses
2010-06-14 20:27:14 +00:00
goldsimon
435115d4fb
Use ip_addr_set_zero instead of memset(0)
2010-06-14 20:17:08 +00:00
goldsimon
f7479781c1
bug #27352 : removed packing from ip_addr_t, the packed version is now only used in protocol headers. Added global storage for current src/dest IP address while in input functions.
2010-05-22 21:11:02 +00:00
goldsimon
dae247809b
Add preprocessor-macros for compile-time htonl calculation (and use them throughout the stack where applicable)
2010-05-16 15:57:42 +00:00
goldsimon
778c65d27c
CHECKSUM_GEN_IP_INLINE: Use defines to access the u32_t part of an IP address
2010-05-12 08:11:45 +00:00
goldsimon
f9f77876a1
.. and deleted NAT again as Christian obviously didn't have the copyright on the code he sent us... THANKS!!!
2010-05-05 19:49:40 +00:00
goldsimon
67d8c7999a
Free NAT entries on remove (fixes a memory leak)
2010-05-05 19:39:29 +00:00
goldsimon
a7fdb67e8f
task #7506 : added NAT support
2010-05-05 19:34:23 +00:00
goldsimon
abc36471d9
Fixed bug #29763 (CHECKSUM_GEN_IP_INLINE), added macro LWIP_MAKE_U16() that's improved for endianess
2010-05-04 18:59:52 +00:00