Commit Graph

4564 Commits

Author SHA1 Message Date
Dirk Ziegelmeier
475d49440c Fix handling of LWIP_HOOK_VLAN_SET(). Previous implementation supplied uninitialized arguments to the macro (struct eth_hdr).
Change macro signature to be universal: netif, pbuf, src, dst, eth_type - whatever the user needs to decide about VLAN header.
Return value <0 means "no VLAN header", 0 <= return_value <= 0xFFFF -> value is prio_vid of header.
Clean up ethernet_output function to be more readable.
2016-08-25 14:07:35 +02:00
Axel Lin
a2ca85a260 tcp: Make tcp_state_str/tcp_backoff/tcp_persist_backoff static
They are only referenced in tcp.c, so make them static.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: goldsimon <goldsimon@gmx.de>
2016-08-25 11:20:10 +02:00
sg
4c390ad39c update netif address change triggers to tpc & udp to work with IPv6, too 2016-08-24 20:51:05 +02:00
Erik Ekman
a1db05c11e Fix const argument warning in netif_ip6_addr_set
../../../../../lwip/src/netif/ppp/ppp.c:1276:37: error: passing
      'const ip6_addr_t *' (aka 'const struct ip6_addr *') to parameter of type
      'ip6_addr_t *' (aka 'struct ip6_addr *') discards qualifiers
      [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
  netif_ip6_addr_set(pcb->netif, 0, IP6_ADDR_ANY6);
                                    ^~~~~~~~~~~~~
../../../../../lwip/src/include/lwip/ip_addr.h:340:24: note: expanded from macro
      'IP6_ADDR_ANY6'
                       ^~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../lwip/src/include/lwip/netif.h:436:73: note: passing argument to
      parameter 'addr6' here
void netif_ip6_addr_set(struct netif *netif, s8_t addr_idx, ip6_addr_t *addr6);
2016-08-24 14:41:48 +02:00
Axel Lin
bf5866b27d tcp: Prevents a 0 sized (invalid) backlog
commit 44e1a2d8e2 accidently includes below changes in tcp_listen_with_backlog
 -  tcp_backlog_set(lpcb, backlog);
 +  lpcb->backlog = backlog;

Thus pass 0 to the backlog parameter of netconn_listen_with_backlog() fails.

Fixes: 44e1a2d8e2 ("define tcp_backlog_set() as dummy-define when backlog feature is disable")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: goldsimon <goldsimon@gmx.de>
2016-08-24 12:20:28 +02:00
goldsimon
298ec340e5 set netif IPv6 address & state via function to implement change triggers (task #13517) 2016-08-24 09:19:53 +02:00
goldsimon
1ba0e17157 ip6_addr: a valid address is either preferred or deprecated, no need to reserve 3 bits for that 2016-08-24 09:06:48 +02:00
Dirk Ziegelmeier
43ddf6eee6 Fix debug strings in ethernet_output 2016-08-24 08:46:32 +02:00
Dirk Ziegelmeier
8426dfa14d Remove misleading comments from udp_send() and raw_send(). A pbuf may be added automatically in front of the chain to be able to send PBUF_REFs 2016-08-24 08:45:37 +02:00
Dirk Ziegelmeier
6fc7f84497 Minor: documentation updates 2016-08-24 08:19:51 +02:00
Dirk Ziegelmeier
831b7fc7d3 Add note to pbuf_type about correct TX/RX type selection 2016-08-24 08:09:03 +02:00
Dirk Ziegelmeier
d9b0236525 Fix MDNS did not allocate TX packets from RAM but from POOL 2016-08-24 08:04:04 +02:00
Dirk Ziegelmeier
e78bc41116 Document ethernet level functions 2016-08-24 08:01:36 +02:00
Dirk Ziegelmeier
c719c466b3 Remove SIZEOF_ETHARP_PACKET_TX #define, it is not needed any more after my last cleanups 2016-08-23 20:41:37 +02:00
Dirk Ziegelmeier
31778193da Work on bug #48868: Cleanup etharp.c not to use struct eth_hdr: Cleanup etharp_input() to use ethernet_output() 2016-08-23 17:23:21 +02:00
Dirk Ziegelmeier
6caa7b9927 Cleanup etharp_arp_input() signature to match the sig of other input functions (pbuf, netif). Rename to etharp_input() 2016-08-23 17:03:51 +02:00
Dirk Ziegelmeier
979bee386c Work on bug #48868: Cleanup etharp.c not to use struct eth_hdr: Cleanup etharp_raw() to use ethernet_output() 2016-08-23 16:58:17 +02:00
Dirk Ziegelmeier
d2f52e19d5 Fix doxygen comment in ethernet.c 2016-08-23 16:09:32 +02:00
Dirk Ziegelmeier
56dc574bed Fix comment in pbuf layer description 2016-08-23 16:07:48 +02:00
goldsimon
e4c74109cd fixed bug #47652: there is always a delay to send the first Neighbor Solicitation for the new add INCOMPLETE state neighbor entry 2016-08-23 15:50:48 +02:00
goldsimon
fd5b34ae43 ip4_forward(): fixed compiling IP_FORWARD_ALLOW_TX_ON_RX_NETIF==1 2016-08-23 15:26:05 +02:00
goldsimon
306171c93b DHCP: fixed compiling LWIP_DHCP_BOOTP_FILE==1 2016-08-23 15:25:39 +02:00
goldsimon
d99d91dae9 removed ETHARP_TRUST_IP_MAC since it is insecure and we don't need it any more after implementing unicast ARP renewal towards arp entry timeout 2016-08-23 13:00:15 +02:00
Dirk Ziegelmeier
fc54556d80 Code beautification in LWIP_HOOK_UNKNOWN_ETH_PROTOCOL usage 2016-08-23 12:55:21 +02:00
Dirk Ziegelmeier
0d5eea288c Clarify LWIP_HOOK_UNKNOWN_ETH_PROTOCOL in opt.h 2016-08-23 12:54:29 +02:00
Dirk Ziegelmeier
4456c7d230 Fix regression in etharp.c: Allocate correct pbuf layer 2016-08-23 12:32:57 +02:00
Dirk Ziegelmeier
f170dde1c6 Work on bug #48824: ethernet.c extensions: Implement hook for unknown ethernet protocols 2016-08-23 10:48:38 +02:00
Dirk Ziegelmeier
bae4d6398c Fix some comments to reference ethernet_output now 2016-08-23 10:23:59 +02:00
Dirk Ziegelmeier
18136c047b Work on bug #48824: ethernet.c extensions: Implement ethernet_output();
Fixes bug #48862: ethip6 does not support setting vlan
2016-08-23 10:15:03 +02:00
Dirk Ziegelmeier
d9eaf6f310 docs: Remove link to example ports again, this should rather go to lwIP wiki... 2016-08-23 09:34:44 +02:00
Axel Lin
42c193821c netbuf: Use memset to zero the allocated memory for netbuf_new
Use memset to zero the allocated memory rather than explicitly init each field.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: goldsimon <goldsimon@gmx.de>
2016-08-23 08:59:11 +02:00
Axel Lin
1c5c96a50a pbuf: Use SYS_ARCH_INC in pbuf_ref()
Use SYS_ARCH_INC to simplify the code.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: goldsimon <goldsimon@gmx.de>
2016-08-23 08:59:10 +02:00
Axel Lin
40f2bed5c4 mem: Simplify the code for try bigger pool in mem_malloc
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: sg <goldsimon@gmx.de>
2016-08-20 11:29:57 +02:00
Dirk Ziegelmeier
21c99b6ebb Add documentation page about example lwIP ports. Start with FreeRTOS from Pavel Pisa. 2016-08-20 09:23:29 +02:00
Axel Lin
a032ccafe7 mem: Fix trivial comment typo about using custom pools
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2016-08-20 09:17:37 +02:00
goldsimon
4f4d16260f minor: fixed typo 2016-08-19 15:40:36 +02:00
goldsimon
6b1e1af3d1 combine MAC filter actions for IGMP and MLD6 (IGMP has compatibility defines for old code, MLD6 filter functions must be adapted) 2016-08-19 13:54:14 +02:00
Axel Lin
b3bae1b44c memp: Fix unused variable build error when MEMP_SANITY_REGION_BEFORE/AFTER is 0
MEMP_SANITY_REGION_BEFORE and MEMP_SANITY_REGION_AFTER can be overridden in
lwipopts.h, if one of it is set to 0 we got build error due to unused variable.

Fix unused variable build error when MEMP_OVERFLOW_CHECK >= 1 &&
(MEMP_SANITY_REGION_BEFORE == 0 || MEMP_SANITY_REGION_AFTER == 0).

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: goldsimon <goldsimon@gmx.de>
2016-08-19 13:47:37 +02:00
Dirk Ziegelmeier
730080f20e Fix doxygen comment in lwip/prot/igmp.h 2016-08-19 13:15:23 +02:00
goldsimon
a189941da6 make igmp/mld6 filter actions an enum and define them in netif.h where the callback function prototypes are defined 2016-08-19 13:10:57 +02:00
Dirk Ziegelmeier
f93a6e3310 Rename lwip/prot/arp.h to lwip/prot/etharp.h for consistence 2016-08-19 13:09:58 +02:00
Dirk Ziegelmeier
5e36815867 init.c: Implement check for correct implementation of struct packing in lwip port 2016-08-19 13:05:51 +02:00
Dirk Ziegelmeier
01d8e5013f Add missing include in prot/igmp.h 2016-08-19 13:02:17 +02:00
Dirk Ziegelmeier
6688033bc4 Move IGMP protocol struct to prot/igmp.h 2016-08-19 12:50:41 +02:00
goldsimon
ed566cceaa minor cleaup in (eth)arp 2016-08-19 12:49:02 +02:00
goldsimon
55d05092ef simplify memp.c code a bit 2016-08-19 12:25:48 +02:00
Axel Lin
0e9ef19cfb memp: Remove memp_overflow_init() function
There is only one caller using memp_overflow_init(), and at that context
calling memp_overflow_init_element() actually simplifes the code.
Thus remove memp_overflow_init() function.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: goldsimon <goldsimon@gmx.de>
2016-08-19 12:25:47 +02:00
Dirk Ziegelmeier
fefb782bfe Apply fix by Marco Veeneman in SNMPv3: The outbound_padding is calculated wrong in snmp_complete_outbound_frame() 2016-08-19 12:22:59 +02:00
Dirk Ziegelmeier
12609c951c Fix compile of SNMPv3 code with MSVC 2016-08-19 12:22:58 +02:00
Axel Lin
64f79e7ffc PPP, PPPoE: Include netif/ethernet.h to fix build error
Fix below build errors:
In file included from ../../../../../lwip/src/include/netif/ppp/ppp_opts.h:31:0,
                 from ../../../../../lwip/src/netif/ppp/pppoe.c:71:
../../../../../lwip/src/netif/ppp/pppoe.c: In function ‘pppoe_timeout’:
../../../../../lwip/src/netif/ppp/pppoe.c:861:30: error: ‘ethbroadcast’ undeclared (first use in this function)
         MEMCPY(&sc->sc_dest, ethbroadcast.addr, sizeof(sc->sc_dest));
                              ^
../../../../../lwip/src/include/lwip/opt.h:137:52: note: in definition of macro ‘MEMCPY’
 #define MEMCPY(dst,src,len)             memcpy(dst,src,len)
                                                    ^
../../../../../lwip/src/netif/ppp/pppoe.c:861:30: note: each undeclared identifier is reported only once for each function it appears in
         MEMCPY(&sc->sc_dest, ethbroadcast.addr, sizeof(sc->sc_dest));
                              ^
../../../../../lwip/src/include/lwip/opt.h:137:52: note: in definition of macro ‘MEMCPY’
 #define MEMCPY(dst,src,len)             memcpy(dst,src,len)
                                                    ^
../../../../../lwip/src/netif/ppp/pppoe.c: In function ‘pppoe_connect’:
../../../../../lwip/src/netif/ppp/pppoe.c:899:24: error: ‘ethbroadcast’ undeclared (first use in this function)
   MEMCPY(&sc->sc_dest, ethbroadcast.addr, sizeof(sc->sc_dest));
                        ^
../../../../../lwip/src/include/lwip/opt.h:137:52: note: in definition of macro ‘MEMCPY’
 #define MEMCPY(dst,src,len)             memcpy(dst,src,len)
                                                    ^
../../Common.mk:94: recipe for target 'pppoe.o' failed
make: *** [pppoe.o] Error 1

Fixes: 8eb9db18a2 ("Reduce usage of netif/ethernet.h header, mostly lwip/prot/ethernet.h is sufficient")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: goldsimon <goldsimon@gmx.de>
2016-08-19 12:12:57 +02:00