Commit Graph

1057 Commits

Author SHA1 Message Date
goldsimon
fa16ee8dcb cleaned up includes a bit after IPv6 changes 2016-02-29 09:27:59 +01:00
Dirk Ziegelmeier
2dc8f59bf4 Fix compile when PPPOE is enabled 2016-02-26 22:50:44 +01:00
sg
a649a3eb50 dual-stack fix: moved common definitions/code for ethernet used by etharp and ethip6 to new files ethernet.h/.c 2016-02-25 22:10:28 +01:00
Dirk Ziegelmeier
953b7bdd59 Implement UDP dual-stack PCB support
Create special IP address type "IPADDR_TYPE_ANY" for it.
SNMP uses new feature in non-netconn mode.

TODO: Same for TCP & RAW, adapt NETCONN to use this feature
2016-02-24 22:37:01 +01:00
Dirk Ziegelmeier
fd4a109ffa lowpan6.c: Implement SNMP counters 2016-02-23 13:01:46 +01:00
Dirk Ziegelmeier
d121ea84d0 Add note about 6LoWPAN in src/netif/FILES 2016-02-23 11:46:28 +01:00
goldsimon
a5ac41c203 lowpan6: fixed compiler warning when casting u16_t to u8_t 2016-02-23 11:28:54 +01:00
goldsimon
e4457335b8 minor: tried to fix coding style in lowpan6.c 2016-02-23 10:36:16 +01:00
Dirk Ziegelmeier
799fe7a5ba Fix shadowing warning in lowpan6.c - found by Erik Ekman's Travis CI
https://travis-ci.org/yarrick/lwip-merged
2016-02-23 08:58:34 +01:00
Dirk Ziegelmeier
fe8d2ba72f Eliminate tcpip_pppos_input function 2016-02-22 21:00:00 +01:00
Dirk Ziegelmeier
e2a3565971 Initial import of Ivan Delamer's 6LoWPAN implementation with slight modifications to allow compiling in IPv6 only mode 2016-02-22 20:44:32 +01:00
Dirk Ziegelmeier
aeab047ede slipif: Fix compile when only IPv6 is enabled 2016-02-22 20:43:32 +01:00
Dirk Ziegelmeier
17fad79f71 Two compile fixes after eliminating isipv6 member in PCBs 2016-02-22 17:07:17 +01:00
Dirk Ziegelmeier
f104d68569 PPP: Init SNMP members of PPP netifs 2016-02-19 23:51:18 +01:00
Dirk Ziegelmeier
cddd3b552a etharp.c: Make MAX_AGE of an ARP entry configurable 2016-02-11 09:38:17 +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
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
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
9f3270afaf PPP: fix typo in debug message
Signed-off-by: Stephan Linz <linz@li-pro.net>
2016-01-18 21:33:17 +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
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
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
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
goldsimon
b401f42520 minor: fixed coding style (lwip style) 2015-10-07 10:03:12 +02:00
sg
2b971400fa minor: coding style 2015-10-06 21:57:40 +02:00
sg
22df34fc70 minor/coding style: removed spaces before line ending (from file header) 2015-10-06 21:13:15 +02:00
sg
490581a0eb minor/coding style: removed spaces before line ending 2015-10-06 21:08:28 +02:00
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
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
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
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
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
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
Dirk Ziegelmeier
f62022cdf3 Compiler warning fixes (mostly constness in dual-stack configurations) 2015-09-17 13:59:52 +02:00
chrysn
b85b554db1 PPP, FSM, don't call memcpy with NULL even when size = 0 2015-09-16 16:03:15 +02:00