Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.1
iputils
iputils-ping-fix-pmtu-for-ipv6.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File iputils-ping-fix-pmtu-for-ipv6.patch of Package iputils
commit 41874d564033b071b3ee323c96ee1e6458a2ca50 Author: Jan Synacek <jsynacek@redhat.com> 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"
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor