Commit Graph

3776 Commits

Author SHA1 Message Date
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
f104d68569 PPP: Init SNMP members of PPP netifs 2016-02-19 23:51:18 +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
Dirk Ziegelmeier
bbb5e99f25 Fix netconn access after it was freed in lwiperf - found by Coverity 2016-02-19 23:26:06 +01:00
Joel Cunningham
ea94549cb2 Optimize lwip_selscan()
This makes a couple of simple re-arrangements in lwip_selscan() that
should improve performance in the following ways:

  1) The old code linearly walked all sockets to maxfd regardless of
     whether they were set in the fd set. The process involved
     acquiring sys arch protect, looking up the socket, and then
     checking if the socket was present in any of the fd sets. On
     systems with lots of sockets and a heavy SYS_ARCH_PROTECT
     infrastructure (a mutex) this can result in a lot of extra work.
     Now we skip this process for any fd that is not in the input sets
  2) If the socket from tryget_socket() is NULL we no longer continue
     and compare the input fd sets with a zeroed out set of events
  3) We no longer need to zero out our event sets because they are
     only accessed when tryget_socket() is successful

lwip_selscan() is called at most once per select call and sometimes up to three times
2016-02-18 13:17:45 -06:00
sg
9a97a80efc Fixed bug #47154 lwip_netconn_do_writemore doesn't clear conn->write_offset on fatal/routing error. 2016-02-18 19:46:20 +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
cf3d7def33 Let MIB compiler generate const structs, too (see last commit) 2016-02-17 08:14:16 +01:00
Dirk Ziegelmeier
24bc77a935 Found some struct instances that can be const 2016-02-16 22:31:59 +01:00
Joel Cunningham
9dd1c81d41 Update lwip_selscan documentation
lwip_selscan() documentation indicated exceptset is not used, which is no
longer accurate
2016-02-12 15:00:41 -06:00
Dirk Ziegelmeier
cddd3b552a etharp.c: Make MAX_AGE of an ARP entry configurable 2016-02-11 09:38:17 +01:00
Dirk Ziegelmeier
5aa5563622 snmp_msg.c: Fix unchecked return value. Found by Coverity. 2016-02-10 21:57:57 +01:00
Dirk Ziegelmeier
09b850cc6f snmp_threadsync.c: Fix ignored return value of mutex/semaphore creation. Found by Coverity. 2016-02-10 21:55:50 +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
78a36df901 Netconn: Fix potential NULL pointer dereference (found by Coverity) 2016-02-10 20:39:12 +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
e5eba61cf0 SNMP: Correctly name a global variable 2016-02-10 20:32:50 +01:00
Dirk Ziegelmeier
54a2c13b2e SNMP: Fix compile in dual-stack configuration 2016-02-06 00:21:06 +01:00
Dirk Ziegelmeier
b2410e428a SNMP: Remove comment about traps in README 2016-02-04 16:22:43 +01:00
Dirk Ziegelmeier
208f24a20c SNMP: Add some comments in thread sync code 2016-02-04 16:20:46 +01:00
Dirk Ziegelmeier
8cd33a5e41 SNMP: Implement basic SNMPv1 traps; Remove IPv6 support in RAW API again until there is a clean solution for dual-stack UDP 2016-02-04 16:19:59 +01:00
Dirk Ziegelmeier
905a434179 snmp_pbuf_stream: Reduce code duplication. Most is already implemented in lwIP pbuf framework. 2016-02-03 08:39:41 +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
Dirk Ziegelmeier
28549e35fe SNMP: Update threadsync not to use mem_malloc - memory can be instantiated statically since it is only needed once per threadsync instance 2016-02-02 22:31:59 +01:00
Dirk Ziegelmeier
8f6cfa8769 Private mempools: Add missing include for LWIP_MEM_ALIGN_SIZE in memp_priv.h 2016-02-02 22:28:21 +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
Philipp Toelke
1de8d432d4 httpd: fix sending of data from send_headers 2016-01-29 09:26:29 +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
Sylvain Rochet
4beacc4ca0 PPP, VJ, fixed TCP retransmission
We used to modify in place the packet payload during compression but TCP
stack requires that we don't change the packet payload, therefore we now
copy the whole packet before compression.

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2016-01-24 20:07:54 +01:00
Sylvain Rochet
9c7231ee75 PPP, VJ, move pbuf length check so all TYPE_IP return value are within the same code block
Prepare for VJ packet copy, reorder a bit VJ compressor so all TYPE_IP
return value are within the same code block. We do that because we don't
need to copy the packet if we are not able to compress it.

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2016-01-24 19:36:19 +01:00
Sylvain Rochet
e31902dc4c PPP, prepare for chained compressors (e.g. VJ+MPPE) requiring packet copy
lwIP TCP stack requires that we don't change the packet payload in netif
output functions in order to resend the pbuf if we don't receive a TCP
ACK in time, therefore we copy the whole packet before compression or
encryption.

It gets tricky because we should keep track of whether we previously
copied the buffer in PPP output netif function in order to free the
previous pbuf if necessary, BUT the first pbuf passed to the netif
output function must not be freed.

The worst case is VJ compression followed by MPPE encryption, in this
case we should free the packet allocated by VJ compressor after MPPE
encryption and we should free the packet allocated by MPPE encrypter
after calling the PPP low level output function.

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2016-01-24 17:48:57 +01:00
Sylvain Rochet
53853a25b0 PPP, report full packet size in VJ debug output
Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2016-01-24 02:16:03 +01:00
Sylvain Rochet
858bce7b4e PPP, VJ, code cleaning
Using lwIP types instead of u_ types.
Removed useless register modifier on variable.
Removed trailing spaces.

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2016-01-24 01:38:26 +01:00
Sylvain Rochet
77d355560f PPP, VJ, fix header offset calculation on LP64/ILP64 systems
long type on LP64/ILP64 systems (such as x86_64 on Linux) is 8 byte
long, this leads to wrong offsets in packets header calculation.

Fixed it by using u32_t lwIP type instead of long type.

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2016-01-24 01:38:26 +01:00
Sylvain Rochet
733758a909 tcp: fixed TCPH_UNSET_FLAG macro
This macro is only used by VJ support in PPP and was always wrong since
its introduction in commit e4a6d199fe. It's almost only used to clear
the PSH TCP flag when necessary. This flag was probably less common
about a decade ago so that would be the reason why it goes unnoticed for
so long.

Fixes: e4a6d199fe "Merged from DEVEL into main tree."
Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2016-01-24 01:38:26 +01:00
Dirk Ziegelmeier
90df2111b7 SNMP: Add missing closing braces in #ifdef __cplusplus case 2016-01-22 13:28:11 +01:00
Stephan Linz
31732631fc PPP: CCP: add error debug messages for dropped packets due to missing transmit or receive CCP method
It might be difficult to investigate the reason of dropped packets when
there is no debug notification of what is happening, thus, add error
debug messages for dropped packets due to missing transmit or receive
CCP method.

Signed-off-by: Stephan Linz <linz@li-pro.net>
[gradator@gradator.net: improved messages]
Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2016-01-20 21:55:37 +01:00
Sylvain Rochet
c4d78e6422 PPP, PPPoL2TP, fix double free of L2TP pcb in pppol2tp_create error path
ppp_free() calls the low level protocol destroy function, pppol2tp_destroy()
here, which freed the l2tp pcb, followed by pppol2tp_create which also freed
the pcb.

Fixing it by reordering the L2TP init so we don't have to call ppp_free()
anymore.

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2016-01-20 21:12:37 +01:00
Wayne Uroda
52463fa25b PPP, PPPoS, fix dereference of uninitialised pppos->in_head pointer
When I create a new PPP connection, I am seeing a hardfault (segfault)
coming from pbuf_free.

I traced the problem to an invalid in_head field of the pppos_pcb structure.
The field is invalid because the memory is never cleared to zero after the
pppos_pcb structure is created in pppos_create().

I was able to fix the issue by adding a memset after the memp_malloc call.

Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2016-01-20 20:50:08 +01:00
Joel Cunningham
96373f6959 Define LWIP_CHKSUM_COPY_ALGORITHM when port provides LWIP_CHKSUM_COPY macro
When the port has LWIP_CHECKSUM_ON_COPY enabled and provides
a definition of LWIP_CHKSUM_COPY, the existing logic left
LWIP_CHKSUM_COPY_ALGORITHM undefined

In this case we want it to be defined to 0 since none of the copy
checksum algorithms provided are being used

This commit also introduces indentation matching LWIP_CHKSUM to
improve the readability of the code
2016-01-20 11:34:25 -06:00
Joel Cunningham
0a67c06b51 Fix type on snmp_set_test_ok to be snmp_err_t
This function was returning values from snmp_err_t but wasn't
upgraded to using the typedef after commit babce70

This resulted in compilation failure on MSVC 2013
2016-01-20 11:18:35 -06:00
Dirk Ziegelmeier
babce70c95 SNMP: Convert SNMP error #defines to an enum and fix type mismatches discovered by conversion; Convert SNMP_NEXT_OID_STATUS to an enum 2016-01-20 10:53:59 +01:00
Dirk Ziegelmeier
4cf509989f SNMP: Fix variable naming in snmp_pbuf_stream 2016-01-20 10:53:15 +01:00
Sylvain Rochet
6185bf6f61 PPP: CCP: don't drop output packets if CCP negotiated that we don't compress on our side
CCP might negotiate to not compress if peers cannot agree on a
compressor, therefore if the null compressor is chosen we must pass
packets as is instead of dropping them.

Reported-by: Stephan Linz <linz@li-pro.net>
Fixes: 987f6237c4 "PPP, MPPE, drop input/output packets if we couldn't find the chosen decompressor/compressor"
Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2016-01-19 23:51:47 +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
9f3270afaf PPP: fix typo in debug message
Signed-off-by: Stephan Linz <linz@li-pro.net>
2016-01-18 21:33:17 +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
Stephan Linz
289d1dd7f3 slipif: fix several compiler warnings
- include new SNMP header
- add missing pointer type casting
- add missing default cases
- use const for all ip address types
- distinguish between IPv4 and IPv6 address types

Signed-off-by: Stephan Linz <linz@li-pro.net>
2016-01-18 11:55:32 +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
Dirk Ziegelmeier
dc36dbac27 SNMP MIB2: Add unsupported snmpSilentDrops and snmpProxyDrops objects 2016-01-15 11:46:35 +01:00
Dirk Ziegelmeier
d9534325cf SNTP: Add function to get operating mode 2016-01-15 11:41:12 +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
Joel Cunningham
11faa8149e Fix blocking close with LWIP_SO_SNDTIMEO
This fixes a bug in close when LWIP_SO_SNDTIMEO is enabled, but
the option is not in use on the socket

A simple mis-typed comparison against zero would cause the close_timeout
to get set to zero if conn->send_timeout was 0

The intended check was to over-ride the default close timeout if a
send timeout had been specified via SO_SNDTIMEO
2016-01-13 22:20:52 +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
Dirk Ziegelmeier
c2ba9129ad SNMP: Fix InetAddress octet string encoding (length was missing) 2016-01-13 13:04:37 +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
Dirk Ziegelmeier
40ff62fa60 SNMP MIB Compiler: Update project settings, fix wrong output path in SharpSnmpLib 2016-01-12 08:40:12 +01:00
Dirk Ziegelmeier
84397ef013 SNMP MIB Compiler: Treat read-create nodes as read-only 2016-01-11 20:28:01 +01:00
Dirk Ziegelmeier
a2b7cec17b SNMP MIB Compiler: Add example command line to compile UDP-MIB 2016-01-11 20:15:17 +01:00
Dirk Ziegelmeier
e80e7a10d4 SNMP MIB Compiler: Resolve MIB files in a case-insensitive way 2016-01-11 20:14:54 +01:00
Dirk Ziegelmeier
8c4d1909f4 SNMP MIB Compiler: Deal with multiple OID assignments in a MIB file 2016-01-11 19:45:57 +01:00
Dirk Ziegelmeier
bb8ecd7e08 SNMP: Add some basic MIBs 2016-01-11 19:45:25 +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
Dirk Ziegelmeier
44256740bd SNMP MIB Viewer: Adapt to changes in SNMP framework that were required to compile UDP-MIB and TCP-MIB 2016-01-11 12:25:47 +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
Dirk Ziegelmeier
b68e801975 MIB compiler: Eliminate the need for a cast 2016-01-11 10:32:33 +01:00
Dirk Ziegelmeier
987f0e3016 Update SNMP README - add correct SharpSnmpLib reference 2016-01-11 10:26:37 +01:00
Dirk Ziegelmeier
713deba83f SNMP MIB compiler: Add ability to generate UDP-MIB and TCP-MIB 2016-01-11 10:24:31 +01:00
Dirk Ziegelmeier
b9d0d80946 SNMP: Add more MIB compiler info 2016-01-09 14:35:51 +01:00
Dirk Ziegelmeier
84cd489d24 SNMP: Add MIB compiler (code generator) 2016-01-09 12:39:48 +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
Dirk Ziegelmeier
4e8574bd23 SNMP: Table API cleanup 2016-01-07 09:53:25 +01:00
Dirk Ziegelmeier
fbdfba2509 SNMP: Found the correct cause of a memory leak 2016-01-07 09:52:13 +01:00
Dirk Ziegelmeier
e033866651 Merge branch 'master' of ssh://git.sv.gnu.org:/srv/git/lwip 2016-01-05 10:00:21 +01:00
Dirk Ziegelmeier
76094b8c7e SNMP: SMEMCPY should only be used when size is known at compile time 2016-01-05 09:59:42 +01:00
Dirk Ziegelmeier
e336f877c2 Merge branch 'master' of ssh://git.sv.gnu.org:/srv/git/lwip 2016-01-04 21:27:39 +01:00
Dirk Ziegelmeier
7f699b36ff Update some MIB2 comments 2016-01-04 21:27:24 +01:00
Dirk Ziegelmeier
e041b9a51c SNMP: Fix shadowing warning in another file. Pointed out by Erik Ekman. 2016-01-04 13:30:02 +01:00
Dirk Ziegelmeier
0a222a2ff7 SNMP: Fix shadowing warning pointed out by Erik Ekman 2016-01-04 12:31:09 +01:00
Axel Lin
031de097db Trivial comment fix for lwip_netconn_do_disconnect()
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-01-04 11:54:21 +01:00
Dirk Ziegelmeier
d4361fc7d7 snmp_traps.c: #if 0 ... #endif around C++ style comments does not work - remove the code completely for now 2016-01-04 11:41:17 +01:00
Dirk Ziegelmeier
44617bfa9b Fix compile of SNMP on MSVC 2016-01-04 11:26:36 +01:00
Dirk Ziegelmeier
6352106aaa Fix C++ style comment in snmp_asn1.h 2016-01-04 11:05:44 +01:00
Dirk Ziegelmeier
7412a0e74e SNMP: Move common MIB code into snmp_core.c helper functions 2016-01-02 21:29:01 +01:00
Dirk Ziegelmeier
19d17adcfb SNMP MIB2: Implement tcpConnectionTable 2016-01-02 20:55:14 +01:00
Dirk Ziegelmeier
e1e7a704e1 SNMP MIB2: Implement tcpListenerTable 2016-01-02 20:06:53 +01:00
Dirk Ziegelmeier
19dd6c391f SNMP MIB2: Update UDP endpoint table variable names 2016-01-01 23:09:54 +01:00
Dirk Ziegelmeier
c5cab4e719 SNMP RAW API: Listen on IPV6 UDP port, too 2016-01-01 22:59:00 +01:00
Dirk Ziegelmeier
b48f6d1405 Add comment about udpEnpointTable non-accessible columns 2016-01-01 22:00:39 +01:00
Dirk Ziegelmeier
c466f8824f SNMP: Finish implementing UDP-MIB. Add unsupported udpHCInDatagrams and udpHCOutDatagrams items. 2016-01-01 21:58:51 +01:00
Dirk Ziegelmeier
2b16cd93bf SNMP: Another release_instance call bugfix in SNMP Get/GetNext requests 2016-01-01 20:58:02 +01:00
Dirk Ziegelmeier
0c39165701 SNMP: Two bugfixes in SNMP GET requests 2016-01-01 20:44:16 +01:00
Dirk Ziegelmeier
9d1234d83a Add some comments and OID checks to udpEndpointTable 2015-12-31 16:19:26 +01:00
Dirk Ziegelmeier
dfaa979b99 Start working on udpEndpointTable 2015-12-31 16:13:45 +01:00
Dirk Ziegelmeier
611966de63 SNMP: Cleanup snmp IP helper functions, add IPv6 support 2015-12-29 22:06:23 +01:00
Dirk Ziegelmeier
4341df4094 SNMP: Fix compile when IPV4 is not enabled 2015-12-28 22:28:01 +01:00
Dirk Ziegelmeier
83f8ec1397 Some SNMP MIB2 code layout cleanups 2015-12-28 21:37:17 +01:00
Dirk Ziegelmeier
fdd98879bf C-Style comments only, please 2015-12-26 12:17:07 +01:00
Dirk Ziegelmeier
5e34b8736a Minor SNMP compile and comment fix 2015-12-26 12:02:16 +01:00
Dirk Ziegelmeier
7b946fa9b1 SNMP agent rewrite
- SNMPv2c support
  - Greatly reduced RAM usage, no memory pools any more
  - API cleanup
  - MIB2 is separated from SNMP stack
  - Support for multiple MIBs (snmp_set_mibs call) - e.g. for private MIB
  - Improved MIB2 implementation (tcpConnTable etc.)
  - Redesigned simple and generic API for MIB implementation
  - Comfortable node types for scalar arrays and tables
  - Counter64, bit and truthvalue datatype support
  - Callbacks for SNMP writes
  - Runs on two APIs: RAW and netconn
  - Async API is gone - the stack now supports netconn API instead,
    so blocking operations can be done in MIB calls.
    SNMP runs in a worker thread when netconn API is used.
  - Simplified thread sync support for MIBs - useful when MIBs
    need to access variables shared with other threads without locking
    (used in MIB2 to access lwIP stats from lwIP thread)

Currently in work:
  - Traps rewrite
  - MIB compiler
2015-12-26 11:43:29 +01:00
Dirk Ziegelmeier
0178d1d2ee Add missing comment for MIB2 callbacks in opt.h 2015-12-09 21:06:14 +01:00
Dirk Ziegelmeier
0c06f09d6d makefsdata.c: Adapt to new header include location 2015-12-09 12:48:02 +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
Dirk Ziegelmeier
f69b1841e0 Fix compile when netconn api is disabled but socket api is enabled.
Problem is that declaring functions as static in a public header will produce warnings in every file it is included because the static functions are not implemented.
Solution: When socket api is enabled, netconn is simply available, too
(Socket api uses netconn api internally)
2015-12-05 21:58:38 +01:00
Axel Lin
a3bccae173 Catch tcpip_callback call failure
tcpip_callback_with_block() can fail with ERR_MEM or ERR_VAL, and in the
error paths the code does not post the msg to the mailbox thus the
sys_sem_wait() call might wait forever. Fix it by testing return value of
tcpip_callback() and return error immediately.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2015-12-05 21:41:27 +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
3b60c855e1 netbuf: Move #include "lwip/opt.h" out of #if LWIP_NETCONN || LWIP_SOCKET guard
LWIP_NETCONN and LWIP_SOCKET are defined in opt.h,
so move #include "lwip/opt.h" out of #if LWIP_NETCONN || LWIP_SOCKET guard.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2015-12-05 21:22:34 +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
Dirk Ziegelmeier
8bb27ba8c4 Forgot to remove two SNMP options from opt.h that are now in lwip/apps/snmp_opts.h 2015-12-03 13:51: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
goldsimon
8010d6706e fixed bug #46471: lwip_accept() leaks socket descriptors if new netconn was already closed because of peer behavior 2015-11-19 07:33:55 +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
Dirk Ziegelmeier
3f49b85680 Update header include guard naming of all apps headers
Unbreak compilation, lwip/apps/snmp.h guard clashed with lwip/snmp.h
2015-11-18 20:21:56 +01:00
Dirk Ziegelmeier
65bb7a623c snmp.h: Add missing #if around function prototypes 2015-11-18 08:18:04 +01:00
Dirk Ziegelmeier
4293c1e138 snmp.h: Fix header include guard 2015-11-18 08:08:37 +01:00
Dirk Ziegelmeier
b8e94ec066 lwiperf: TX buffer can be static 2015-11-18 07:52:04 +01:00
Dirk Ziegelmeier
e15872982e Add iperf to apps;
Fix compile of lwiperf.c
2015-11-18 07:46:39 +01:00
Dirk Ziegelmeier
e4f7ddacb3 Add Filelists.mk file containing all LWIP files. May be useful for client projects. 2015-11-16 21:54:01 +01:00
Dirk Ziegelmeier
c69dede728 Move httpd from contrib to main git repository 2015-11-16 12:27:24 +01:00
Dirk Ziegelmeier
39370db55d Implement API function to iterate over stable ARP table entries 2015-11-16 09:53:23 +01:00
Dirk Ziegelmeier
73bb986737 Also fix compile of ethernetif.c after SNMP refactoring 2015-11-16 09:49:32 +01:00
goldsimon
98b9d31f24 Fixed compiling with LWIP_TCP==0 2015-11-16 09:37:56 +01:00
Axel Lin
ecf9d25ed0 api_msg_c: remove superfluous NETCONN_SET_SAFE_ERR call before TCPIP_APIMSG_ACK
The TCPIP_APIMSG_ACK will call NETCONN_SET_SAFE_ERR for both
LWIP_TCPIP_CORE_LOCKING and !LWIP_TCPIP_CORE_LOCKING cases.
So remove superfluous NETCONN_SET_SAFE_ERR call before TCPIP_APIMSG_ACK.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2015-11-16 09:12:29 +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
cacbd596c9 Move some prototypes from snmp_msg.h to snmp.h because they are used by user code 2015-11-14 19:50:57 +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
f518c6578c fixed bug #46321: Synchronization bug around lwip_select() and tcpip_thread() with thread-local semaphores 2015-10-29 22:20:21 +01:00
sg
2dec8f449a minor: fixed typo: even_callback -> event_callback 2015-10-29 22:18:41 +01:00
Joel Cunningham
1ef913cd36 Update snd_queuelen comment documentation
This commit updates the snd_queuelen comment documentation to reflect
that snd_queuelen tracks the number of pbufs currently in the send
buffer (unsent + unacked queues) rather than the number of pbufs
available in the buffer (which was what previous comment implied)
2015-10-26 09:33:39 -05:00
Joel Cunningham
affc6d61ca Update socket options comments
This commit updates socket option comments to reflect which ones are
currently supported:

  * SO_REUSEPORT is no longer implemented
  * SO_SNDTIMEO is implemented
2015-10-16 13:18:39 -05:00
sg
f278b27119 pppapi/ppos: include tcpip_priv.h, not tcpip.h 2015-10-11 13:37:25 +02:00
Sylvain Rochet
37bb0b89f0 all: trivial include changes related to the new "lwip/priv/" include directory 2015-10-10 22:46:47 +02:00
sg
02bddd251a re-added tcpip.h (removed because the better part of the file moved to "priv/tcpip_priv.h", which was more worth conserving the git history - how do you duplicate a file keeping its history in both copies??) 2015-10-09 22:00:32 +02: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
sg
fc1db87318 Fixed compiling api with LWIP_NETCONN_SEM_PER_THREAD==1 && LWIP_MPU_COMPATIBLE==1 2015-10-09 21:00:21 +02:00
sg
365f3fb651 Make LWIP_RAW==0 the default, raw IP sockets/pcbs should not be too common to justify the increased codesize for default setups 2015-10-09 20:47:32 +02:00
sg
a7ee681515 netbios -> netbiosns, added netbiosns_opts.h, added netbiosns_set_name() and netbiosns_stop() 2015-10-08 22:13:00 +02:00
sg
b02bcde8e0 added netbios name server from contrib (-> netbiosns) 2015-10-08 22:05:55 +02:00
sg
bef5ccda0b removed spaces at line ending, fixed include guard 2015-10-08 21:46:43 +02:00
sg
a2cd2ae5a8 lwiperf: fixed const-cast warning 2015-10-08 21:22:35 +02:00
sg
698e20a990 Added lwiperf, a simple ipv4/tcp iperf peer 2015-10-08 21:14:14 +02:00
sg
b6ad76fe1a fixed header include guard, fixed FILES 2015-10-08 21:13:42 +02:00
sg
22957a8082 added sntp_opts.h (all options for the sntp app), added FILES to describe the include folder 2015-10-07 22:24:32 +02:00
sg
8dfd5e82cb first 'app': added SNTP client from contrib (unmodified from 196cbae376dfd484b4833503dd43057b4c3462fa, 28.08.2015) 2015-10-07 22:16:48 +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
58895c3cf6 PPP: Fix shadowing of global declaration 'sha1'
lwip/src/netif/ppp/mppe.c: In function `mppe_rekey':
lwip/src/netif/ppp/mppe.c:74:15: error: declaration of`sha1' shadows a global declaration [-Werror=shadow]
lwip/src/include/netif/ppp/polarssl/sha1.h:88:6: error: shadowed declaration is here [-Werror=shadow]
2015-10-06 11:13:30 +02:00
Erik Ekman
7fb832aa4e PPP: Fix shadowing of global declaration
Older compilers don't like variables with the same name as
global functions. md5.h contains a function md5(), rename
md5 variable in magic.c to md5_ctx.
2015-10-06 09:56:00 +02:00
Erik Ekman
673c6505ae PPP: Fix shadowing of global declaration
Older compilers don't like variables with the same name as
global functions. md5.h contains a function md5(), rename
md5 variable in magic.c to md5_ctx.

lwip/src/netif/ppp/magic.c: In function `magic_churnrand':
lwip/src/netif/ppp/magic.c:105:15: error: declaration of `md5' shadows a global declaration [-Werror=shadow]
lwip/src/include/netif/ppp/polarssl/md5.h:88:6: error: shadowed declaration is here [-Werror=shadow]

lwip/src/netif/ppp/magic.c: In function `magic_random_bytes':
lwip/src/netif/ppp/magic.c:165:15: error: declaration of `md5' shadows a global declaration [-Werror=shadow]
lwip/src/include/netif/ppp/polarssl/md5.h:88:6: error: shadowed declaration is here [-Werror=shadow]
2015-10-05 18:24:30 +02:00
Erik Ekman
1fef434f01 PPP: Fix shadowing of global declaration
Older compilers (GCC 4.6) don't like variables with the same name as
global functions:

lwip/src/netif/ppp/lcp.c: In function 'lcp_received_echo_reply':
lwip/src/netif/ppp/lcp.c:2685:11: error: declaration of 'magic' shadows a global declaration [-Werror=shadow]
lwip/src/include/netif/ppp/magic.h:101:7: error: shadowed declaration is here [-Werror=shadow]

magic.h contains a function named magic(), so rename the variable.
2015-10-04 11:11:57 +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
5b1b430403 sockets ERR_TO_ERRNO_TABLE_SIZE: use LWIP_ARRAYSIZE() 2015-10-02 10:07:45 +02:00
goldsimon
424bd7e38c def.h: added LWIP_ARRAYSIZE() macro 2015-10-02 10:05:32 +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
064d171332 snmp: moved agent initialization from snmp_msg.h to snmp.h 2015-10-02 09:56:37 +02:00
goldsimon
30445712a5 snmp: make mib_scalar_node a "derived" struct like all other nodes 2015-10-02 09:56:00 +02:00
goldsimon
91b6d45178 struct netif->hostname can be a const pointer 2015-10-02 09:42:49 +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 Ziegelmeier
ae7eeda88a dns_found_callback should take const IP addr 2015-09-30 22:19:47 +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
5e7a74e2e7 fixed bug #46064: ip_set_v6() must set pcb ip address types as well 2015-09-28 09:36:36 +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
dbe703cfb0 netdb: fixed warning about pointless comparison 2015-09-28 08:10:53 +02:00
goldsimon
bc30899168 fixed compiler warnings where passing variable instance to ip_addr_isany 2015-09-28 07:56:52 +02:00
Sylvain Rochet
d39f929675 PPP: magic: don't truncate sys_jiffies() return value
It used to be this way because the original implementation was close to
the hardware and used a free running 16 bits timer so it was necessary.
Currently what it is only doing is removing potential entropy we might
get from upper bits, that's a bad idea.
2015-09-27 17:15:31 +02:00
Sylvain Rochet
b589864144 sys.h: fixed comment, sys_msleep() is in ms, not in jiffies 2015-09-27 00:05:58 +02:00
Sylvain Rochet
9e0202b38f PPP, PPP_MAXIDLEFLAG is now in ms instead of jiffies
Jiffies isn't really a humanly readable value and it means the default
PPP_MAXIDLEFLAG period depends on the platform "jiffies" frequency,
which isn't nice.

Change PPP_MAXIDLEFLAG to use ms instead of jiffies, the current
PPP_MAXIDLEFLAG default (100 ms), looks like a sane value and is
left unchanged.
2015-09-26 23:01:15 +02:00
sg
ba41685353 PPP: include "ppp_settings.h" if PPP_INCLUDE_SETTINGS_HEADER is defined to be able to silence some warnings in PPP code only (at least msvc needs this since PPP produces more warnings than the rest) 2015-09-24 22:04:48 +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
715d8d3881 simplify FDSETSAFESET()/FDSETSAFEGET(): p is not required 2015-09-24 15:34:54 +02:00
goldsimon
5ad743e182 FD_SET: dump NULL-check that hides usage error, dump non-standard FD_SET_VAL 2015-09-24 15:21:03 +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
e11e12f01d Fixed ETHARP_TRUST_IP_MAC after changing struct netif.ip_addr/netmask to ip_addr_t 2015-09-24 14:46:29 +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