diff options
author | Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp> | 2019-07-10 15:07:37 +0900 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2019-08-01 10:57:57 +0400 |
commit | 09d410adbff5422b7ba7596bce0ca71f9f807ea9 (patch) | |
tree | 65e4ad7ec659bdb091acd65382f58851d7cdd9de /src/ip6_icmp.c | |
parent | ac916a56bedf449e481c4dc1cda192ca386ff939 (diff) | |
download | slirp-09d410adbff5422b7ba7596bce0ca71f9f807ea9.zip slirp-09d410adbff5422b7ba7596bce0ca71f9f807ea9.tar.gz slirp-09d410adbff5422b7ba7596bce0ca71f9f807ea9.tar.bz2 |
allow custom MTU
From https://github.com/rootless-containers/slirp4netns/blob/4889f5299f407d7d7566c76a3b8b5f71c99b6db5/qemu_patches/0002-slirp-allow-custom-MTU.patch
Original commits:
* https://github.com/rootless-containers/slirp4netns/commit/ea630a7e945cf538184ff1b1b4bd7b8ddc01993e
* https://github.com/rootless-containers/slirp4netns/commit/1508a66c93c223555f08651592dde3d2d708b166
* https://github.com/rootless-containers/slirp4netns/commit/19f3f41df4066d6103e6f882500e24db7ea7d9e1
* https://github.com/rootless-containers/slirp4netns/commit/a11abedafcc627ef0657999e63b211b0f26d4c02
* https://github.com/rootless-containers/slirp4netns/commit/2adbd7c449944d3b837164c86eedd3dcabbba1a6
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
Diffstat (limited to 'src/ip6_icmp.c')
-rw-r--r-- | src/ip6_icmp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ip6_icmp.c b/src/ip6_icmp.c index 8512686..28ec2be 100644 --- a/src/ip6_icmp.c +++ b/src/ip6_icmp.c @@ -94,8 +94,8 @@ void icmp6_send_error(struct mbuf *m, uint8_t type, uint8_t code) DEBUG_ARG("target = %s", addrstr); rip->ip_nh = IPPROTO_ICMPV6; - const int error_data_len = - MIN(m->m_len, IF_MTU - (sizeof(struct ip6) + ICMP6_ERROR_MINLEN)); + const int error_data_len = MIN( + m->m_len, slirp->if_mtu - (sizeof(struct ip6) + ICMP6_ERROR_MINLEN)); rip->ip_pl = htons(ICMP6_ERROR_MINLEN + error_data_len); t->m_len = sizeof(struct ip6) + ntohs(rip->ip_pl); @@ -112,7 +112,7 @@ void icmp6_send_error(struct mbuf *m, uint8_t type, uint8_t code) ricmp->icmp6_err.unused = 0; break; case ICMP6_TOOBIG: - ricmp->icmp6_err.mtu = htonl(IF_MTU); + ricmp->icmp6_err.mtu = htonl(slirp->if_mtu); break; case ICMP6_PARAMPROB: /* TODO: Handle this case */ |