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
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
51ce505d7d
Simplify ip_2_ip6/4(_c) macros (and removed LWIP_ALLOW_STATIC_FN_IN_HEADER) -> now the *_c versions should not be required any more
2015-09-24 10:13:45 +02:00
goldsimon
f85737bf29
Fixed const warning in lwip_writev
2015-09-24 09:30:00 +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
Joel Cunningham
cc4d09423a
Add writev function
...
This commit adds compatibility with POSIX writev according to the Open
Group specification:
http://pubs.opengroup.org/onlinepubs/009695399/functions/writev.html
Implementation maps to sendmsg in the same manner that write() maps to
send()
2015-09-23 15:52:28 -05: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
05e6f06b62
Fixed IP_ADDR6 macro for IPv6 only
2015-09-23 22:07:34 +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
Sylvain Rochet
2f40d19193
trivial CVS to Git renaming
2015-09-22 21:09:57 +02:00
goldsimon
abc74464a0
Revert "make netif_ip4_addr/netmask/gw macros return constant IP address pointers"
...
This reverts commit b9b31a5e72
.
2015-09-22 11:42:41 +02:00
Dirk Ziegelmeier
b9b31a5e72
make netif_ip4_addr/netmask/gw macros return constant IP address pointers
2015-09-21 20:32:14 +02:00
Sylvain Rochet
8eab90418a
PPP, auth, code cleaning: removed useless variables on stack
2015-09-18 22:51:32 +02:00
Sylvain Rochet
83cddd8941
PPP: more const and mixed u_char/char types fixes
2015-09-18 20:11:09 +02:00
sg
cb6adc643b
PPP: more const fixes
2015-09-17 22:20:12 +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
2f3dcf7a16
fixed compiling lwip_sendmsg for LWIP_NETIF_TX_SINGLE_PBUF && LWIP_CHECKSUM_ON_COPY
2015-09-17 21:36:25 +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
Dirk Ziegelmeier
cca758d332
Fixed using wrong sockaddr type in lwip_getaddrinfo when IPv6 is enabled
2015-09-17 20:55:44 +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
Dirk Ziegelmeier
f62022cdf3
Compiler warning fixes (mostly constness in dual-stack configurations)
2015-09-17 13:59:52 +02:00
goldsimon
726af89168
minor compiler warning fixes and coding style
2015-09-17 11:00:21 +02:00
Joel Cunningham
c1c1754171
Sockets: add sendmsg
...
Adds sendmsg implementation for TCP and UDP sockets. Control messages
are not supported at this point, but could be added in the future
https://savannah.nongnu.org/bugs/?44805
Change-Id: Iddb287fd4b693f7563f8c923f76785cdde782d2f
2015-09-16 15:49:02 -05:00
sg
68a1ec2eb1
Fixed passing ip_input() to netif_add() for single-IP-version NO_SYS configurations
2015-09-16 22:09:54 +02:00
chrysn
b85b554db1
PPP, FSM, don't call memcpy with NULL even when size = 0
2015-09-16 16:03:15 +02:00
goldsimon
dc04118469
fixed missing comment after #endif
2015-09-15 08:19:26 +02:00
Joel Cunningham
7276f49f54
Fix typos from task #12243
...
This fixes two typos spotted during visual inspection of changes related
to task #12243
2015-09-14 20:43:21 +02:00
Sylvain Rochet
4704c9a0ad
tcp: fixed CHECKSUM_GEN_TCP feature (misplaced #define)
2015-09-14 14:48:35 +02:00
Sylvain Rochet
c15b357889
PPP, merged ppp_link_set_callbacks() into ppp_new()
2015-09-13 18:28:06 +02:00
Sylvain Rochet
46204a9f86
PPP, reorder initialisation of low level protocols to call ppp_link_set_callbacks() just after PPP control block allocation
2015-09-13 18:21:14 +02:00
Sylvain Rochet
5b07569eb9
PPP, remove now unused ioctl callback from link_callbacks structure
2015-09-13 17:59:14 +02:00
Sylvain Rochet
b55412a0c4
PPP, PPPoS, replaced static sio_write() calls to a user defined callback
...
The overall lwIP design on data flows (netif,udp,tcp) is to use a user
defined callback to get data from stack and a static function to send
data to stack, which makes perfect sense. The SIO port was an exception,
the PPP stack never really used the SIO port by only using the
sio_send() function (and the ignominious sio_read_abort() function a
while back).
The way the SIO port is currently designed adds a tight coupling between
the lwIP port and the user code if the user need to do specific user
code if the current uart used is the PPPoS uart, which is not nice,
especially because all the lwIP stack is quite clean at this subject.
While we are at stabilizing the PPP API, change this behavior before
it's too late by replacing the static sio_write() calls to a user
defined callback.
2015-09-13 17:53:16 +02:00
Sylvain Rochet
41ee45d9f7
PPP: fix constness in PPP related files when PRINTPKT_SUPPORT is enabled
2015-09-09 20:28:01 +02:00
Dirk Ziegelmeier
79e7201854
PPP: fix constness in PPP related files (GCC -Wcast-qual)
...
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net>
2015-09-09 14:05:35 +02:00
goldsimon
7702ed66a0
fixed compiler warning (stray 'a ' in code) - why is this a warning only???
2015-09-08 09:52:22 +02:00
goldsimon
b8d7a2b8e6
fixed comment, fixed unused parameter in mppe_compress()
2015-09-08 09:50:30 +02:00
goldsimon
8a0fb03e21
Separate mib2 counter/table callbacks from snmp agent. This both cleans up the code and should allow integration of a 3rd party agent/mib2.
2015-09-08 09:47:30 +02:00
sg
1e4f312352
fixed compiling DNS code again
2015-09-08 06:03:27 +02:00
sg
77270adb96
Changed dns_gethostbyname_addrtype() to always be a function, fixed code for C PP :-(
2015-09-07 22:33:10 +02:00
sg
42170e4e57
fixed unused variable warning
2015-09-06 14:28:41 +02:00
Sylvain Rochet
318ba1decd
dns: fixed trivial compiler warning
...
lwip/src/core/dns.c:1471:8: warning: extra tokens at end of #endif directive [-Wendif-labels]
#endif LWIP_IPV4 && LWIP_IPV6
2015-09-06 11:27:33 +02:00
sg
1fbbf0e837
lwip_getaddrinfo: check max name length
2015-09-04 21:12:39 +02:00
sg
6795590603
fixed missing #endif
2015-09-04 21:02:24 +02:00
goldsimon
196120fabd
worked on task #12243 (Add support for AAAA/IPv6 records to DNS)
2015-09-04 13:57:20 +02:00
goldsimon
dd3725a452
task #12243 : DNS/IPv6: added support for AAAA records
2015-09-04 12:16:14 +02:00
goldsimon
c8cd67c989
fixed pointer type of value passed for snmpenableauthentraps (broken in 2010)
2015-09-03 14:02:30 +02:00
Stian Sebastian Skjelstad
aea87a9a2f
Forget addresses set up by SLAAC when prefix expires.
2015-09-02 13:12:52 -06:00
sg
aa0e41c389
task #12178 : hardware checksum capabilities can be configured per netif (use NETIF_SET_CHECKSUM_CTRL() in your netif's init function)
2015-09-01 22:04:15 +02:00
Sylvain Rochet
c4a1cad81b
PPP, magic, build-out useless code when LWIP_RAND is defined
2015-09-01 10:29:53 +02:00
Sylvain Rochet
0f3fbb267b
PPP, magic, call magic_randomize() for all packets
...
magic_randomize() wasn't actually called for IP4/IP6 packets, fixed
2015-08-31 10:20:12 +02:00
Sylvain Rochet
a17b3fc838
PPP, magic, improved magic_randomize() when using PPP_MD5_RANDM
...
Added the random seed already used without PPP_MD5_RANDM
as an entropy source when PPP_MD5_RANDM feature is enabled.
(And a little bit of code cleaning for both)
2015-08-31 10:20:12 +02:00
goldsimon
dd8feb49aa
PBUF_REF with "custom" pbufs is now supported for RX pbufs (see pcapif in contrib for an example, LWIP_SUPPORT_CUSTOM_PBUF is required)
2015-08-31 08:29:23 +02:00
goldsimon
b572028e95
ethernet_input: pass IPv4 packets to ip4_input, not to ip_input
2015-08-31 08:26:44 +02:00
sg
a01a1b4556
support IPv4 source based routing: define LWIP_HOOK_IP4_ROUTE_SRC to point to a routing function
2015-08-30 21:54:39 +02:00
Sylvain Rochet
36305e5bd8
PPP, magic, use LWIP_RAND() if available
...
If LWIP_RAND() is available, it is used instead of libc srand()/rand()
if PPP_MD5_RANDM is disabled and it is added as a source of randomness
if PPP_MD5_RANDM is enabled.
2015-08-30 21:09:39 +02:00
Sylvain Rochet
541e3b6eb4
PPP, magic, improved magic_randomize() for PPP_MD5_RANDM is not enabled
...
A disabled PPP_MD5_RANDM should not be used when challenge are used, but
anyway, improved magic_randomize() so magic_randomseed is not equals to
sys_jiffies() which is pretty useless because that's fully predicable.
2015-08-30 21:09:39 +02:00
Sylvain Rochet
a24f4421d6
PPP, magic, using magic_random_bytes() for CHAP/MSCHAP/EAP instead of for-loop byte where possible
2015-08-30 21:09:39 +02:00
Sylvain Rochet
e8399416ae
PPP, magic, renamed random_bytes() to magic_random_bytes() for API coherency
2015-08-30 21:09:39 +02:00
Sylvain Rochet
d0fa8acf86
PPP, magic, enables building without PPP_MD5_RANDM support
...
The only API difference with and without the PPP_MD5_RANDM support is the
availability of the random_bytes() function. Added a random_bytes()
function on top of magic() when PPP_MD5_RANDM support is not enabled,
thus allowing builds for both cases.
PPP_MD5_RANDM is still enabled by default (it was mandatory) if a protocol
using encryption is enabled, such as CHAP, EAP, or L2TP auth support.
2015-08-30 21:09:39 +02:00
Sylvain Rochet
ced7bef274
PPP, magic, MD5 random pool size cannot be anything else than MD5 hash size, code cleaning to make it clear
2015-08-30 21:09:39 +02:00
Sylvain Rochet
311644f39b
PPP, PPPoS, remove magic_randomize() from PPPoS, it is already called in ppp_input()
...
There is no point of calling magic_randomize() for each pppos_input()
call, making magic_randomize() potentially called for each serial input
byte which is quite a bad idea since magic_randomize() is quite
intensive in processing time (MD5 computation) compared to HDLC frame
parsing. There is no entropy added when being called for each input byte
rather than for each valid input packet because byte input is a
monotonic event at the packet level. Well, if packet arrival time is a
valid entropy source even so, which I doubt a lot, but we don't really
have anything else and we really need random for PPP authentication
layers.
2015-08-30 21:09:38 +02:00
Sylvain Rochet
91e40e668c
PPP, minor coding style fix
2015-08-30 21:09:38 +02:00
Sylvain Rochet
987f6237c4
PPP, MPPE, drop input/output packets if we couldn't find the chosen decompressor/compressor
...
Drop input/output packets if we couldn't find a decompressor/compressor,
it can't really happen because we only negotiate what we are able to
compress/decompress, but for the sake of code consistency it makes much
more sense to do so.
2015-08-30 21:09:38 +02:00
sg
b9a8310f4b
fixed bug #44023 : TCP ssthresh value is unclear: ssthresh is set to the full send window for active open, too, and is updated once after SYN to ensure the correct send window is used
2015-08-30 20:47:17 +02:00
Sylvain Rochet
ddba4b90c3
fixed typo: IP6_FRAG_COPYHEADER -> IPV6_FRAG_COPYHEADER
2015-08-28 14:28:04 +02:00
goldsimon
98f98048bc
TCP window scaling: don't parse window scaling option on retransmission
2015-08-28 11:23:24 +02:00
goldsimon
367ac04ed8
Fixed UDP multicast receive filtering (multicast should only be received when bound to ANY or the destination multicast address)
2015-08-28 10:24:02 +02:00
goldsimon
43b18b20cc
fixed bug #45818 : API functions should check if type of ip_addr_t parameter matches the pcb type
2015-08-28 10:15:57 +02:00
goldsimon
06d8dba4a0
fixed bug #45559 : Window scaling casts u32_t to u16_t without checks
2015-08-28 09:23:10 +02:00
Sylvain Rochet
b79c3aadd2
PPP, MPPE, improve dropping of unencrypted received packet
...
Improve dropping of unencrypted received packet by taking into account
all other data protocols (such as VJ packets) in a generic way.
2015-08-28 00:19:32 +02:00
Sylvain Rochet
46985bf750
PPP, explain better why we don't need protp->datainput callback
2015-08-27 22:42:42 +02:00
Sylvain Rochet
36b3878a45
PPP, PPPoS, fixed copy/paste typo in pppos_send_config() out accm debug message
2015-08-27 22:24:27 +02:00
sg
bc8120c864
Add another sanity check for bug #41009
2015-08-27 21:43:42 +02:00
sg
413bf85dde
Remove empty init functions where not required for backwards compatibility
2015-08-27 21:35:18 +02:00
Sylvain Rochet
97ef85c9aa
PPP, MPPE, fixed TCP over MPPE
...
We used to modify in place the packet payload during encryption, it works
well for UDP and ICMP but TCP stack requires that we don't change the
packet payload, therefore we now copy the whole packet before encryption.
2015-08-27 01:58:35 +02:00
sg
f649172580
fixed bug bug #41009 : IPv6 reassembly broken on 64-bit platforms: define IPV6_FRAG_COPYHEADER==1 on these platforms to copy the IPv6 header instead of referencing it, which gives more room for struct ip6_reass_helper
2015-08-26 22:16:23 +02:00
sg
aad76acb68
IPV6_REASS: fix ip6_reass_remove_oldest_datagram() when the first fragment to enqueue has more pbufs than IP_REASS_MAX_PBUFS
2015-08-26 21:20:13 +02:00
sg
5eb1c411a5
LWIP_LOOPIF_MCAST -> LWIP_LOOPIF_MULTICAST
2015-08-26 20:55:51 +02:00
sg
0d6001a196
fix comment indentation
2015-08-26 20:29:38 +02:00
Joel Cunningham
0ab21da820
Add multicast support to loopif
...
This commit adds support to send and receive multicast on the loopback
netif by enabling IGMP via NETIF_FLAG_IGMP
This commit also introduces an LwIP configuration option,
LWIP_LOOPIF_MCAST, to control the behavior and it defaults to off
2015-08-26 20:28:03 +02:00
sg
204bd29e52
fixed bug #45827 : recvfrom: TCP window is updated with MSG_PEEK
2015-08-25 22:25:51 +02:00
goldsimon
fd8b37dc14
fixed bug #45029 (Several macros use ip6_2_ip() without supplying a storage address): removed netconn_*_ip6() macros
2015-08-25 07:33:24 +02:00
sg
94550682d7
more cleanup prework to fix bug #45029
2015-08-24 22:46:34 +02:00
sg
7754f96549
Change IP6_ADDR/IP_ADDR6 to initialize a full IPv6 address (e.g. use with PP_HTONL) - renamed old IP6_ADDR() to IP6_ADDR_PART()
2015-08-24 20:30:48 +02:00
goldsimon
ee2d01ed88
fix compiler warnings when passing u16_t to pbuf_header()
2015-08-24 08:49:51 +02:00
goldsimon
e97f9fca22
netdb: fix debug output when IPv6 is enabled
2015-08-24 08:02:23 +02:00
sg
177c06b1f1
- prework for fixing bug #45029 : access IPv4 configuration of struct netif via new API (netif_ip4_addr()/netif_ip4_netmask()/netif_ip4_gw()) instead of accessing the struct member directly. This way, we can change the struct member types from ip4_addr_t to ip_addr_t;
...
- fixed some bugs in calls to ip4_addr*() where the cast to u8_t* did not reveal the wrong address type
2015-08-20 22:39:48 +02:00
goldsimon
cc348dcca2
LWIP_IGMP and LWIP_MULTICAST_TX_OPTIONS need LWIP_IPV4
2015-08-20 16:36:54 +02:00
goldsimon
8622af77c1
nd6: adapt to constness of IP6_ADDR_ANY6 for IPv6-only configuration
2015-08-20 16:35:49 +02:00
goldsimon
3b21f469ca
fix bug #45120 in a cleaner way
2015-08-20 13:05:59 +02:00
goldsimon
82033d5029
Clarify comment for MEMP_NUM_SNMP_VARBIND/MEMP_NUM_SNMP_VALUE
2015-08-20 11:43:36 +02:00
goldsimon
da5ccbf7d1
SNMP: tiny preparation for SNMP to support more versions than just v1: store request version in struct snmp_msg_pstat so that the response can be sent with the same version (v2c might already work but getbulk is missing)
2015-08-20 09:38:17 +02:00
goldsimon
a22a92b481
Fixed compiler warning when window scaling is enabled (tcp_sndbuf() should still return u16_t since that value can directly be passed to tcp_write())
2015-08-20 09:18:20 +02:00
goldsimon
5bd262f9e9
fixed passing u16_t 'snmp_varbind->value_len' to functions taking an u8_t only
2015-08-20 08:23:34 +02:00
goldsimon
2b93ef1d75
fixed bug #43790 : Sending octet string of Length >255 from SNMP agent (patch by Manoj Kumar)
2015-08-20 08:12:50 +02:00
sg
05abfc8ded
Fixed icmp.c after 1.4.0-based patch #45120
2015-08-19 22:14:37 +02:00
sg
de8e810792
fixed bug #45120 : Broadcast & multiple interfaces handling
2015-08-19 20:55:03 +02:00
goldsimon
d104335501
dns.c: fixed compiler warning
2015-08-19 13:28:03 +02:00
goldsimon
7263cc675b
fixed bug #45004 : dns response without answer might be discarded
2015-08-19 10:33:42 +02:00
Joel Cunningham
d850efdd08
IPv6 sockaddr clean ups
...
This commit address two issues with sockaddr struct implementations for
IPv6:
1) struct sockaddr_in6 should have 32-bit unsigned field sin6_scope_id
as specified in Section 3.4 of RFC 3493 (Basic Socket Interface
Extensions for IPv6)
2) struct sockaddr is not extended in IPv6 to contain space for
struct sockaddr_in6. Applications should be using struct
sockaddr_storage when needing generic storage. This removes the
extra bytes added when LWIP_IPV6 is defined
2015-08-19 10:15:47 +02:00
goldsimon
a6bd0944db
LWIP_NETCONN_SEM_PER_THREAD: ensure sys_sem_valid() is only called for non-NULL pointers (not all ports might check this)
2015-08-19 09:57:59 +02:00
goldsimon
7df2dd67bd
another fix for LWIP_MULTICAST_TX_OPTIONS: without LWIP_IGMP, udp_pcb->mcast_ttl was not initialized
2015-08-19 09:19:08 +02:00
goldsimon
5be95aa377
accidentally committed debug comment //
2015-08-19 08:36:54 +02:00
sg
c2f978bd1e
patch by Chrysn: patch #8704 fix sys_timeouts_sleeptime function
2015-08-18 21:38:08 +02:00
sg
21815a1427
dns: fixed assertion when dns server address is set to ANY (patch #8692 )
2015-08-18 21:30:46 +02:00
chrysn
877fcb35f4
fix return type of netif_add_ip6_address mismatch
...
the netif_add_ip6_address function was declared err_t in
src/include/lwip/netif.h, but defined as s8_t (the default value of
err_t) in its implementation in src/core/netif.c.
this causes "conflicting types for 'netif_add_ip6_address'" errors if
err_t is defined differently in cc.h (as for example recommended in
[1]).
as it only returns error constants, it is changed to use err_t
throughout.
[1] http://lwip.wikia.com/wiki/Porting_For_Bare_Metal
2015-08-18 20:55:30 +02:00
sg
c2f7e166a0
fixed bug #45723 netconn_delete unconditionally uses macro TCP_SLOW_INTERVAL
2015-08-18 20:32:09 +02:00
sg
e171b4e3f0
Fixed usages of SYS_SEM_NULL after using pointers everywhere
2015-08-18 20:29:16 +02:00
goldsimon
2a6f31a84e
fix that LWIP_MULTICAST_TX_OPTIONS must be used in ip4_route instead of LWIP_IGMP
2015-08-18 16:35:06 +02:00
goldsimon
bc4473b275
Fixed that netconn_thread_cleanup() did not call LWIP_NETCONN_THREAD_SEM_FREE() (!= vs ==)
2015-08-18 11:13:38 +02:00
sg
6e5ff1dbe8
Enable LWIP_HAVE_LOOPIF by default when LWIP_NETIF_LOOPBACK==1 to not make loopback traffic depend on the only netif's link state
2015-08-05 22:56:10 +02:00
sg
4edade8079
allow multicast socket options IP_MULTICAST_TTL, IP_MULTICAST_IF and IP_MULTICAST_LOOP to be used without IGMP
2015-08-05 22:52:23 +02:00
sg
9352988c44
Tried to improve pbuf_type, LWIP_SUPPORT_CUSTOM_PBUF and PBUF_FLAG_IS_CUSTOM documentation
2015-08-05 22:26:57 +02:00
sg
e5e0a21fc6
LWIP_COMPAT_SOCKETS==2: special setting to help code parsers/code completion to show argument names/types for posix socket functions
2015-08-05 21:41:50 +02:00
Edgar Bonet
fb456e00ac
Fix documentation of TCP_WRITE_FLAG_MORE.
...
The description of the flag was erroneous in src/core/tcp_out.c, and
self-contradictory in doc/rawapi.txt.
2015-08-05 21:20:34 +02:00
sg
76e785dd5e
Fix that pbuf_realloc() called mem_trim() for "custom" PBUF_RAM
2015-08-05 20:40:35 +02:00
Erik Ekman
145efb1a33
Fix edge case in pbuf_take_at()
...
Writes to offsets pointing to the start of a pbuf in the chain
did nothing and just returned ERR_OK.
Added unit tests to verify the fix, and also
that pbuf_get_at()/pbuf_put_at() handles this case.
2015-08-03 20:34:08 +02:00
goldsimon
22d2af2a29
we are moving towards 1.5.0 -> set LWIP_VERSION accordingly
2015-08-03 13:58:48 +02:00
goldsimon
13801ebd74
netif_find(): name parameter can be const
2015-08-03 13:47:25 +02:00
goldsimon
614fa7b853
... and one more change to those nasty ~ operator warnings :-(
2015-08-03 11:12:53 +02:00
goldsimon
4b815eece9
added lwip_socket_thread_init/cleanup to use LWIP_NETCONN_SEM_PER_THREAD/LWIP_NETCONN_FULLDUPLEX without including anything but sockets.h
2015-08-03 10:15:29 +02:00
goldsimon
11f350e63f
Fixed ~ warnings in a different way
2015-08-03 09:10:49 +02:00
goldsimon
4dc3c7a6a0
Fixed warnings about NULL check not required (ip_addr_isany) and implicit conversion (~)
2015-08-03 08:35:01 +02:00
goldsimon
d106053e4c
Removed accidentally committed // comment
2015-08-03 08:27:33 +02:00
goldsimon
5315751dc9
init.c: fixed window scaling range check
2015-08-03 08:24:36 +02:00
Erik Ekman
e448a9a4a9
err, debug: add missing ERR_ALREADY to lwip_strerr()
...
When ERR_ALREADY was added other error codes were renumbered.
The strerr function was not updated so it returned incorrect data
for ERR_CONN - ERR_IF.
2015-07-27 00:49:18 +02:00
Joel Cunningham
5b0d9338fd
netif, loopif: set link up on loopback interface
...
When LWIP_HAVE_LOOPIF is enabled, a separate loopback interface is added
as a netif. A netif need to have its link state set to up to be able to be
selected as a route in ip4_route or ip6_route.
The regression appears to be when bug #43904 (ip_route() and ip6_route()
must detect linkup status) was fixed.
Furthermore, there is no point of having the loopif down by default.
2015-07-27 00:22:30 +02:00
sg
409d7a99f9
Minor coding style fix
2015-07-14 22:17:49 +02:00
Joel Cunningham
f77e581468
Fix netbuf_destport() when LWIP_CHECKSUM_ON_COPY is not enabled
...
This commit fixes a bug in netbuf_destport() where LWIP_NETBUF_RECVINFO is
enabled, but not LWIP_CHECKSUM_ON_COPY is enabled
The flags field is only available when LWIP_CHECKSUM_ON_COPY is enabled. In
this mode, the toport_chksum is dual functioning as storage for port and
checksum
2015-07-14 22:17:06 +02:00
goldsimon
d3217718a9
Reverted fix for bug #38203 since it might be wrong
2015-06-23 09:20:06 +02:00
Stian Skjelstad
7e76480db4
udp: multicast, fix udp_set_multicast_ttl() parameter and structure member conflict
...
Macro-parameter name can not be the same as the structure member to
dereference.
2015-06-16 12:00:00 +02:00
tabascoeye
7856141fc4
icmp: fix checksum on replies of echo request with ID 0, sequence 0 and either no data or any amount of 0x00 Bytes as data ( closes : #45322 )
...
When a client sends an ICMP echo request with ID 0, sequence 0 and
either no data or any amount of 0x00 bytes as data, the checksum in the
reply is wrong (off-by-one).
Expected checksum is 0xffff in that case, observed is 0x0000.
2015-06-15 15:53:14 +02:00
goldsimon
232cf8c28b
Fixed bug #45098 ip_addr_t type field not populated for socket address copies (patch by James Smith)
2015-05-21 15:51:47 +02:00
goldsimon
b51805b87e
fixed bug #45135 getsockopt SO_SNDTIMEO, SO_RCVTIMEO broken
2015-05-21 15:47:21 +02:00
goldsimon
392ef77bc5
Fixed bug #45161 tcp.c / tcp_abandon / pcb->local_port set to zero but needed later for tcp_rst (introduced some months ago when fixing bug #42299 )
2015-05-21 15:45:09 +02:00
goldsimon
de83c3e9e0
fixed bugs #45140 and #45141 (dhcp was not stopped correctly after fixing bug #38204 )
2015-05-19 10:56:08 +02:00
goldsimon
050d233e10
changed dhcp state name defines to include "STATE_" to prevent confusion with message types (e.g. INFORMING vs. INFORM)
2015-05-19 10:32:14 +02:00
Sylvain Rochet
8c1f834a4a
fixed bug #39683 Assertion "seg->tcphdr not aligned" failed with MEM_ALIGNMENT 1 or 2
...
We used a static 4 instead of MEM_ALIGNMENT earlier, however it broke
things for MEM_ALIGNMENT 1 or 2, fixed using a LWIP_MIN(MEM_ALIGNMENT,
4) statement.
2015-05-11 11:21:08 +02:00
Ivan Delamer
cbeb5ab960
Remove 6LowPAN flag that will not be used.
2015-05-05 14:43:58 -06:00
Ivan Delamer
33a51a1bdc
Improved IPv6 address formatting in ip6addr_ntoa_r().
2015-05-05 14:01:38 -06:00
Ivan Delamer
73660f779b
changes to ip6addr_aton() to avoid crash with some ill-formatted
...
strings.
2015-05-05 13:26:17 -06:00
Ivan Delamer
2c79332de7
Only send RS messages if we have a LL address in some state other than
...
invalid.
2015-05-05 13:05:41 -06:00
Ivan Delamer
2aec025e16
Bug fix: properly use unspecified source address for router solicitation
...
if needed.
2015-05-05 13:00:17 -06:00
Ivan Delamer
24f486261a
Small bug fix in ipaddr_ntoa_r when IPv4 and IPv6 are enabled.
2015-05-05 11:57:23 -06:00
Edgar Bonet
f0c4944e2c
sockets: do not assume defined(FD_SET) implies defined(FD_SET_VAL).
2015-05-05 14:08:42 +02:00
Edgar Bonet
cf15872b8d
SNMP, Missing const qualifier on internet_nodes[] in mib2.c.
2015-05-05 13:02:30 +02:00
Sylvain Rochet
78e1b9b7c1
PPP, don't store the name by which the peer authenticated itself to us if multilink support is disabled
...
pcb->peer_authname is only used by multilink support (which we don't
support), don't store the useless peer authname.
2015-05-01 22:51:09 +02:00
Sylvain Rochet
967a8d0678
PPP, opt.h: fixed coding style
2015-05-01 01:01:42 +02:00
Sylvain Rochet
fa44cef27b
PPP, L2TP, added configurable L2TP MRU using opt.h
2015-05-01 00:49:19 +02:00
Sylvain Rochet
29ba3df717
PPP, re-enabled MRU defines in opt.h
2015-05-01 00:08:34 +02:00
Sylvain Rochet
aacc222b7d
PPP, display MTU set through netif_set_mtu() if debug is enabled
2015-04-30 23:41:47 +02:00
Sylvain Rochet
341f0bf9e3
PPP, assert if ppp_fatal() is called
2015-04-30 13:48:08 +02:00
Sylvain Rochet
091c6a3bda
PPP, cleanup unused/redefined/useless limits in ppp_impl.h
2015-04-30 01:07:11 +02:00
Sylvain Rochet
fd53cad208
PPP, sifnpmode() is only useful if on demand is supported, build out if not
...
We don't support PPP on demand, don't build sifnpmode() which is only
useful for on demand if on demand is not supported.
2015-04-30 00:06:24 +02:00
Sylvain Rochet
1b6d6d0dc0
PPP, removed unnecessary memset()
...
Everything is cleared in ppp_clear(), we don't need to clear all
structures twice.
2015-04-29 23:55:23 +02:00
Sylvain Rochet
40c671b1a5
PPP, PPPoS, also clear last_xmit when resetting PPPoS control block
2015-04-29 23:41:23 +02:00
Sylvain Rochet
0a8b1c199d
PPP, added missing cast on pbuf_header()
2015-04-26 23:42:18 +02:00
Sylvain Rochet
3a3c823ddb
PPP, MPPE, try to use pbuf_header() in mppe_compress()
...
If there is enough space in front of the buffer, use it instead of
allocating a new pbuf.
2015-04-26 23:27:31 +02:00
Sylvain Rochet
900f3c9a09
PPP, MPPE, don't issue CCP reset request in stateless mode
...
This is useless, flushed bit is always true in stateless mode, we
don't need to issue a CCP reset request in this case.
2015-04-26 22:13:11 +02:00
Sylvain Rochet
8fe2f747f4
PPP, MPPE, issue CCP reset request if synchronization is lost
...
If MPPE synchronization is lost, it is advised to send a CCP reset
request in order to recover to a clean state.
2015-04-26 22:04:21 +02:00
Sylvain Rochet
adaeff5540
PPP, MPPE, discard late packet in stateless mode
...
When PPP is used over a link which does not guarantee packet ordering,
we might get late MPPE packets. This is a problem because MPPE must be
kept synchronized and the current implementation does not drop them and
rekey 4095 times instead of 0, which is wrong.
In order to prevent rekeying about a whole count space times (~ 4095
times), drop packets which are not within the forward 4096/2 window and
increase sanity error counter.
2015-04-26 20:59:09 +02:00
Sylvain Rochet
d0f91c00cb
PPP, MPPE, sanity error path rework
...
We are going to need sanity error path a little further, rework to be
able to use the sanity error path anywhere in decompressor.
2015-04-26 20:57:01 +02:00
sg
e20a071977
added functions dhcp/autoip_supplied_address() to check for the source of address assignemnt (replacement for NETIF_FLAG_DHCP)
2015-04-24 21:23:15 +02:00
Sylvain Rochet
737a6921c3
PPP, place print packet debug codenames in ROM
2015-04-24 00:13:25 +02:00
Sylvain Rochet
44af6978db
netconn: api_msg.c, fixed warning about unused state variable by using it a little more
2015-04-23 23:31:41 +02:00
Sylvain Rochet
acbdf63a48
debug.h: fixed LWIP_PLATFORM_ERROR macro if LWIP_DEBUG and LWIP_NOASSERT are defined
2015-04-23 23:07:06 +02:00
goldsimon
e59beeb625
fixed "missing braces around initializer" for IN6ADDR_*_INIT macros
2015-04-23 10:08:30 +02:00
goldsimon
f01dc8cc34
more "const" fixes
2015-04-23 09:59:15 +02:00
goldsimon
89f0e45b50
fixed ip_addr_islinklocal macro definition
2015-04-23 09:35:20 +02:00
goldsimon
3f83556128
sockets: IPPROTO_RAW/IPV6_CHECKSUM must be disabled for LWIP_RAW==0;
...
help msvc to not warn about uninitialized variables
2015-04-23 09:14:42 +02:00
goldsimon
1cdafabc7c
added missing braces around macro parameters
2015-04-23 09:04:45 +02:00
goldsimon
f9965b4967
some more compiler warning fixes
2015-04-23 08:44:44 +02:00
goldsimon
0de0942f9c
fixed pppol2tp (IP_IS_V6_L -> IP_IS_V6_VAL)
2015-04-23 07:46:06 +02:00
goldsimon
00a46f104a
changed IP_IS_V6_VAL() to take an instance, not a pointer (to get the _val() functions the same)
2015-04-23 07:26:29 +02:00
goldsimon
009755ba01
fixed broken ip6_addr_debug_print_parts() (broken yesterday)
2015-04-23 07:25:48 +02:00
goldsimon
53a96f69ef
ppp_free: fixed type of local 'err'
2015-04-23 07:25:10 +02:00
goldsimon
e60bc69515
added more missing casts
2015-04-23 07:24:45 +02:00