Commit Graph

2703 Commits

Author SHA1 Message Date
Simon Goldschmidt
752cdb1a53 udp: fix udp_bind for IPADDR_TYPE_ANY
See bug #55171

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2019-02-26 14:48:44 +01:00
Solganik Alexander
b1d3dcb8d7 tcp: don't reset dupack count upon non-empty packet receive
According to rfc5681:

https://tools.ietf.org/html/rfc5681

Paragraph 3.2.  Fast Retransmit/Fast Recovery
The TCP sender SHOULD use the "fast retransmit" algorithm to detect
and repair loss, based on incoming duplicate ACKs.  The fast
retransmit algorithm uses the arrival of 3 duplicate ACKs (as defined
in section 2, without any intervening ACKs which move SND.UNA) as an
indication that a segment has been lost.  After receiving 3 duplicate
ACKs, TCP performs a retransmission of what appears to be the missing
segment, without waiting for the retransmission timer to expire.

Now consider the following scenario:
Server sends packets to client P0, P1, P2 .. PK.
Client sends packets to server P`0 P`1 ... P`k.

I.e. it is a pipelined conversation. Now lets assume that P1 is lost, Client will
send an empty "duplicate" ack upon receive of P2, P3... In addition client will
also send a new packet with "Client Data", P`0 P`1 .. e.t.c. according to sever receive
window and client congestion window.

Current implementation resets "duplicate" ack count upon receive of packets from client
that holds new data. This in turn prevents server from fast recovery upon 3-duplicate acks
receive.
This is not required as in this case "sender unacknowledged window" is not moving.

Signed-off-by: Solganik Alexander <sashas@lightbitslabs.com>
2019-01-30 21:13:22 +01:00
David J. Fiddes
8f2f43f093 Implement RFC4075 Receive SNTP servers via DHCPv6
This adds support for RFC4075 SNTP server configuration via DHCPv6.
The DHCPv6 options transmitted are now conditional on how LwIP is
configured.

A new SNTP application option SNTP_GET_SERVERS_FROM_DHCPV6 is used
to enable. For simplicity this is configured to use the global
LWIP_DHCP6_GET_NTP_SRV configuration setting.

Tests:
 - Check the global options now control the DHCPv6 request sent
   in Wireshark
 - Check against 0, 1 and 3 SNTP servers configured on an odhcpd
   server configured to support RFC 4075 SNTP server lists.
   Verify that the SNTP server list is updated on connection
   establishment on an ESP8266 WeMOS D1.
 - Verify that SNTP packets are sent and recieved from a
   configured server and that system time is updated.

Signed-off-by: David J. Fiddes <D.J@fiddes.net>
2019-01-30 17:49:18 +01:00
David Girault
b04d8a6a6c altcp: support for setting keepalive parameters 2019-01-30 17:42:46 +01:00
Simon Goldschmidt
ed561a578b tcp: improve debug message a little 2019-01-30 14:27:16 +01:00
Dirk Ziegelmeier
4c19a909c2 Fix bug #55537: Crash in SYN_SENT state when TCP_INPUT_DEBUG logs are ON 2019-01-28 14:21:34 +01:00
Dirk Ziegelmeier
941300c21c Apply patch #9737: Fix DHCPv6 DNS server assignment 2019-01-28 14:19:15 +01:00
Dirk Ziegelmeier
8bf2e21b4d TCP/UDP documentation: Add reference to PCB mempool #defines 2019-01-28 13:47:03 +01:00
Dirk Ziegelmeier
ea14b774c8 Replace several occurences of stdint types by lwIPs portability typedefs
Fixes bug #55405: Usage of uint8_t instead of ui8_t in TCP code
2019-01-06 21:19:04 +01:00
Dirk Ziegelmeier
d504e27142 dhcp.c: Fix typo in debug message 2019-01-04 11:08:46 +01:00
Dirk Ziegelmeier
2ff0db9a9b Fix bug #55171: Binding UDP PCB with different IP type PCBs does not work
by additionally checking IP address type
2018-12-06 14:40:57 +01:00
Jasper Verschueren
75f33081c2 DEF: added lwip_strnistr() for case insensitive matching 2018-12-05 19:59:45 +01:00
Simon Goldschmidt
dcb29c591f nd6: fix copying more than one DNS server
See bug #55163
2018-12-05 19:56:48 +01:00
Craig McQueen
ef76bbe3f0 DNS: Allow a DNS look-up with a trailing dot in the name
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-11-22 13:14:41 +01:00
Simon Goldschmidt
1a10a942f2 tcp_recved: fix overflow check
Improved fix instead of patch #9699.

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
(cherry picked from commit 98d1cb1c00)
2018-11-12 21:01:47 +01:00
Simon Goldschmidt
18b91b2841 Revert "tcp_recved: check for overflow and warn about too big values"
This reverts commit 684adaca29.

It changes the behaviour to assert for applications running good so far.

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-11-12 21:01:05 +01:00
Simon Goldschmidt
3c17c1e82e fix typo in comment 2018-11-01 21:42:09 +01:00
Dirk Ziegelmeier
7c2267b966 Fix bug #54670: 127.0.0.1 sent out to netif_default? 2018-11-01 21:36:24 +01:00
Dirk Ziegelmeier
0c34597b9e netif: Add getter for loopif for unit tests 2018-11-01 21:35:06 +01:00
Dirk Ziegelmeier
26a84d9307 Minor: add parenthesis for cleaner code 2018-10-28 21:08:24 +01:00
Florent Matignon
ffbe075d56 bug #54700: Unexpected expiry of pending ARP table entry
New etharp queries should restart the 5 second timeout on the ARP
table entry if it is still pending.

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-10-26 20:59:10 +02:00
Simon Goldschmidt
a352f4e11c Explicitly check for TCP_MSS to be <= ~16 kByte
See bug #54890

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-10-26 19:43:13 +02:00
Dirk Ziegelmeier
06cc825431 Whitespace cleanup lwIP 2018-10-22 20:53:58 +02:00
Dirk Ziegelmeier
95aba99f41 Implement task #11620: Add outgoing VLAN PCP support for Ethernet level QoS
Apply rebased patch from Timmy Brolin
2018-10-19 22:30:17 +02:00
Dirk Ziegelmeier
64bc2c3df7 Fix bug #54805: IP address can not be obtained over dhcp if PBUF_POOL_BUFSIZE is too small
Patch by Christoph Chang
2018-10-19 21:06:15 +02:00
Simon Goldschmidt
426a6004bf Revert "tcp_abandon: no need to buffer pcb->local_port"
This reverts commit 1570dd8ad1.

Buffering pcb->local_port is needed because TCP_PCB_REMOVE_ACTIVE()
sets it to 0 via tcp_pcb_remove() (comment: "reset the local port
to prevent the pcb from being 'bound'").

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-10-12 22:14:23 +02:00
Simon Goldschmidt
e3cd915fb9 Fix whitespace error introduced when merging 684adaca
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-10-12 21:18:17 +02:00
Simon Goldschmidt
0d4e1beec4 Fix compiling ACD without LWIP_RAND
Copy bad rand implementation from old one in autoip.c

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-10-12 21:05:19 +02:00
Jonas Rabenstein
684adaca29 tcp_recved: check for overflow and warn about too big values 2018-10-11 07:31:54 +02:00
Dirk Ziegelmeier
ff44049baf Rename DHCP_DOES_ACD_CHECK ->LWIP_DHCP_DOES_ACD_CHECK 2018-10-05 11:04:48 +02:00
Dirk Ziegelmeier
a3cdf3c4cc Move two #defines from acd.h to acd.c since they are only useful in there 2018-10-05 10:58:30 +02:00
Dirk Ziegelmeier
015cff75fd Fix "switch missing default case" in dhcp.c 2018-10-05 10:49:21 +02:00
Dirk Ziegelmeier
d4c8b3e7e8 Apply patch #9694: Update prev pointer when skipping entries in tcp_slowtmr to prevent hitting assertion 2018-10-04 17:38:17 +02:00
Dirk Ziegelmeier
f8ed17082d A few ACD compile and doc fixes 2018-10-04 17:34:44 +02:00
Jasper Verschueren
7d1c26cc0c ACD module added + update and improve DHCP + AUTOIP behavior
Squashed commit of the following:

commit 2d98d8e2ef1941c3824ffb874f1e529d284667fc
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Thu Sep 13 16:15:06 2018 +0200

    AUTOIP: correct functionality autoip_supplied_address

    It does not mean that if autoip is bound, it also supplied the
    netif address. A check is added.

commit 2ca0a2183991ef73860c4207d95799b37acc64cc
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Thu Sep 13 16:06:49 2018 +0200

    AUTOIP: keep using the same link local address as much as possible

    Only calculate a new link local address at start up or when a
    conflict occured. On link up or down -> keep same address.

    TODO: in the future a function for persistent storage should be
    added.

commit aa70a693351e4c898aa28d8521308794614838f1
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Thu Sep 13 14:43:14 2018 +0200

    ACD, AUTOIP & DHCP: make link up & down functions where needed

    When the link goes down or up the approriate functions should be
    stopped or started again. To accomodate this, network_changed is
    adjusted to network_changed_link_up and network_changed_link_down.
    DHCP does not need to control AUTOIP. AUTOIP can take care of
    itself. The only thing DHCP needs to do is starting it when
    discovering is failing. The AUTOIP state variable is removed from
    DHCP.

commit ad469eb006b47f8a8c37f7c0de0216f47a8c19c7
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Thu Sep 13 11:25:58 2018 +0200

    ACD: add address change listener + passive conflict detection mode

    In the case their previously was a LL address on a netif that
    is now configured with a routable address, we want the LL
    address to be able to keep receiving packets.
    for as long as the LL address is available on the interface it
    should do ongoing conflict detection. But we cannot defend when
    the LL address is not the netif address any more.
    An address change listener is added to detect when an ACD module
    needs to go from active ongoing conflict detection to passive.
    When a conflict is detected autoip is stopped and will not be able
    to receive packets any more. Because we have a valid routable
    address on the netif, autoip is not restarted.

commit 07c4ec20cea78e2b4a6f5599569abaf075619c62
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Tue Sep 11 16:25:37 2018 +0200

    ACD: make module reusable within a netif

    DHCP and AUTOIP both have ACD running simultaniously. The ACD
    struct is added to the DHCP and AUTOIP structs. In the netif a list
    of ACD modules is kept to loop over if functions need to perform
    some action on all ACD modules (for example tmr function). With
    acd_add a module can be added to the list. ACD_FOREACH loops over
    the list similar to NETIF_FOREACH.

commit ee3b4585b7768f5353dd80190a2929bad45f7ff4
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Mon Sep 10 16:36:18 2018 +0200

    etharp & acd: add probe and announce functions to etharp.

    The new probe and announce functions are independent of
    netif->ip_addr. This means we can keep the LL address working
    while we start to probe for the newly received routable address.
    The netif->ip_addr does not need to be any for probing to work
    with this patch.

commit 7d3032bae8f1b8081368a807682388eb642729e0
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Mon Sep 3 13:35:51 2018 +0200

    autoip -> unused random function removed + small comment update

commit be749ba4eb26ddc69233c85d532dc035741275c5
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Fri Aug 31 16:37:36 2018 +0200

    ACD: update comment in header

commit 4491842991c90b3a58fa327f70aa42f04174546b
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Fri Aug 31 15:44:45 2018 +0200

    ACD: subscribe to link down messages to stop the acd process

    When the link goes down the acd process should be stopped
    independent of the acd client. Otherwise the acd will keep probing
    or announcing while their simply is no connection.

commit 71f668aa7583354e132c20b3b50ba2c86bf08738
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Fri Aug 31 13:59:44 2018 +0200

    DHCP coop autoip bug fix: wait after last discovery before starting autoip

    After the last dhcp discovery we need to give the dhcp server the
    time to respond. Currently the discovery message is send and autoip
    is started simultaniously. This is changed. Autoip will now be started
    after the next discovery timeout.

commit 0da16604ec079195533f2591f0d0f04bdf212a72
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Fri Aug 31 11:23:31 2018 +0200

    ACD: rate limit interval bug solved -> first decline then wait then restart.

    According the the ACD RFC we need to limit the rate of acquiring
    and probing addresses after MAX_CONFLICTS. It is important to first
    decline the address and stop the netif from using the address before
    the time is started. After this rate limit time, the address acquiring
    process can be started again.

    To make this possible we had to change the callback function and
    the location in the process were the rate limiting is done.

commit a89a0601a251acb14abe270116f38c6d25c2d7a9
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Thu Aug 30 17:27:10 2018 +0200

    DHCP: after a succesful dhcp_reboot, the address should be probed.

    Reboot means that the connection was gone for some amount of time.
    This is seen as a new connection for the ACD module so should be
    the address should be probed before use.

commit 853afb448ba35c6e2b35e8238c9c367c599dece7
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Thu Aug 30 17:19:12 2018 +0200

    DHCP_DOES_ARP_CHECK changed to DHCP_DOES_ACD_CHECK

    small update in opt.h to add the correct dependencies.

commit e28b4766bdef69e76f6170c470c93f5b251c579a
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Thu Aug 30 17:05:43 2018 +0200

    DHCP check code replaced by ACD module.

    when DHCP_DOES_ARP_CHECK is enabled, the ACD module will take care
    of address conflict detection. Via a call back function the DHCP
    state machine will continue and bind to an address if no conflicts
    are found.
    dhcp_arp_reply is obsolete because the ACD module replaces its
    function.

commit 52193a0f5d13e8786a4db2fff1f1a8f1367a4eba
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Mon Aug 27 16:05:22 2018 +0200

    Issue 2 + 3 from Comment #5, task #13508 solved

    Removed C++ comments and // ----... marks as requested.

commit 7faaf61275d67ccfb88ea7e26c249428c3088536
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Mon Aug 27 15:55:24 2018 +0200

    Issue 1 from Comment #5, task #13508 solved

    Comments added to clarify how arp messages are handled.

commit 9348aea22623b705759fd30b873f06a50a104d16
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Tue Jul 24 11:45:35 2018 +0200

    acd: add comment for callback function

commit 49fdd1177c05b74d49fa179564dcaa5e650adbcc
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Tue Jul 24 11:42:59 2018 +0200

    autoip: Add debugging output and complete comments

commit 591856b82c029687a657a1b1ccc674522e6f4be0
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Tue Jul 24 11:25:18 2018 +0200

    Removed autoip from timeouts.c

    We do not need a timer anymore. All timing is part of acd.

commit 3b3272fdd14015cfca0b3b6d149505b1cf0e36b6
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Tue Jul 24 11:22:32 2018 +0200

    autoip_network_changed -> first bring down the netif and then acd

    Make it do what it says in the comment

commit 77b0ccf96efd22774279c6f9b5bade18c5e42c59
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Tue Jul 24 11:21:23 2018 +0200

    Simplified the autoIP states + update autoip_start()

commit 96e0581d36857f8b70c4b4cce4fb323fd3dd51ab
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Tue Jul 24 11:10:48 2018 +0200

    Deleted unused variables, functions and defines from autoip module

    The functionality is now embedded in the acd module so can be
    removed from autoip.

commit 9296e2ebb4b51019aaccfc47e8b9f51b265d37cd
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Tue Jul 24 11:07:34 2018 +0200

    Bug fix acd -> rate limiting needs to be after MAX conflicts

    It was only after MAX conflicts + 1.

commit c55e16903c045d0ea84336b50eccbf24d3d097e9
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Mon Jul 23 17:52:45 2018 +0200

    Small intruduction to module added

commit d1498a37293bd9f97f6b938b48e5980ab0a01bd1
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Mon Jul 23 17:49:58 2018 +0200

    Copyright information added

    I based the copyright text on the other files. I'm not sure this
    is how its done. I kept Dominik in their because I copied quite
    some code from the autoip module.

commit 359a845ef5e73061832069f364b370634ee0b071
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Mon Jul 23 17:08:44 2018 +0200

    Fixing comments in acd.c

commit 100d72549d0ef44157143d031848a727f5dfbe69
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Mon Jul 23 15:43:40 2018 +0200

    Probe wait time and Probe interval time made random via lwip_rand

    According to the RFC a random amount of time needs to be waited
    before probing can be started also a random amount of time
    needs to be waited between the probes.
    The random time is calculated via the LWIP_RAND function (see
    lwipopts and sys_arch).

commit f7f037c32e9416f8b803c3c7af617b871b55ee35
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Tue Jul 17 16:56:48 2018 +0200

    autoip will start probing again when the network has changed

commit 1f40f6274195f24aa1b05caf82b79285ad189c2a
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Tue Jul 17 16:55:47 2018 +0200

    Duplicate code removed -> already present in autoip_start

commit be59431271da862a8ca330dbca638842c87765bc
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Tue Jul 17 16:52:49 2018 +0200

    add rate limiting to acd when too many conflicts are detected.

    When more then max conflicts are detected during device on time,
    the rate at which probing for a new address starts is limited.
    For clarity we combined the conflict counting and the callback into
    a new function acd_restart.

commit 91448455e95edb24c1f418c341b6fb306391f4f1
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Tue Jul 17 15:50:01 2018 +0200

    ARP packet conflict detection added.

    If a conflict is detected between the begin until after announce
    wait, a new address needs to be chosen immediatly.
    This can occur in two situations:
    1) another host already has this ip address
    2) another host is also probing for the same address.
    If a conflict is detected during announcing or during the ongoing
    conflict detection, we defend our ip address once. If a second
    conflict occurs during defend interval, we take another ip address.
    If not we can keep our address and connections.

    When a conflict occurs and it's decided we need a new address,
    autoip is simply restarted. To do: test if a acd stop is needed.
    This will become more important when DHCP is added I believe.

commit 65f47ba9444d8b9f767dc908319579323eeb8664
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Tue Jul 17 15:33:44 2018 +0200

    Update ACD state machine with PROBE_WAIT and and ANNOUNCE_WAIT

    By adding the ANNOUNCE_WAIT state, we could remove duplicate code
    that was present in the original autoip state implementation.
    But because we cannot directly go to ANNOUNCING we needed this
    extra state during the wait period. It also makes the different
    states clearer.
    Their is no need to number the enum because the compiler takes
    care of this standard numbering.
    Also a indent issue on the state machine code is solved here.

commit 2d9f4414c7b1f2ed35c0b5cea78dabb9c9afee77
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Tue Jul 17 15:28:33 2018 +0200

    Added an extra check for etharp responses.

    Their is no need to answer a request that is initiated by ourselves.
    In my test case, a conflicting request would be seen here as a
    request needing a reply. Which off course isn't needed at all.
    The acd module will let the requester know that it is using our
    ip address.
    I could not think of a reason not to add this extra check but please
    check if this doesn't break other functionality.

commit f84cc1dba4061219bd1aadb97bd340278db07cd7
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Tue Jul 17 15:27:13 2018 +0200

    Redirect all incoming ARP messages to the ACD module.

    The ACD module will scan the packets and react on conflicts.
    autoip does not need the arp packets any more.

commit 9faf266993cc2df0b9434720b59b5922f17d7d33
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Tue Jul 17 10:08:39 2018 +0200

    Initiate acd from autoip implementation.

    The state machine in autoip is now replaced by the acd module.

commit 40a5a40d911c98e6ee8566c0adce7716f26f20e0
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Tue Jul 17 10:05:59 2018 +0200

    Add simple acd state machine to timer function.

    This state machine will be started from acd_start and will go
    through the probing and the announcing state. At this moment the
    timings are made fixed for easy debugging. Will be made variable
    afterwards.

commit 0a2629bf1f7942e80ec11bcc3e163ac1a2b9a580
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Tue Jul 17 09:44:19 2018 +0200

    Disable gratuitous ARP send from netif_issue_report when acd is enabled

    The acd module needs to be fully under control on what arp messages are
    send. It wouldn't be a clean solution if we kept this announce as one
    of the announce messages.
    So when ACD is enabled, this message will not be send.

commit a7b9a4d5039168723c2043677176c5c8fc69f8df
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Tue Jul 17 09:42:46 2018 +0200

    ARP probe and announce functions added.

    Both use etharp_requests to send out an arp message.

commit e2f1ce3fa84e2ce01bc944d8049412e156cd7cc7
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Tue Jul 17 09:26:07 2018 +0200

    Add conflict callback mechanism to acd module

    When starting the acd with acd_start, a conflict callback has to be
    provided. After probing when no conflict is detected, the callback
    is called with the conflict variable on 0. From the moment a conflict
    is detected, it will be called set to 1.
    By not making a fixed link between acd, autoip and dhcp but working
    with callback functions the user (caller) can easily use it for
    fixed ip too. This keeps the acd module completely independent from
    the other application layer protocols.

commit 21e7995888d2941601e99873ee129d1ea927e3f7
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Mon Jul 16 14:41:52 2018 +0200

    acd_stop function added.

    When calling this function the acd state machine will be put in
    ACD_STATE_OFF. This will disable the acd functionality until
    acd_start is called.

commit 503037fb462504e46a14ce7486bc763dbc6a8690
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Mon Jul 16 14:35:48 2018 +0200

    acd_start function added

    This function will allocate a struct for the acd module if one wasn't
    added with acd_set_struct. It will then initialize the acd struct
    and start the probe wait timer (for now fixed).

commit e439f6dffc44e93078a2976783bdebfe17304d8c
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Mon Jul 16 14:22:39 2018 +0200

    ACD_DEBUG define added for enabling / disabling debug messages.

commit 80d33e1eaf092934ace1045fac096464cd5be5e9
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Mon Jul 16 11:39:37 2018 +0200

    ACD struct added together with set struct function

    ACD needs some variables: state, timing, probe counter etc.
    We added the struct as netif data. For now one ACD module per netif
    is enough. We found some unclarities about ACD with multiple IP
    address on one interface. For now, ACD will only be implemented for
    the IP address that is going to be used / is being used on the netif.

commit 2c4cca36744973318c3efe7cbae6384b52dc71a8
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Mon Jul 16 11:35:06 2018 +0200

    Add acd timer to timeouts.c with interval of 100ms.

    This timer will be used for time to wait counting etc.
    Very similar to the auto ip timer.

commit e2ed447e00c4df790df21509acb4ab09b5b79e66
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Fri Jul 13 16:56:39 2018 +0200

    Add ACD protocol definitions

commit 445733214460eae18817556439bed979e9b3747c
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Fri Jul 13 16:07:58 2018 +0200

    Add c++ option (to use C code module in c++)

commit 63d78bc1f77ac6698c3d663a1c67b40a0c297125
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Fri Jul 13 15:57:34 2018 +0200

    Added on off option for ACD module

commit d5ec4b69eb4175d4dd569bcfc80ae0e192780015
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com>
Date:   Fri Jul 13 15:09:40 2018 +0200

    ACD IPv4 module files added

    The files for IPv4 ACD or Address Conflict Detection are added
    to the lwip source.
2018-10-04 17:34:44 +02:00
Simon Goldschmidt
54a8112eb9 Documentation improvements for 2.1.0 (changelog, altcp) 2018-09-26 14:37:52 +02:00
Simon Goldschmidt
b9fc8cae68 Documentation improvements for 2.1.0 (mainly altcp/altcp_tls) 2018-09-24 22:44:32 +02:00
Simon Goldschmidt
a044c807f8 altcp_tls: rename altcp_tls_new -> altcp_tls_wrap, add altcp_tls_new
The new altcp_tls_new() is a type safe version of altcp_tls_alloc()

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-09-24 22:29:54 +02:00
Simon Goldschmidt
6229f9ef71 icmp_send_response: fix parameter order for LWIP_HOOK_IP4_ROUTE_SRC 2018-09-17 21:28:50 +02:00
Simon Goldschmidt
bc48eb512e Fix bug #54506 (LWIP_CHECKSUM_ON_COPY causes wrong checksum (0xFFFF))
one's complement sum was not correctly done, which could result in the
checksum being 0xFFFF instead of 0 in some cases.
2018-09-12 21:56:16 +02:00
Simon Goldschmidt
93b2074f2b Remove LWIP_DHCP_CHECK_LINK_UP define as it's useless
See bug #54574

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-09-07 21:01:32 +02:00
Dirk Ziegelmeier
24fc93e12f Remove checks that the SO_* socket options and SOF_* lwIP-internal flags match
not needed any more since commit b0344518e8
"sockets.c: Don't rely on #defines in socket.h to be in sync with ip.h
Map SO_* to SOF_* #defines"

Reported by Joan Lledó on mailinglist 6.Sep.2018
2018-09-07 10:01:59 +02:00
Dirk Ziegelmeier
dac4cb05f7 Fix bug #54569: Compiler warning in ip4.c: unused parameter dest 2018-08-29 08:55:25 +02:00
Simon Goldschmidt
258cab1b22 fix bug #54315 (IPV6_V6ONLY socket accepts IPV4 connections)
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-07-23 21:47:33 +02:00
Dirk Ziegelmeier
eeb2218b3d Revert "Test / RFC: Reformat a few files using clang-format"
This reverts commit 8b4a8159a8.

We do not want to do this shortly before a release. Reformatting (buggy reformatting) may introduce new bugs.
2018-07-18 08:34:01 +02:00
Dirk Ziegelmeier
0985e925a1 Fix bug #54327: V2.1.0rc1 pbuf.c misses stdint.h include
... without reformatting the document (clang-format)
2018-07-18 07:31:47 +02:00
Dirk Ziegelmeier
cffb5cc087 Revert "Fix bug #54327: V2.1.0rc1 pbuf.c misses stdint.h include"
This reverts commit 4e74421dac.
2018-07-18 07:30:41 +02:00
Dirk Ziegelmeier
8b4a8159a8 Test / RFC: Reformat a few files using clang-format
Does it compile? Does it look good (enough)?
2018-07-17 21:15:48 +02:00
Dirk Ziegelmeier
4e74421dac Fix bug #54327: V2.1.0rc1 pbuf.c misses stdint.h include 2018-07-17 20:45:09 +02:00
Axel Lin
d3191e4835 dhcp6: Trivial comment typo fixes
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-07-12 21:35:38 +08:00
Jasper Verschueren
d65681a7d7 DHCP request send on reboot does not contain hostname option
When the network is changed, dhcp is rebooted.
It will send a dhcp request again to verify it's lease.

DHCP requests are send out in selecting state, rebinding, renewing
and rebooting. But in the rebooting state the hostname option is
not included. This means that after reboot, the hostname will be
unknown to the DNS.

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-07-11 19:55:49 +02:00
Axel Lin
d73efd7d38 dhcp: Prevent NULL pointer dereference in dhcp_select
Move the code to make sure netif is not NULL before calling
netif_dhcp_data(netif).

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-07-05 21:39:00 +08:00
Simon Goldschmidt
596f742066 etharp: fix using ARP_TABLE_SIZE >= 0x80 2018-07-05 09:13:28 +02:00
Joel Cunningham
2bd1e313b9 etharp: cast netif_addr_idx_t to u16_t to match format type
This fixes an issue seen on MacOS with Clang 9.0.0:

../../../../lwip/src/core/ipv4/etharp.c:1069:142: error: format specifies type 'unsigned short' but the argument has type 'netif_addr_idx_t'
      (aka 'unsigned char') [-Werror,-Wformat]
        LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: dropped previously queued packet %p for ARP entry %"U16_F"\n", (void *)q, i));
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~

../../../../lwip/src/core/ipv4/etharp.c:1074:120: error: format specifies type 'unsigned short' but the argument has type 'netif_addr_idx_t'
      (aka 'unsigned char') [-Werror,-Wformat]
      LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: queued packet %p on ARP entry %"U16_F"\n", (void *)q, i));
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~

By default, netif_addr_idx_t is u8_t, so cast up to u16_t to match the format type
2018-07-04 16:11:46 -05:00
Simon Goldschmidt
fd0af07d2d tcp/udp bind: small code restructuring for IPv6-only
See bug #54229
2018-07-02 20:31:38 +02:00
Simon Goldschmidt
1e24f9c9cd dhcp: 2 small code improvements
See bugs #54226 and #54228
2018-07-02 20:27:12 +02:00
Simon Goldschmidt
19a929f5fb dhcp: fix parse error with chained pbfus
If a chained pbuf starts with DHCP_OPTION_PAD, an overflow check
triggers and the packet is ignored.

Fix this by changing the way the offset is increased for PAD.
Also ignore a packet that is missing the END option.

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-07-02 20:25:42 +02:00
Simon Goldschmidt
b1487e6480 ip4_reass: fixed duplicat NULL check
See bug #54197

Rerported-by: Andrey Vinogradov <andrey.vinogradov@teplomonitor.ru>
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-27 20:56:05 +02:00
Simon Goldschmidt
f3e14585ad tcp_out: fix duplicate check of tcp snd_queuelen
Can be combined into a single check using LWIP_MIN.
See bug #54194

Reported-by: Andrey Vinogradov <andrey.vinogradov@teplomonitor.ru>
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-27 20:44:01 +02:00
Simon Goldschmidt
9992b48e90 fix compiling with LWIP_NOASSERT defined
See bug #54157
2018-06-20 20:56:20 +02:00
Simon Goldschmidt
824ebbe0e9 tcp: fix RTO timer not working if link is down
... and added some test cases for this situation
See bug #54139

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-19 22:48:06 +02:00
Simon Goldschmidt
3cdfc67dd8 ip4_frag: fix assertion on wrong pbuf
see bug #54117

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-19 21:29:16 +02:00
Simon Goldschmidt
7577e587be lwip_itoa: fix implicit conversion warning 2018-06-18 12:15:37 +02:00
Simon Goldschmidt
dbc16e6765 minor whitespace cleanup 2018-06-15 21:19:19 +02:00
Axel Lin
a51c92b617 tcp_out: Fix trivial build error
Fixes: 6ac21515ca ("Add missing null checks")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-06-14 22:47:28 +08:00
Matthias Hofmann
6ac21515ca Add missing null checks.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-14 16:20:47 +02:00
Simon Goldschmidt
e61b925709 try to fix compiling with gcc & clang 2018-06-14 15:01:57 +02:00
Simon Goldschmidt
944f286d87 fix bug in RA MTU validation
Also fix that RA could change IPv4 MTU.
See bug #53696

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-14 12:55:18 +02:00
Simon Goldschmidt
313664c59c ip6addr_ntoa_r: correctly generate ipv4 mapped addresses 2018-06-14 12:29:40 +02:00
Simon Goldschmidt
b0e5eeb7d2 udp: prefer correctly bound pcbs when receiving broadcast
See bug #53301

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-13 22:01:18 +02:00
Simon Goldschmidt
1bdc669b45 udp: restructure udp_input uncon_pcb selection in preparation for fixing bug #53301 2018-06-13 21:59:04 +02:00
Simon Goldschmidt
47ebb2b267 dns: add a comment about case insensitivity 2018-06-13 15:10:47 +02:00
Simon Goldschmidt
a9d6ea5953 introduce 'lwip_tolower' and use it in dns.c
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-13 15:08:11 +02:00
armink
66f7f06601 fix DNS resolution to not case insensitivity
See patch #9654

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-13 15:04:46 +02:00
Matthias Hofmann
8e23b8d903 Correct UDP rebind check.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-13 15:00:21 +02:00
Simon Goldschmidt
a75332a407 ip4_frag: correctly refragment packets that already have MF set
see patch #9645

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-13 14:56:18 +02:00
Axel Lin
61e3f49f69 netif: Don't return error if pass NULL netif_input_fn to netif_add
The new NULL checking against netif_input_fn make ppp stop working
because in ppp_new() it calls netif_add with NULL netif_input_fn.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-13 10:39:38 +02:00
Simon Goldschmidt
392c676ef5 fix bug #53273: IPv6 link-local address generation for non-ethernet type netif does not convert byte order 2018-06-13 08:57:17 +02:00
Simon Goldschmidt
0c5133d7cf fix ip6addr_aton for non-shortened ipv4 mapped addresses 2018-06-12 21:48:32 +02:00
Simon Goldschmidt
1bf323e12f remove 2 NULL checks which are wrong 2018-06-12 13:46:44 +02:00
Simon Goldschmidt
e7c0619189 fix NULL checks (compiler error, tcp_rst allows pcb==NULL) 2018-06-12 13:32:12 +02:00
Matthias Hofmann
342d0eadfb Add null pointer checks for TCP, UDP and netif
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-12 10:24:08 +02:00
Simon Goldschmidt
6ea2483546 ip4_canforward(): don't route multicast packets
Added LWIP_HOOK_IP4_CANFORWARD to still implement multicast routing.
See bug #52914

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-12 06:45:30 +02:00
Axel Lin
1fd145fbc9 Fix trivial copy-n-paste mistake in ip4_debug_print
Fixes: 288d3c2802 ("fixed bug #54006: Two compiler warnings on IAR when debug is enabled")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-06-12 11:36:05 +08:00
Simon Goldschmidt
2837bb310c fix ip6addr_aton handling IPv4-mapped addresses
... and added a unit test for it

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-11 22:21:31 +02:00
Simon Goldschmidt
288d3c2802 fixed bug #54006: Two compiler warnings on IAR when debug is enabled 2018-06-11 20:11:47 +02:00
Simon Goldschmidt
31e07f90bd send router solicitations every 4 seconds
See bug #53973

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-08 23:09:13 +02:00
Simon Goldschmidt
4fa33c17bc add reference to the RFC for the last commit... 2018-06-08 22:54:02 +02:00
Simon Goldschmidt
1a294622d0 ipv6 router solicitation: "ensure at least one solicitation is sent"
Fix the case where nd6_send_rs() fails: send one solicitation here,
not LWIP_ND6_MAX_MULTICAST_SOLICIT.

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-08 22:45:55 +02:00
Simon Goldschmidt
fd050b8a97 fix bug #53971 Lwip sends Router Solicitation on address changes
... and add a unit test for it.

Moved resetting netif->rs_count from all reports to link-up and netif-up only.
While at it, clean up the interface a bit so that netif->rs_count is touched
from nd6.c only.

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-06-08 22:18:50 +02:00
Simon Goldschmidt
b1ffb3a8d3 Try to fix bug #53952 (ip4_addr_debug_print_val unaligned structure reference compiler warning) 2018-05-24 23:13:27 +02:00
Simon Goldschmidt
11c294e973 fix type conversion errors introduced with last commit 2018-05-17 22:35:12 +02:00
Simon Goldschmidt
0c2fdfcf42 Fix bug #53667: ARP table max size is to small
arp table functions, nd6 destination cache and struct netif_hint
can now be u16_t or u8_t depending on table size, so up to 32K
entries can be used in these tables (s16_t)

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-05-17 21:52:01 +02:00
Simon Goldschmidt
0f165ff136 etharp: use generic types in external access to ARP table
This should hide the internal type used for access to the ARP table
which currently is s8_t or u8_t, depending on the use case.

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-05-17 21:16:06 +02:00
goldsimon
8f3df7c862 tcp: fix const warning for LWIP_NETIF_HWADDRHINT==1 2018-05-17 20:57:02 +02:00
Joel Cunningham
ffaee59f3e loopif: only schedule poll when first packet is enqueued
This optimizes the netif_loop_output to only schedule a call to poll when
the first packet is enqueued. This ensures netif_poll is ran once per
burst of packets that are sent (which is typical in a TCP transfer)

The old behavior scheduled a call to poll for every packet that was
enqueued and this lead to exhaustion of the MEMP_TCPIP_MSG_API memory pool
and tcpip_mbox (if port is using static mbox size). The extra callbacks are
wasted work because netif_poll drains the entire queue when ran

This issue presented itself when large TCP transfer go across the loopback
netif
2018-05-02 09:16:01 -05:00
Joel Cunningham
070e449690 loopif: disable checksums
This disable checksum generation and checking for the loopback netif
when LWIP_CHECKSUM_CTRL_PER_NETIF is enabled

Checksums are not needed for the loopback adapter and this will increase
performance for loopback communication
2018-05-02 09:16:01 -05:00
goldsimon
e05a96550f etharp: fix bogus ifdef regions
(after separating etharp and ethernet)
2018-04-25 21:17:47 +02:00
Axel Lin
9fd8222479 etharp: Cast the return value of etharp_find_entry to s8_t instead of err_t
etharp_find_entry() returns s8_t rather than err_t.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-04-21 08:22:51 +08:00
Dirk Ziegelmeier
9980d09bc8 Add note about NETIF_FLAG_MLD6 netif flag 2018-04-20 08:59:36 +02:00
Dirk Ziegelmeier
4b3e996617 Add note to MLD6 that allnodes group multicasts must be received 2018-04-20 08:57:01 +02:00
Ben Wijen
7d1c6ba549 dhcp: Fix BOOTP_FILE bug
The comment in dhcp_handle_ack for 'offered_si_addr' states:
'boot file name copied in dhcp_parse_reply if not overloaded'
However this code was never reached if the packed was not 'overloaded'

Signed-off-by: goldsimon <goldsimon@gmx.de>
2018-04-19 22:18:56 +02:00
goldsimon
ef3073aaf9 LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT: 'lfree' mus be volatile 2018-04-18 22:12:46 +02:00
Dirk Ziegelmeier
ffdd44ec74 Fix bug #53559: IPv4 to IPv6 filtering not freeing PBUFs
Add missing pbuf_free() call
2018-04-04 21:04:14 +02:00
Axel Lin
81acaf0ff1 tcp_out: Fix updating remainder_flags in tcp_split_unsent_seg
The code to migrate flags from original segment updating wrong variable
so both remainder and remainder_flags may be incorrect. Fix it.

Fixes: f582c88339 ("tcp: persist timer re-work (bug #50837)")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Joel Cunningham <joel.cunningham@me.com>
2018-03-31 11:20:03 +08:00
goldsimon
c881c48eed netif_add: check that the new netif is not already added 2018-03-21 09:32:39 +01:00
Axel Lin
6070a7ef6a netif: Add netif_do_ip_addr_changed function to reduce duplicated code
As the common code to call tcp/udp/raw_netif_ip_addr_changed is called
by multiple places, add netif_do_ip_addr_changed() to call them.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Simon Goldschmidt <goldsimon@gmx.de>
2018-03-14 22:59:17 +08:00
goldsimon
08bcfa2b29 netif: initialize netif->output with a dummy function for IPv6 only netifs 2018-03-13 20:29:37 +01:00
goldsimon
0074022bb5 minor: fix typos and spaces 2018-03-13 20:28:59 +01:00
goldsimon
e7766297de dhcp6_disable: need to set pcb_allocated to zero
See bug #53224: dhcp6_disable() pcb_allocated need set to zero.
2018-02-25 13:20:28 +01:00
Our Air Quality
59e98ccb19 tcp_output_fill_options: account for the SACKS length in assertion. 2018-02-24 14:46:44 +01:00
goldsimon
56124bf53b Add check in init.c: altcp does not work with LWIP_EVENT_API 2018-02-24 14:43:51 +01:00
Dirk Ziegelmeier
f595445ec0 Some fixes to DHCPv6 documentation 2018-02-23 12:54:51 +01:00
Dirk Ziegelmeier
aa04944ae0 Add DHCPv6 to documentation 2018-02-23 12:35:45 +01:00
goldsimon
d2ee10977f dhcp6: try to fix docs (clang complains) 2018-02-23 10:26:19 +01:00
goldsimon
7ad680c2bf Try to fix dhcp6.c on travis 2018-02-23 09:54:04 +01:00
goldsimon
8600259a78 tiny cleanup in dhcp.c 2018-02-22 22:33:48 +01:00
goldsimon
76a13054ee add initial support for stateless DHCPv6
Signed-off-by: goldsimon <goldsimon@gmx.de>
2018-02-22 22:33:16 +01:00
Axel Lin
fe3bb8bb78 etharp: Remove superfluous assert checking in free_etharp_q
The same checking is done while iterating the list in the while loop.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-02-22 11:27:29 +08:00
goldsimon
a7b43dae49 altcp: default shutdown for both sides is close 2018-02-21 12:50:42 +01:00
goldsimon
bcff67b00e altcp_tls_alloc: need to close inner conn instead of freeing it 2018-02-20 17:08:00 +01:00
goldsimon
3bd87e3815 doc: altcp: keep altcp_alloc/altcp_free out of the docs
Those functions are for implementing altcp layers, not for applications
2018-02-20 14:08:04 +01:00
Dirk Ziegelmeier
fc3c186289 Improve altcp allocator documentation 2018-02-20 13:25:50 +01:00
Axel Lin
e9bd31b190 icmp6: Fix "LWIP_ICMP6_DATASIZE" redefined build warning if it was set to 0
Need to undefine LWIP_ICMP6_DATASIZE before change the setting.
While at it, also remove the unneeded #ifndef LWIP_ICMP6_DATASIZE
checking because it is set in lwip/opt.h.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-02-20 17:54:49 +08:00
Axel Lin
a894140bb0 igmp: Use angle brackets for including string.h
Use angle brackets(<>) for including system header files.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-02-20 15:20:14 +08:00
goldsimon
842b9f4429 altcp: simplify creating different types by adding an allocator concept
This is done with an example in the http_client

Signed-off-by: goldsimon <goldsimon@gmx.de>
2018-02-19 21:41:48 +01:00
goldsimon
b5448a86fd ip4_reass: free datagram entry if p == NULL 2018-02-18 08:55:11 +01:00
Joel Cunningham
618a28fc53 memp: remove include of sockets.h
Socket memory pool types have been migrated to sockets_priv.h so we
no longer need to include sockets.h
2018-02-13 14:04:01 -06:00
goldsimon
5ee77262bc mem plug_holes: fix copy& paste error 2018-02-13 12:24:10 +01:00
goldsimon
bcb6819715 dns_compare_name: change check for u16_t overflow
check upper border (0xFFFF) instead of checking for 0 after overflow
2018-02-13 12:23:50 +01:00
goldsimon
e20e9bc3d4 Try to fix issues reported by coverity 2018-02-13 12:09:18 +01:00
Dirk Ziegelmeier
d5d635cdce Minor DNS documentation improvement 2018-02-13 10:58:32 +01:00
Axel Lin
47946a29e9 memp: Remove include of lwip/netifapi.h from memp.c
struct netifapi_msg is defined in lwip/priv/api_msg.h rather than
lwip/netifapi.h. Thus remove include of lwip/netifapi.h from memp.c.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2018-02-13 16:52:18 +08:00
goldsimon
b5e67f142a tcp: LWIP_CHECKSUM_ON_COPY: fix adding data to retx segment
See bug #50914( TCP_CHECKSUM_ON_COPY when adding data to
retransmission): when adding data to an already transmitted segment
that has an uneven length, the checksum was wrong.

To fix this, tcp_output_segment has to restore seg->chksum_swapped
before returning.
2018-02-12 12:38:17 +01:00
goldsimon
8fa55e32d2 add MEM_OVERFLOW_CHECK and combine code with MEMP_OVERFLOW_CHECK
This moves untouched memory check and defines from memp.c and memp_priv.h
to mem.c and mem_priv.h (which is new).
2018-02-09 13:44:10 +01:00
goldsimon
f9300c1fb0 netif: ext_callback: clean up netif_set_addr after last change 2018-02-07 20:37:29 +01:00
goldsimon
2a4dd0dc7b altcp: priority-based pcb/conn allocation required
altcp_tcp_new_ip_type: allocate the tcp pcb first to invoke the
priority handling code if we're out of pcbs
2018-02-04 14:00:23 +01:00
goldsimon
7edbd95b50 tcp_out: fix unused parameter when all options are off 2018-02-02 09:01:21 +01:00
goldsimon
fa9082116f tcp: add 2 hooks to add custom options to outgoing tcp segments
Signed-off-by: goldsimon <goldsimon@gmx.de>
2018-02-01 09:31:15 +01:00
goldsimon
77d0ee0961 tcp: add LWIP_HOOK_TCP_INPACKET_PCB
This hook is called from tcp_input() for all kinds of input pcbs when
selected to receive a pbuf (LISTEN, TIME_WAIT, rest). I can parse or
drop an rx pbuf.

Signed-off-by: goldsimon <goldsimon@gmx.de>
2018-02-01 09:19:16 +01:00
goldsimon
0e85582bc0 tcp: introduce ext_args per pcb
This introduces the concept of ext (external/extended) arguments per
tcp_pcb (also for listening pcbs) to store more data than just one
"void *arg" per pcb. The "arg" is for use to applications, whereas
the ext_args may be used by frameworks and leave "arg" untouched.

In addition to a void pointer, callbacks are added to help frameworks
migrate arguments from listen pcb to connection pcb and to free args
when the pcb is freed.

Signed-off-by: goldsimon <goldsimon@gmx.de>
2018-02-01 09:19:16 +01:00
goldsimon
ebe782ba16 tcp: centralize freeing tcp pcbs to memp_free
This should make it easier to add debugging messages or other hooks
to the point where tcp pcbs are deallocated.

Signed-off-by: goldsimon <goldsimon@gmx.de>
2018-02-01 09:19:15 +01:00
goldsimon
61671d6df0 tcp_out: make some more pointers const 2018-02-01 09:18:24 +01:00
goldsimon
9fb86f6e4b tcp: add a define for maximum option bytes 2018-02-01 09:14:22 +01:00
Joel Cunningham
64a351cbe0 tcp_out: remove CHECKSUM_GEN_TCP case from tcp_send_empty_ack
CHECKSUM_GEN_TCP support was moved to tcp_output_control_segment
so we can remove usage of tcphdr and the extra set of #if/#endif

This fixes https://travis-ci.org/yarrick/lwip-merged/builds/335348098
2018-01-30 17:35:40 -06:00
goldsimon
424c33bcb7 tcp_out: combine the tx path of the 4 direct tx functions
tcp_rst, tcp_send_empty_ack, tcp_keepalive and tcp_zero_window_probe
all execute the same instructions to send a segment pbuf.
Combined into tcp_output_control_segment().
2018-01-30 21:50:41 +01:00
goldsimon
9128a51944 tcp_out: make tcp_output_alloc_header generic enough for tcp_rst 2018-01-30 21:46:48 +01:00
goldsimon
1570dd8ad1 tcp_abandon: no need to buffer pcb->local_port 2018-01-30 21:43:18 +01:00
goldsimon
fdbc9f9b32 tcp_out: move around functions to group them together
This file has been a mess regarding the order of the functions.
By moving them around, they can be grouped into functions taking
part in normal data transmission (via unsent/unacked) and control
segments (which are allocated, directly sent and freed).

Signed-off-by: goldsimon <goldsimon@gmx.de>
2018-01-30 21:06:44 +01:00
goldsimon
dd6c43ecbd tcp_out: documentation update 2018-01-30 20:49:47 +01:00