Commit Graph

2113 Commits

Author SHA1 Message Date
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
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
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
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
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
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
sg
23cf45d252 d'oh! (fixed messed-up timeouts.h) 2016-07-27 21:48:29 +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
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
31f941e172 More documentation updates 2016-07-27 20:34:23 +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
eb3261d6e0 Add some more TCP RAW API functions to documentation 2016-07-27 13:46:54 +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
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
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
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
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
sg
00598b0b46 fix mem stats for MEM_USE_POOLS==1 2016-07-25 22:08:32 +02:00
Dirk Ziegelmeier
80be1a6bf8 Add links to new documentation pages in the relevant files 2016-07-25 08:20:39 +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
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
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
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
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
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
959042aa88 memp: fixed compiling various combinations of memp stats (display etc.) 2016-07-08 08:21:57 +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
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
14ca418ac0 minor: coding style fixes 2016-07-05 07:36:51 +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
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
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
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
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
goldsimon
236bc19422 fixed bug #48170 (patch by Fabian Koch) 2016-06-27 10:31:36 +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
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
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
Dirk Ziegelmeier
5e7b343d52 Fix dns_getserver to return a pointer, not a value 2016-06-13 09:00:46 +02:00
Dirk Ziegelmeier
6be7e221a5 Fix a few doxygen warnings 2016-05-24 22:29:18 +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
90a656ed78 Fix several doxygen errors all over the code 2016-05-23 21:18:16 +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
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
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
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
goldsimon
c981b726f8 fixed bug #47601 (wrong NS request at DAD) 2016-04-27 10:19:13 +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
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
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
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
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
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
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
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
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
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
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
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
sg
5f8b5cbb20 reset rto timer on fast retransmission (see task #13757, patch by Joel Cunningham) 2016-03-16 21:49:37 +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
f3b7bca3cf Fix bug #47370: Port DNS client to IPv6 2016-03-09 19:25:06 +01:00
Dirk Ziegelmeier
a212210c35 Add missing #include in memp.c 2016-03-08 19:53:01 +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
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
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
e0ab8c581d fixed bug #46093: Move IP6_ROUTE() hook to after LL processing 2016-03-05 14:11:24 +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
9a4c66006e Fix compile error in raw.c (possible unused arg) 2016-03-03 22:55:42 +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
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
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
f3132c5290 udp: Fix possible NULL pointer dereference, update comments 2016-03-02 23:10:43 +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
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
a5214abd04 udp: udp_send and udp_send_chksum: Check for PCB NULL pointer and PCB must not be the new IP_ANY_TYPE, but a real IPv4 and IPv6 address 2016-02-26 09:20:50 +01:00
goldsimon
bf8bcfafe2 revert accidentally committed comment from a649a3eb50 2016-02-26 08:59:50 +01:00
Joel Cunningham
8cb64698aa Allow backlog to be updated
This commit adds support to the sockets and netconn layer to update the
backlog by calling listen when the netconn is already in the listen state.
When backlog is not enabled, the call returns successfully

This commit also introduces a macro for setting the backlog value that
prevents a 0 sized (invalid) backlog
2016-02-25 15:19:52 -06:00
sg
a649a3eb50 dual-stack fix: moved common definitions/code for ethernet used by etharp and ethip6 to new files ethernet.h/.c 2016-02-25 22:10:28 +01:00
Dirk Ziegelmeier
fd891081c4 minor: Cleanups in raw/tcp/udp code by using macros and reducing #ifdefs 2016-02-24 23:04:25 +01:00
Dirk Ziegelmeier
953b7bdd59 Implement UDP dual-stack PCB support
Create special IP address type "IPADDR_TYPE_ANY" for it.
SNMP uses new feature in non-netconn mode.

TODO: Same for TCP & RAW, adapt NETCONN to use this feature
2016-02-24 22:37:01 +01:00
sg
1dde3d6e56 Fixed bug #46524: "Device as dhcp server does not work after upgrade to lwip-1.4.1" 2016-02-24 22:13:58 +01:00
sg
ec49b68b38 minor: udp_input/local_match: coding style, added comments 2016-02-24 22:04:59 +01:00
Dirk Ziegelmeier
ac4b089b18 udp.c: Further udp_input simplifications
- Move local PCB matching code in a function that can be reused in SO_REUSE && SO_REUSE_RXTOALL case.
- Some checks have been written in the dual-stack version and then repeated with the ipv6-only version. Example:
IPv6 only: ip6_addr_ismulticast(ip6_current_dest_addr())
IPv4 AND IPv6: ip_addr_ismulticast(ip_current_dest_addr())
2016-02-24 19:57:20 +01:00
Dirk Ziegelmeier
005c196ed8 udp.c: Simplify and cleanup input PCB matching 2016-02-24 19:13:30 +01:00
Dirk Ziegelmeier
17fad79f71 Two compile fixes after eliminating isipv6 member in PCBs 2016-02-22 17:07:17 +01:00
Dirk Ziegelmeier
c805843e64 Change signature of ip_output, ip_output_if, ip_output_if_src, ip_output_hinted, ip_route, ip_netif_get_local_ip, ip_route_get_local_ip and tcp_eff_send_mss not to take an isipv6 parameter. Use the IP version of the destination address instead. 2016-02-22 13:38:40 +01:00
Dirk Ziegelmeier
880f1008d6 Together with Simon: Eliminate last instances of isipv6 member in pcbs;
Don't allow NULL pointers (IPv4 ANY) in connect() and sendto() functions as destinations since this does not make sense.
2016-02-22 13:03:51 +01:00
Dirk Ziegelmeier
be9cd800b0 Review with Simon: Init TCP/UDP/RAW PCBs with correct IP types in _new functions to make my changes work correct 2016-02-22 11:16:13 +01:00
Dirk Ziegelmeier
0106cf7ae0 Review with Simon: Remove dead code (since 2003) 2016-02-22 10:18:19 +01:00
Dirk Ziegelmeier
50303eea23 Reduce PCB_ISIPV6 macro usage some more 2016-02-21 19:59:08 +01:00
Dirk Ziegelmeier
339e82d7aa Eliminate IP_PCB_IPVER_EQ macro 2016-02-21 19:45:51 +01:00
Dirk Ziegelmeier
5a25652c21 Eliminate IP_PCB_IPVER_INPUT_MATCH macro 2016-02-21 19:21:36 +01:00
Dirk Ziegelmeier
8f675c37fc Reduce usage of PCB IP version flag in UDP code. Maybe we can figure out a good way for dual-stack UDP when we manage to remove the flag (nearly) entirely from the code. 2016-02-20 20:54:58 +01:00
Dirk Ziegelmeier
5809b01388 Reduce usage of PCB IP version flag in raw and tcp code. Maybe we can figure out a good way for dual-stack UDP when we manage to remove the flag (nearly) entirely from the code. 2016-02-20 20:40:04 +01:00
Dirk Ziegelmeier
10edba936b Fix tcp pcb access after it was freed in tcp.c - found by Coverity 2016-02-19 23:28:09 +01:00
goldsimon
e4cac595c2 Check TCP_SNDLOWAT for too high value (near u16_t overflow) - fixes bug #46948 2016-02-18 09:36:55 +01:00
Dirk Ziegelmeier
24bc77a935 Found some struct instances that can be const 2016-02-16 22:31:59 +01:00
Dirk Ziegelmeier
273d609bac mem.c: Fix unintended sign extension (found by Coverity)
sign_extension: Suspicious implicit sign extension: count with type unsigned short (16 bits, unsigned) is promoted in count * size to type int (32 bits, signed), then sign-extended to type unsigned long (64 bits, unsigned). If count * size is greater than 0x7FFFFFFF, the upper bits of the result will all be 1.
2016-02-10 21:21:08 +01:00
Dirk Ziegelmeier
288b4564e4 DNS: Fix potential array out of bounds access. Variable nanswers may contain bogus values. (found by Coverity) 2016-02-10 20:41:31 +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
Dirk Ziegelmeier
222155d7e2 pbuf: Make pbuf_skip function public, so it can be used in SNMP code 2016-02-03 08:37:04 +01:00
Axel Lin
f411a34af5 stats: Add proper #if guard to prevent unused-variable warning for memp_names
The usages of memp_names are under either LWIP_DEBUG in stats_init,
or under LWIP_STATS_DISPLAY in stats_display_memp.

Fix below build warning:
lwip/src/core/stats.c:53:21: error: 'memp_names' defined but not used [-Werror=unused-variable]
static const char * memp_names[] = {
^
cc1: all warnings being treated as errors

Reported-by: David Fernandez
Fixes: 2f2a75a6d9fd ("stats: Move memp_names table out of stats_init/stats_display_memp functions")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-01-31 13:48:38 +01:00
Axel Lin
515a4cad73 Clear addr_hint pointer after calling ip_output_if() in tcp_zero_window_probe()
This was missed in commit aa0e41c389
("task #12178: hardware checksum capabilities can be configured per netif"),
fix it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-01-29 09:21:58 +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
Axel Lin
fe2cfe2dba raw: Fix build error
IP6_HLEN is only defined when LWIP_IPV6, IP_HLEN is only defined when LWIP_IPV4.
This fixes build error in !LWIP_IPV4 || !LWIP_IPV6 cases.

Fixes: f2c7e9c939 ("raw: Remove unnecessary #if guard around PCB_ISIPV6() calls")
Reported-by: Erik Ekman
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-01-18 16:02:01 +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
Axel Lin
f2c7e9c939 raw: Remove unnecessary #if guard around PCB_ISIPV6() calls
PCB_ISIPV6() macro is well defined for all cases (LWIP_IPV4 && LWIP_IPV6,
LWIP_IPV4 only and LWIP_IPV6 only), thus remove the unnecessary #if guard
around PCB_ISIPV6() calls.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-01-18 11:55:06 +01:00
Axel Lin
c221361874 stats: Move memp_names table out of stats_init/stats_display_memp functions
This makes the code simpler with better readability.
Also make memp_names static because it's only referenced by stats.c.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-01-15 11:38:03 +01:00
Axel Lin
70ebeda7ed memp: Simplify implementation of memp_overflow_check_all
We don't really care the order of overflow/underflow checking because if
any checking fails we got assertion.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-01-15 11:38:02 +01:00
Dirk Ziegelmeier
70487a43d4 Apply patch #8854: dns: Simplify #ifdef guard around dns_gethostbyname_addrtype from Axel Lin
+ Minor compile fix from me
Patch makes the code a tiny bit less lightweight (add a parameter in dns_gethostbyname which is then not used in dns_gethostbyname_addrtype) but it makes the code more readable.
2016-01-13 19:52:08 +01:00
Axel Lin
a93ae2558f tcp_rexmit_rto: Remove superfluous #if TCP_OVERSIZE guard
TCP_OVERSIZE_DBGCHECK already implies TCP_OVERSIZE is set.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-01-13 19:07:08 +01:00
Axel Lin
c2a74b767b udp_bind: Omit checking for the same port if no port specified
No port specified means to use a random port.
udp_new_port() returns a new (free) local UDP port number on success.
So in this case we don't need iterating all lists to test if the port
number is used, udp_new_port() alreay ensures the port is not used.

Move the code checking for double bind and rebind of the same pcb earlier,
as this checking is necessary in all cases.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-01-13 09:05:36 +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
Axel Lin
9f3aab6a62 tcp_out: Use LWIP_DBG_LEVEL_SERIOUS instead of hard coded number
Trivial clean up to avoid using hard coded number.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-01-11 13:22:51 +01:00
Axel Lin
156ad0dbf5 udp_bind: Fix the logic to check both pcbs have REUSEADDR set
The code for #if SO_REUSE case does not match the comment.
By default, we don't allow to bind to a port that any other udp
PCB is already bound to, unless *all* PCBs with that port have tha
REUSEADDR flag set.

Which means we want to omit checking for the same port if both pcbs
have REUSEADDR set. Fix the logic accordingly.

Fixes: d0348e0c60 ("task #6995: Implement SO_REUSEADDR (correctly)")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-01-11 12:19:13 +01:00
Axel Lin
5056d375f2 tcp_bind/tcp_connect: Omit checking for the same port if no port specified
No port specified means to use a random port.
tcp_new_port() returns a new (free) local TCP port number on success.
So in this case we don't need iterating all lists to test if the port
number is used, tcp_new_port() alreay ensures the port is not used.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-01-11 12:16:27 +01:00
Axel Lin
708beb4874 udp_bind: Allocate a random port earlier to correctly detect port conflict
Current code does not correctly detect port conflict if no port specified
because it checks ipcb->local_port == port before udp_new_port().
Fix it by allocating a random port earlier.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-01-09 10:14:09 +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
2562d637cd tcp_out: Use LWIP_DBG_LEVEL_SERIOUS instead of magic number
Trivial clean up to avoid using magic number.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2015-12-06 21:38:12 +01:00
Axel Lin
a21144b834 memp: Fixup LWIP_HOOK_MEMP_AVAILABLE() hook
I got below build warning if LWIP_HOOK_MEMP_AVAILABLE is defined.

src/core/memp.c: In function 'memp_free_pool':
src/core/memp.c:352:16: warning: variable 'old_first' set but not used [-Wunused-but-set-variable]
   struct memp *old_first;
                ^
src/core/memp.c: In function 'memp_free':
src/core/memp.c:413:6: warning: 'old_first' may be used uninitialized in this function [-Wmaybe-uninitialized]
   if (old_first == NULL) {

The LWIP_HOOK_MEMP_AVAILABLE() hook does not work, fix it.

Fixes: c838e1ed5b ("Implement possibility to declare private memory pools")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2015-12-05 21:32:14 +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
a709041b8b Remove unnecessary p->len checking for pbuf_alloc calls with PBUF_RAM type
pbuf_alloc() for PBUF_RAM type always return big enough memory on success.
So checking p->len is not necessary. Testing if p is NULL or not is enough.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2015-12-05 21:21:59 +01:00
Axel Lin
bd4c4b5959 Use SYS_ARCH_SET macro at appropriate places
Use SYS_ARCH_SET to simplify the code a bit.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2015-12-02 22:51:08 +01:00
Axel Lin
fb6d0f9006 ipaddr_aton: Avoid duplicate code to handle IPv4 address string conversion
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2015-12-02 22:51:00 +01:00
Axel Lin
6e863ecb50 dns: Remove always true test in dns_alloc_random_port
The only way to exit the do-while loop is err != ERR_USE.
Thus get rid of the always true test.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2015-12-02 22:37:26 +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
Axel Lin
91586bc6f6 Drop #if TCP_DEBUG guard around tcp_debug_print_state calls
The #if TCP_DEBUG guard can be removed because tcp_debug_print_state()
print nothing if !TCP_DEBUG.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2015-12-02 22:32:42 +01:00
Axel Lin
f971fb921e Simplify testing minimum priority in tcp_kill_prio()
Simplify the code a bit by setting mprio = LWIP_MIN(TCP_PRIO_MAX, prio)
before the for loop.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2015-11-20 21:41:14 +01:00
Axel Lin
c730e45f0c Trivial comment fix about calling tcp_slowtmr
Trivial typo fix.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2015-11-20 21:36:38 +01:00
Axel Lin
5c27429958 memp: Fix if MEMP_OVERFLOW_CHECK guard in memp_free_pool
Current code already checks memp_overflow_check_all() in memp_free() if
MEMP_OVERFLOW_CHECK >= 2. So in memp_free_pool(), it should use
MEMP_OVERFLOW_CHECK == 1 instead.

Fixes: c838e1ed5b ("Implement possibility to declare private memory pools")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2015-11-19 22:06:42 +01:00
Axel Lin
9c6708513a Drop unnecessary NULL test for h->next->next in memp_sanity
The h will point to NULL if h->next->next is NULL anyway.
So remove the unnecessary NULL test for h->next->next in each iteration.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2015-11-19 07:23:55 +01:00
Axel Lin
21b9b5e741 Slightly improve raw_remove()/udp_remove() implementation
There should be no duplicate pcb in raw_pcbs/udp_pcbs list.
So the implementation of raw_remove()/udp_remove() can break from the for
loop once the target pcb is found and removed from the list.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2015-11-19 07:21:00 +01:00
goldsimon
98b9d31f24 Fixed compiling with LWIP_TCP==0 2015-11-16 09:37:56 +01:00
Axel Lin
668d461104 dns: Fix dns_alloc_pcb for reuse an existing one case
The logic to use an already existing pcb is wrong because the idx never
advanced in the for loop, so it keep checking the same dns_pcbs[idx] for
each loop iteration. Fix it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2015-11-16 09:09:31 +01:00
Dirk Ziegelmeier
6203737093 Rename snmp_mib2.h to snmp.h so source compatibility for user netif implementations is preserved 2015-11-12 21:25:42 +01:00
Dirk Ziegelmeier
5f642eb3e3 Completely decouple SNMP stack from lwIP core by using private memory pools;
Move SNMP stack to apps;
API breaking change: Users need to call snmp_init() now!
2015-11-12 21:21:14 +01:00
goldsimon
92a241a29e Fixed bug #46365: tcp_accept_null() should call tcp_abort() 2015-11-12 10:40:49 +01:00
Dirk Ziegelmeier
c838e1ed5b Implement possibility to declare private memory pools. This is useful to decouple some apps from the core (SNMP stack) or make contrib app useage simpler (httpserver_raw) . 2015-11-12 08:45:04 +01:00
Dirk Ziegelmeier
d38db89626 Export tcp_pcb_lists from tcp.c - can be used in SNMP code to implement MIB2 tcp connection tables 2015-11-12 08:09:44 +01:00
Dirk Ziegelmeier
3f0b1e2cdc Remove global variable used in macros, it can be declared locally. 2015-11-12 08:07:22 +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
65efeec4e9 fixed bug #46145 tcp_send_empty_ack() uses wrong netif with LWIP_HOOK_IP4_ROUTE_SRC (patch by Milan Cermak) 2015-10-07 14:56:25 +02:00
goldsimon
15bb334e81 SNMP: use PBUF_RAM for sending, PBUF_POOL is mostly used for RX only (if this isn't followed, tcp can get stuck when ACKs don't come through - unless some PBUF_POOL pbufs are reserved for such RX) 2015-10-07 10:41:03 +02:00
goldsimon
77f906376e minor: fixed coding style (lwip style) 2015-10-07 10:36:50 +02:00
goldsimon
9b22f167f1 minor: mib2: removed some blocks by defining common variables above the switch 2015-10-07 10:13:20 +02:00
goldsimon
b401f42520 minor: fixed coding style (lwip style) 2015-10-07 10:03:12 +02:00
goldsimon
2949449e25 minor: SNMP: fixed coding style (lwip style) 2015-10-07 10:01:23 +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
goldsimon
0737cfb84e Fixed bug #46128 (patch by Kerem Hadimli) 2015-10-06 12:42:25 +02:00
Erik Ekman
f80d0dab08 Remove old comments about DHCP setting netif up 2015-10-03 21:31:48 +02:00
sg
fb1ac8d766 snmp mib2: more const 2015-10-03 20:34:56 +02:00
Dirk Ziegelmeier
bc47bd28ab snmp mib2: more nodes can be const 2015-10-03 20:34:09 +02:00
Dirk Ziegelmeier
5cf4771397 snmp: eliminiate mib_ram_array_node (it is not necessary: to the agent, the nodes may be const since the actual mib implementation knows the structures behind the nodes which do not have to be const) 2015-10-03 20:27:49 +02:00
sg
8891b277c6 snmp: hopefully fixed all alignment warnings introduced today. unfortunately, gcc does not warn about them when compiling for x86 2015-10-02 21:59:40 +02:00
goldsimon
e4abd4234d removed comma before } 2015-10-02 13:26:11 +02:00
goldsimon
fe33fd6d86 snmp: cleaned up mib_* structs: "base" class 'struct mib_node' only needs the type, get/set functions are not used on array/external nodes (only on scalar/listroot nodes) 2015-10-02 12:33:45 +02:00
goldsimon
bf75ace695 snmp: combine oid and node pointers in array entries 2015-10-02 10:53:17 +02:00
goldsimon
180ed573a5 snmp_trap_dst_ip_set: ip_addr_t pointer can be const 2015-10-02 09:58:31 +02:00
goldsimon
a9b6b5b704 adapt init.c to moved declaration of snmp_init 2015-10-02 09:57:15 +02:00
goldsimon
30445712a5 snmp: make mib_scalar_node a "derived" struct like all other nodes 2015-10-02 09:56:00 +02:00
sg
3312983b27 Make LWIP_DNS_SECURE and its possible values known in opt.h, remove default initialization of DNS server 2015-10-01 21:38:39 +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
0176e03e36 mib2: one more '};' -> '}' 2015-10-01 10:21:52 +02:00
Dirk Ziegelmeier
9957cd4a2a fixed bug #46089: snmp: race condition on length change between get_object_def() and get_value() 2015-10-01 10:08:23 +02:00
Dirk Zigelmeier
3f4d75c8d6 netif_get_ip6_addr_match/netif_add_ip6_address must take a const ip6addr to be usable 2015-09-30 20:55:08 +02:00
Dirk Ziegelmeier
7962b21c00 snmp: fixed ugly inheritance implementation by aggregating the "base class" (struct mib_node) in all derived node classes to get more type-safe code 2015-09-30 17:54:25 +02:00
goldsimon
59002d5081 mib2: only export 'internet', all other variables can be static 2015-09-30 17:42:19 +02:00
goldsimon
ce883d2041 minor: mib2.c: sys_tem_* -> system_* for everything but 'sys_tem' (without suffix) 2015-09-30 17:39:32 +02:00
goldsimon
96847c1199 snmp: added helper functions to encode/decode BITS pseudo type, added define for Counter64 type, minor layout changes 2015-09-30 17:24:53 +02:00
goldsimon
df1f12778f snmp: moved noleafs_get/set functions from mib2.c to mib_structs.c, where they belong 2015-09-30 17:19:08 +02:00
goldsimon
dff234112b minor: removed superfluous comma after '}' in mib2.c; removed superfluous comment on get-functions that follow a function typedef 2015-09-30 17:13:05 +02:00
goldsimon
e18e08ff08 minor: removed superfluous comma after '}' in msg_out.c 2015-09-30 17:09:04 +02:00
goldsimon
f3ed562983 minor: removed superfluous comma after '}' in dns.c 2015-09-30 17:01:57 +02:00
goldsimon
969fb4c981 minor: removed some trailing spaces in tcp.c 2015-09-30 17:00:57 +02:00
Erik Ekman
82fcc307ef mld6: Simplify join/leavegroup()
Use netif_get_ip6_addr_match() helper to shorten the code.
2015-09-30 16:35:15 +02:00
goldsimon
1fdab5ac0e Added/changed header of dhcp.c/.h 2015-09-30 16:33:48 +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
9d28549f32 minor: fixed coding style in mld6.c 2015-09-30 14:48:25 +02:00
Erik Ekman
6cdea62638 Add functions to join/leave v6 multicast 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
mld6 code to convert back to netif.
2015-09-30 14:44:45 +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
373714c02f dns: improved handling 2nd server if first failed 2015-09-30 14:22:39 +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
goldsimon
f950bf4362 ipaddr_aton(): favour ':' over '.' to decide for IPv6 first (since IPv6 mapped IPv4 addresses might contain both ':' and '.') 2015-09-30 14:06:44 +02:00
goldsimon
0621e8d1b1 ip6addr_aton(): fail on three successive colons in an IPv6 address string 2015-09-30 14:05:13 +02:00
goldsimon
5a185a0fbd minor: fixed coding style in ip6addr_aton() 2015-09-30 13:55:09 +02:00
goldsimon
45fd622491 Fixed bug #46071 Logic error in line 1473 in dns.c 2015-09-30 13:36:13 +02:00
goldsimon
94625a8fa8 MIB2_STATS: moved netif related mib2 counters into a struct (defined in stats.h), added ifInErrors/ifInUnkownProtos (now handled in etharp.c) and ifOutErrors 2015-09-28 08:50:21 +02:00
goldsimon
bc30899168 fixed compiler warnings where passing variable instance to ip_addr_isany 2015-09-28 07:56:52 +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
99d2e5233d struct udp_pcb.multicast_ip must be an ip_addr_t, too, to completely avoid temporary storage 2015-09-24 14:55:55 +02:00
goldsimon
c71723101a Removed ip_2_ip4/6_c const macros again now that ip_2_ip4/6 macros keep the original const'ness 2015-09-24 14:38:52 +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
4d2f4ce78c udp: don't use ip4_2_ip() where not required 2015-09-24 10:39:13 +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
0fbdd5e56e fixed compiling LWIP_HAVE_LOOPIF after changing struct netif.ip6_addr to ip_addr_t 2015-09-24 07:58:29 +02:00
sg
db76671d4d task #13729: Convert netif addresses (IPv4 & IPv6) to ip_addr_t (so they can be used without conversion/temporary storage) 2015-09-23 22:09:37 +02:00
sg
f36adac8ab fixed compiling udp.c for IPv6-only 2015-09-23 22:07:14 +02:00
sg
121268d320 Added ip_addr_set_zero_ip4() to explicitly set the type to IPv4 for dual-stack 2015-09-23 21:56:34 +02:00
goldsimon
e6b6543c33 igmp: use netif_ip4_addr() instead of directly accessing struct netif member 2015-09-23 16:26:56 +02:00
Dirk Ziegelmeier
e00e4a6c13 make netif_ip4_* get accessors return const pointers 2015-09-23 13:19:56 +02:00
sg
0454950564 fixed compiling for various config combinations 2015-09-17 22:19:37 +02:00
sg
4f9bcc5ecc fixed compiler warnings reported by mingw-64 2015-09-17 22:00:16 +02:00
sg
39e32ea7c1 fixed const warning for !IPV6_FRAG_COPYHEADER 2015-09-17 21:59:54 +02:00
sg
6f0dceee09 fixed some printf formatters (mainly for window scaling code) 2015-09-17 21:33:25 +02:00
sg
9614c60cf6 fixed constness for DNS_LOCAL_HOSTLIST_IS_DYNAMIC 2015-09-17 21:32:11 +02:00
Robert Szewczyk
52a4ca99a8 pbuf_take: make it comply with API specifications
LWIP_ERROR macro exited the function early with the return code
indicating a SUCCESS. Fix the error codes. Return the specified
error code for cases when the pbuf is too short.
2015-09-17 17:05:01 +02:00
Joel Cunningham
72b3f3f612 Hook up TCP cachehit stat
This commit hooks up the TCP cachehit stat to the PCB locality feature
so that when a PCB is moved to the head of the list and a segment comes
in, we consider this a cache hit

This also matches the usage of the cachehit stat in UDP
2015-09-17 17:02:39 +02:00