Skip to content

Commit bfe13cc

Browse files
committed
patch 8.2.0557: no IPv6 support for channels
Problem: No IPv6 support for channels. Solution: Add IPv6 support. (Ozaki Kiichi, closes #5893)
1 parent c5f1ef5 commit bfe13cc

21 files changed

+546
-192
lines changed

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ _anchors:
6262
sudo update-alternatives --install /usr/bin/lua lua /usr/bin/lua5.3 10
6363
fi
6464
before_script:
65-
# On travis bionic-amd64 gethostbyname() resolves "localhost" to 127.0.1.1
66-
# so that makes various channel tests fail.
67-
- sudo sed -i '/^127\.0\.1\.1\s/s/\blocalhost\b//g' /etc/hosts
65+
- sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0
6866
- sudo bash ci/load-snd-dummy.sh || true
6967
- sudo usermod -a -G audio $USER
7068
- do_test() { sg audio "sg $(id -gn) '$*'"; }

runtime/doc/channel.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ Use |ch_status()| to see if the channel could be opened.
120120

121121
{address} has the form "hostname:port". E.g., "localhost:8765".
122122

123+
When using an IPv6 address, enclose it within square brackets. E.g.,
124+
"[2001:db8::1]:8765".
125+
123126
{options} is a dictionary with optional entries: *channel-open-options*
124127

125128
"mode" can be: *channel-mode*
@@ -621,6 +624,9 @@ ch_open({address} [, {options}]) *ch_open()*
621624
{address} has the form "hostname:port", e.g.,
622625
"localhost:8765".
623626

627+
When using an IPv6 address, enclose it within square brackets.
628+
E.g., "[2001:db8::1]:8765".
629+
624630
If {options} is given it must be a |Dictionary|.
625631
See |channel-open-options|.
626632

runtime/doc/various.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ m *+hangul_input* Hangul input support |hangul|
375375
*+iconv* Compiled with the |iconv()| function
376376
*+iconv/dyn* Likewise |iconv-dynamic| |/dyn|
377377
T *+insert_expand* |insert_expand| Insert mode completion
378+
m *+ipv6* Support for IPv6 networking |channel|
378379
m *+job* starting and stopping jobs |job|
379380
S *+jumplist* |jumplist|
380381
B *+keymap* |'keymap'|

src/Make_cyg_ming.mak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ endif
850850

851851
ifeq ($(CHANNEL),yes)
852852
OBJ += $(OUTDIR)/channel.o
853-
LIB += -lwsock32
853+
LIB += -lwsock32 -lws2_32
854854
endif
855855

856856
ifeq ($(DIRECTX),yes)

src/Make_mvc.mak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ CHANNEL_PRO = proto/channel.pro
469469
CHANNEL_OBJ = $(OBJDIR)/channel.obj
470470
CHANNEL_DEFS = -DFEAT_JOB_CHANNEL
471471

472-
NETBEANS_LIB = WSock32.lib
472+
NETBEANS_LIB = WSock32.lib Ws2_32.lib
473473
!endif
474474

475475
# Set which version of the CRT to use

src/auto/configure

Lines changed: 69 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7723,8 +7723,7 @@ $as_echo "yes" >&6; }
77237723
fi
77247724

77257725
if test "$enable_channel" = "yes"; then
7726-
7727-
if test "x$HAIKU" = "xyes"; then
7726+
if test "x$HAIKU" = "xyes"; then
77287727
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lnetwork" >&5
77297728
$as_echo_n "checking for socket in -lnetwork... " >&6; }
77307729
if ${ac_cv_lib_network_socket+:} false; then :
@@ -7818,7 +7817,63 @@ fi
78187817

78197818
fi
78207819

7821-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
7820+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiling with IPv6 networking is possible" >&5
7821+
$as_echo_n "checking whether compiling with IPv6 networking is possible... " >&6; }
7822+
if ${vim_cv_ipv6_networking+:} false; then :
7823+
$as_echo_n "(cached) " >&6
7824+
else
7825+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7826+
/* end confdefs.h. */
7827+
7828+
#include <stdio.h>
7829+
#include <stdlib.h>
7830+
#include <stdarg.h>
7831+
#include <fcntl.h>
7832+
#include <netdb.h>
7833+
#include <netinet/in.h>
7834+
#include <errno.h>
7835+
#include <sys/types.h>
7836+
#include <sys/socket.h>
7837+
/* Check bitfields */
7838+
struct nbbuf {
7839+
unsigned int initDone:1;
7840+
unsigned short signmaplen;
7841+
};
7842+
7843+
int
7844+
main ()
7845+
{
7846+
7847+
/* Check creating a socket. */
7848+
struct sockaddr_in server;
7849+
struct addrinfo *res;
7850+
(void)socket(AF_INET, SOCK_STREAM, 0);
7851+
(void)htons(100);
7852+
(void)getaddrinfo("microsoft.com", NULL, NULL, &res);
7853+
if (errno == ECONNREFUSED)
7854+
(void)connect(1, (struct sockaddr *)&server, sizeof(server));
7855+
(void)freeaddrinfo(res);
7856+
7857+
;
7858+
return 0;
7859+
}
7860+
_ACEOF
7861+
if ac_fn_c_try_link "$LINENO"; then :
7862+
vim_cv_ipv6_networking="yes"
7863+
else
7864+
vim_cv_ipv6_networking="no"
7865+
fi
7866+
rm -f core conftest.err conftest.$ac_objext \
7867+
conftest$ac_exeext conftest.$ac_ext
7868+
fi
7869+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_ipv6_networking" >&5
7870+
$as_echo "$vim_cv_ipv6_networking" >&6; }
7871+
7872+
if test "x$vim_cv_ipv6_networking" = "xyes"; then
7873+
$as_echo "#define FEAT_IPV6 1" >>confdefs.h
7874+
7875+
else
7876+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
78227877
$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
78237878
if ${ac_cv_lib_nsl_gethostbyname+:} false; then :
78247879
$as_echo_n "(cached) " >&6
@@ -7863,8 +7918,11 @@ _ACEOF
78637918

78647919
fi
78657920

7866-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiling with process communication is possible" >&5
7867-
$as_echo_n "checking whether compiling with process communication is possible... " >&6; }
7921+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiling with IPv4 networking is possible" >&5
7922+
$as_echo_n "checking whether compiling with IPv4 networking is possible... " >&6; }
7923+
if ${vim_cv_ipv4_networking+:} false; then :
7924+
$as_echo_n "(cached) " >&6
7925+
else
78687926
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
78697927
/* end confdefs.h. */
78707928
@@ -7900,15 +7958,17 @@ main ()
79007958
}
79017959
_ACEOF
79027960
if ac_fn_c_try_link "$LINENO"; then :
7903-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7904-
$as_echo "yes" >&6; }
7961+
vim_cv_ipv4_networking="yes"
79057962
else
7906-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7907-
$as_echo "no" >&6; }; enable_netbeans="no"; enable_channel="no"
7963+
vim_cv_ipv4_networking="no"; enable_netbeans="no"; enable_channel="no"
79087964
fi
79097965
rm -f core conftest.err conftest.$ac_objext \
79107966
conftest$ac_exeext conftest.$ac_ext
79117967
fi
7968+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_ipv4_networking" >&5
7969+
$as_echo "$vim_cv_ipv4_networking" >&6; }
7970+
fi
7971+
fi
79127972
if test "$enable_netbeans" = "yes"; then
79137973
$as_echo "#define FEAT_NETBEANS_INTG 1" >>confdefs.h
79147974

0 commit comments

Comments
 (0)