From 5a893e3005fe6ce08c264915ad763f9dcc5cfd9edf64ec8ea65199bd529472ac Mon Sep 17 00:00:00 2001 From: OBS User mrdocs Date: Sun, 7 Jan 2018 02:28:26 +0000 Subject: [PATCH] Accepting request 561856 from home:NMoreyChaisemartin:branches:network:utilities - Backport iputils-ping-fix-pmtu-for-ipv6.patch from upstream to fix PMTU discovery in ping6. (bsc#1072460) OBS-URL: https://build.opensuse.org/request/show/561856 OBS-URL: https://build.opensuse.org/package/show/network:utilities/iputils?expand=0&rev=59 --- iputils-ping-fix-pmtu-for-ipv6.patch | 61 ++++++++++++++++++++++++++++ iputils.changes | 6 +++ iputils.spec | 4 +- 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 iputils-ping-fix-pmtu-for-ipv6.patch diff --git a/iputils-ping-fix-pmtu-for-ipv6.patch b/iputils-ping-fix-pmtu-for-ipv6.patch new file mode 100644 index 0000000..cf0fffb --- /dev/null +++ b/iputils-ping-fix-pmtu-for-ipv6.patch @@ -0,0 +1,61 @@ +commit 41874d564033b071b3ee323c96ee1e6458a2ca50 +Author: Jan Synacek +Date: Mon May 15 12:07:59 2017 +0200 + + ping: fix pmtu discovery for ipv6 + + Fixes: #40 + +diff --git ping.c ping.c +index 0668a18d202f..0c8893d1ec0f 100644 +--- ping.c ++++ ping.c +@@ -108,7 +108,7 @@ int cmsg_len; + + static struct sockaddr_in source = { .sin_family = AF_INET }; + char *device; +-static int pmtudisc = -1; ++int pmtudisc = -1; + + static void create_socket(socket_st *sock, int family, int socktype, int protocol, int requisite) + { +@@ -510,8 +510,14 @@ main(int argc, char **argv) + + if (hints.ai_family != AF_INET6) + create_socket(&sock4, AF_INET, hints.ai_socktype, IPPROTO_ICMP, hints.ai_family == AF_INET); +- if (hints.ai_family != AF_INET) ++ if (hints.ai_family != AF_INET) { + create_socket(&sock6, AF_INET6, hints.ai_socktype, IPPROTO_ICMPV6, sock4.fd == -1); ++ /* This may not be needed if both protocol versions always had the same value, but ++ * since I don't know that, it's better to be safe than sorry. */ ++ pmtudisc = pmtudisc == IP_PMTUDISC_DO ? IPV6_PMTUDISC_DO : ++ pmtudisc == IP_PMTUDISC_DONT ? IPV6_PMTUDISC_DONT : ++ pmtudisc == IP_PMTUDISC_WANT ? IPV6_PMTUDISC_WANT : pmtudisc; ++ } + disable_capability_raw(); + + /* Limit address family on single-protocol systems */ +diff --git ping.h ping.h +index 749f3ff86f0b..a0986694dbc2 100644 +--- ping.h ++++ ping.h +@@ -168,6 +168,7 @@ extern volatile int status_snapshot; + extern int confirm; + extern int confirm_flag; + extern char *device; ++extern int pmtudisc; + + extern volatile int in_pr_addr; /* pr_addr() is executing */ + extern jmp_buf pr_addr_jmp; +diff --git ping6_common.c ping6_common.c +index 498e5908f50f..a2a5b230e6e1 100644 +--- ping6_common.c ++++ ping6_common.c +@@ -101,7 +101,6 @@ void ping6_usage(unsigned) __attribute((noreturn)); + + struct sockaddr_in6 source6 = { .sin6_family = AF_INET6 }; + char *device; +-int pmtudisc=-1; + + #if defined(USE_GCRYPT) || defined(USE_OPENSSL) || defined(USE_NETTLE) + #include "iputils_md5dig.h" diff --git a/iputils.changes b/iputils.changes index 3babe2c..1c09e5e 100644 --- a/iputils.changes +++ b/iputils.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Jan 5 11:11:03 UTC 2018 - nmoreychaisemartin@suse.com + +- Backport iputils-ping-fix-pmtu-for-ipv6.patch from upstream + to fix PMTU discovery in ping6. (bsc#1072460) + ------------------------------------------------------------------- Mon Dec 11 08:20:16 UTC 2017 - mpluskal@suse.com diff --git a/iputils.spec b/iputils.spec index 235487e..8159f4d 100644 --- a/iputils.spec +++ b/iputils.spec @@ -1,7 +1,7 @@ # # spec file for package iputils # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -29,6 +29,7 @@ Patch8: iputils-sec-ping-unblock.diff Patch9: iputils-ping-interrupt.diff # PATCH-FIX-UPSTREAM iputils-remove-bogus-check-required-for-2.4.9-kernels.patch tiwai@suse.de - boo#927831 Patch10: iputils-remove-bogus-check-required-for-2.4.9-kernels.patch +Patch11: iputils-ping-fix-pmtu-for-ipv6.patch BuildRequires: docbook_3 BuildRequires: iso_ent BuildRequires: libcap-devel @@ -66,6 +67,7 @@ out their IP addresses. %patch8 -p1 %patch9 -p1 %patch10 -p1 +%patch11 %build