Skip to content

Commit 4e30b96

Browse files
Merge pull request #4814 from mikaleppanen/lwip_2_0_2_stable
Merge lwip 2.0.2 stable
2 parents 9edd0e8 + 02069f1 commit 4e30b96

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+602
-236
lines changed
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Description
2+
3+
This document describes how to update the Arm Mbed OS LWIP stack. The Mbed OS LWIP stack is a copy of the LWIP master repository. Stack is located in `FEATURE_LWIP/lwip-interface/lwip` directory.
4+
5+
When you add new releases or single commits from the LWIP master repository, you must fetch them using the Mbed OS LWIP fork repository. Use the repository to rename LWIP source files with the `lwip_` prefix to make them compatible with the Mbed OS build system.
6+
7+
* The LWIP master repository is part of the [LWIP project](https://savannah.nongnu.org/projects/lwip).
8+
* The Mbed OS LWIP fork repository is part of [`ARMmbed`](https://github.com/ARMmbed/lwip).
9+
10+
## How to integrate a release from the LWIP master repository to the Mbed OS
11+
12+
You can integrate a new release using the following steps.
13+
14+
* Fetch the release to the Mbed OS LWIP fork.
15+
* Prefix files in the Mbed OS LWIP fork with the `lwip_` prefix.
16+
* Merge the release to the Mbed OS repository.
17+
18+
### Fetching the release to the Mbed OS LWIP fork and prefixing files
19+
20+
1. Clone the Mbed OS LWIP fork repository.
21+
22+
`git clone [email protected]:ARMmbed/lwip.git`
23+
24+
2. Go to the Mbed OS LWIP fork root directory, and add the LWIP master repository as remote.
25+
26+
`git remote add <remote name> https://git.savannah.nongnu.org/git/lwip.git`
27+
28+
`e.g. git remote add lwip https://git.savannah.nongnu.org/git/lwip.git`
29+
30+
3. Pull the release from the LWIP master repository using the release tag. You can find tags [here](<https://savannah.nongnu.org/projects/lwip>).
31+
32+
`git pull <remote name> <tag>`
33+
34+
`e.g. git pull lwip STABLE-2_0_2_RELEASE_VER`
35+
36+
4. Push the tag to the Mbed OS LWIP fork repository to keep the fork in sync.
37+
38+
`git push origin <tag>`
39+
40+
`e.g. git push origin STABLE-2_0_2_RELEASE_VER`
41+
42+
5. Create a branch for release. Use the same naming convention as previous branches.
43+
44+
`git branch <branch name> <tag>`
45+
46+
`e.g. git branch mbed-os-lwip-stable-2_0_2 STABLE-2_0_2_RELEASE_VER`
47+
48+
6. Push the branch to the Mbed OS LWIP fork repository to keep the fork in sync.
49+
50+
`git push origin <branch name>`
51+
52+
`e.g. git push origin mbed-os-lwip-stable-2_0_2`
53+
54+
7. Fetch the previous prefixed branch from the Mbed OS LWIP fork repository.
55+
56+
`git fetch <remote name> <remote branch>:<local branch>`
57+
58+
`e.g. git fetch origin mbed-os-lwip-stable-2_0_1-prefixed:mbed-os-lwip-stable-2_0_1-prefixed`
59+
60+
8. Checkout the latest prefixed branch.
61+
62+
`git checkout <prefixed branch>`
63+
64+
`e.g. git checkout mbed-os-lwip-stable-2_0_1-prefixed`
65+
66+
9. Merge the new branch to the prefixed branch.
67+
68+
`git merge <branch name>`
69+
70+
`e.g. git merge mbed-os-lwip-stable-2_0_2`
71+
72+
10. Check if there are any new or colliding files.
73+
74+
If there are new c-files rename those with `lwip_` prefix and make a commit about changes to the prefixed branch. Also, check that LWIP stack header file names do not collide with headers under the Mbed OS directory tree. If there are collisions, rename the colliding LWIP headers with `lwip_` prefix.
75+
76+
If needed, rename files, and make a commit. Update the C-files to include any renamed header files.
77+
78+
`git mv <old filename> <new filename>`
79+
80+
`git commit`
81+
82+
11. Rename the local prefixed branch to the new version. (Do not change branch names on remotes.)
83+
84+
`git branch -m <new prefixed branch>`
85+
86+
`e.g. git branch -m mbed-os-lwip-stable-2_0_2-prefixed`
87+
88+
12. Push the new local prefixed branch to the Mbed OS LWIP fork repository.
89+
90+
`git push origin <new prefixed branch>`
91+
92+
`e.g. git push origin mbed-os-lwip-stable-2_0_2-prefixed`
93+
94+
### Merging the prefixed release to the Mbed OS repository
95+
96+
1. Clone the Mbed OS repository.
97+
98+
`git clone [email protected]:ARMmbed/mbed-os.git`
99+
100+
2. Go to the Mbed OS root directory, and add the Mbed OS LWIP fork repository as remote. Fetch branches from fork.
101+
102+
`git remote add <remote name> https://github.com/ARMmbed/lwip.git`
103+
104+
`e.g. git remote add lwip-fork https://github.com/ARMmbed/lwip.git`
105+
106+
`git fetch <remote name>`
107+
108+
`e.g. git fetch lwip-fork`
109+
110+
3. Do a subtree pull for LWIP prefixed branch in the Mbed OS root directory.
111+
112+
`git subtree pull --squash -P features/FEATURE_LWIP/lwip-interface/lwip <remote name> <new prefixed branch> -m "<commit message>"`
113+
114+
`e.g. git subtree pull --squash -P features/FEATURE_LWIP/lwip-interface/lwip lwip-fork mbed-os-lwip-stable-2_0_2-prefixed -m "Merged lwip 2.0.2 stable"`
115+
116+
After this step, there is a new commit visible in the Mbed OS master branch that contains the changes.
117+
118+
4. Verify that changes in the new commit are correct, and create a new branch. Push the branch to your Mbed OS fork for GitHub review.

features/FEATURE_LWIP/lwip-interface/lwip/CHANGELOG

Lines changed: 78 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,82 @@ HISTORY
33
(git master)
44

55
* [Enter new changes just after this line - do not remove this line]
6-
6+
7+
(STABLE-2.0.2)
8+
9+
++ New features:
10+
11+
2017-02-10: Dirk Ziegelmeier
12+
* Implement task #14367: Hooks need a better place to be defined:
13+
We now have a #define for a header file name that is #included in every .c
14+
file that provides hooks.
15+
16+
++ Bugfixes:
17+
18+
2017-03-08
19+
* tcp: do not keep sending SYNs when getting ACKs
20+
21+
2017-03-08: Joel Cunningham
22+
* tcp: Initialize ssthresh to TCP_SND_BUF (bug #50476)
23+
24+
2017-03-01: Simon Goldschmidt
25+
* httpd: LWIP_HTTPD_POST_MANUAL_WND: fixed double-free when httpd_post_data_recved
26+
is called nested from httpd_post_receive_data() (bug #50424)
27+
28+
2017-02-28: David van Moolenbroek/Simon Goldschmidt
29+
* tcp: fixed bug #50418: LWIP_EVENT_API: fix invalid calbacks for SYN_RCVD pcb
30+
31+
2017-02-17: Simon Goldschmidt
32+
* dns: Improved DNS_LOCAL_HOSTLIST interface (bug #50325)
33+
34+
2017-02-16: Simon Goldschmidt
35+
* LWIP_NETCONN_FULLDUPLEX: fixed shutdown during write (bug #50274)
36+
37+
2017-02-13: Simon Goldschmidt/Dirk Ziegelmeier
38+
* For tiny targtes, LWIP_RAND is optional (fix compile time checks)
39+
40+
2017-02-10: Simon Goldschmidt
41+
* tcp: Fixed bug #47485 (tcp_close() should not fail on memory error) by retrying
42+
to send FIN from tcp_fasttmr
43+
44+
2017-02-09: Simon Goldschmidt
45+
* sockets: Fixed bug #44032 (LWIP_NETCONN_FULLDUPLEX: select might work on
46+
invalid/reused socket) by not allowing to reallocate a socket that has
47+
"select_waiting != 0"
48+
49+
2017-02-09: Simon Goldschmidt
50+
* httpd: Fixed bug #50059 (httpd LWIP_HTTPD_SUPPORT_11_KEEPALIVE vs.
51+
LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED)
52+
53+
2017-02-08: Dirk Ziegelmeier
54+
* Rename "IPv6 mapped IPv4 addresses" to their correct name from RFC4191:
55+
"IPv4-mapped IPv6 address"
56+
57+
2017-02-08: Luc Revardel
58+
* mld6.c: Fix bug #50220 (mld6_leavegroup does not send ICMP6_TYPE_MLD, even
59+
if last reporter)
60+
61+
2017-02-08: David van Moolenbroek
62+
* ip6.c: Patch #9250: fix source substitution in ip6_output_if()
63+
64+
2017-02-08: Simon Goldschmidt
65+
* tcp_out.c: Fixed bug #50090 (last_unsent->oversize_left can become wrong value
66+
in tcp_write error path)
67+
68+
2017-02-02: Dirk Ziegelmeier
69+
* Fix bug #50206: UDP Netconn bind to IP6_ADDR_ANY fails
70+
71+
2017-01-18: Dirk Ziegelmeier
72+
* Fix zero-copy RX, see bug bug #50064. PBUF_REFs were not supported as ARP requests.
73+
74+
2017-01-15: Axel Lin, Dirk Ziegelmeier
75+
* minor bug fixes in mqtt
76+
77+
2017-01-11: Knut Andre Tidemann
78+
* sockets/netconn: fix broken default ICMPv6 handling of checksums
79+
80+
(STABLE-2.0.1)
81+
782
++ New features:
883

984
2016-12-31: Simon Goldschmidt
@@ -43,7 +118,7 @@ HISTORY
43118

44119
2016-12-05: Dirk Ziegelmeier
45120
* fixed compiling with IPv4 disabled (IPv6 only case)
46-
121+
47122
2016-11-28: Simon Goldschmidt
48123
* api_lib.c: fixed bug #49725 (send-timeout: netconn_write() can return
49124
ERR_OK without all bytes being written)
@@ -72,7 +147,7 @@ HISTORY
72147
2016-11-11: Dirk Ziegelmeier
73148
* sockets.c: fixed bug #49578 (dropping multicast membership does not work
74149
with LWIP_SOCKET_OFFSET)
75-
150+
76151
(STABLE-2.0.0)
77152

78153
++ New features:

features/FEATURE_LWIP/lwip-interface/lwip/doc/doxygen/lwip.Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "lwIP"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = "2.0.1"
41+
PROJECT_NUMBER = "2.0.2"
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

features/FEATURE_LWIP/lwip-interface/lwip/doc/doxygen/main_page.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
* @verbinclude "UPGRADING"
2727
*/
2828

29+
/**
30+
* @page changelog Changelog
31+
* @verbinclude "CHANGELOG"
32+
*/
33+
2934
/**
3035
* @page contrib How to contribute to lwIP
3136
* @verbinclude "contrib.txt"

features/FEATURE_LWIP/lwip-interface/lwip/src/api/lwip_api_msg.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,13 @@ pcb_new(struct api_msg *msg)
562562
case NETCONN_RAW:
563563
msg->conn->pcb.raw = raw_new_ip_type(iptype, msg->msg.n.proto);
564564
if (msg->conn->pcb.raw != NULL) {
565+
#if LWIP_IPV6
566+
/* ICMPv6 packets should always have checksum calculated by the stack as per RFC 3542 chapter 3.1 */
567+
if (NETCONNTYPE_ISIPV6(msg->conn->type) && msg->conn->pcb.raw->protocol == IP6_NEXTH_ICMP6) {
568+
msg->conn->pcb.raw->chksum_reqd = 1;
569+
msg->conn->pcb.raw->chksum_offset = 2;
570+
}
571+
#endif /* LWIP_IPV6 */
565572
raw_recv(msg->conn->pcb.raw, recv_raw, msg->conn);
566573
}
567574
break;
@@ -1777,25 +1784,28 @@ lwip_netconn_do_close(void *m)
17771784
#if LWIP_NETCONN_FULLDUPLEX
17781785
if (msg->msg.sd.shut & NETCONN_SHUT_WR) {
17791786
/* close requested, abort running write */
1780-
sys_sem_t* op_completed_sem;
1787+
sys_sem_t* write_completed_sem;
17811788
LWIP_ASSERT("msg->conn->current_msg != NULL", msg->conn->current_msg != NULL);
1782-
op_completed_sem = LWIP_API_MSG_SEM(msg->conn->current_msg);
1789+
write_completed_sem = LWIP_API_MSG_SEM(msg->conn->current_msg);
17831790
msg->conn->current_msg->err = ERR_CLSD;
17841791
msg->conn->current_msg = NULL;
17851792
msg->conn->write_offset = 0;
17861793
msg->conn->state = NETCONN_NONE;
1794+
state = NETCONN_NONE;
17871795
NETCONN_SET_SAFE_ERR(msg->conn, ERR_CLSD);
1788-
sys_sem_signal(op_completed_sem);
1796+
sys_sem_signal(write_completed_sem);
17891797
} else {
17901798
LWIP_ASSERT("msg->msg.sd.shut == NETCONN_SHUT_RD", msg->msg.sd.shut == NETCONN_SHUT_RD);
17911799
/* In this case, let the write continue and do not interfere with
17921800
conn->current_msg or conn->state! */
17931801
msg->err = tcp_shutdown(msg->conn->pcb.tcp, 1, 0);
17941802
}
1803+
}
1804+
if (state == NETCONN_NONE) {
17951805
#else /* LWIP_NETCONN_FULLDUPLEX */
17961806
msg->err = ERR_INPROGRESS;
1797-
#endif /* LWIP_NETCONN_FULLDUPLEX */
17981807
} else {
1808+
#endif /* LWIP_NETCONN_FULLDUPLEX */
17991809
if (msg->msg.sd.shut & NETCONN_SHUT_RD) {
18001810
/* Drain and delete mboxes */
18011811
netconn_drain(msg->conn);

0 commit comments

Comments
 (0)