]> granicus.if.org Git - libevent/commit
listener: ipv6only socket bind support
authorMurat Demirten <mdemirten@yh.com.tr>
Mon, 4 Jun 2018 13:43:34 +0000 (16:43 +0300)
committerAzat Khuzhin <azat@libevent.org>
Sat, 2 Feb 2019 12:18:00 +0000 (15:18 +0300)
commitba14879661ed3499013f85a3df3fe6be02ae52d1
tree419719e075812dadf00a6c112552fac527425ab4
parentb07e43e607f34d8a1592a03172941bc4d9b429b7
listener: ipv6only socket bind support

According to RFC3493 and most Linux distributions, default value is to
work in IPv4-mapped mode. If there is a requirement to bind same port
on same ip addresses but different handlers for both IPv4 and IPv6,
it is required to set IPV6_V6ONLY socket option to be sure that the
code works as expected without affected by bindv6only sysctl setting
in system.

See an example working with this patch:
https://gist.github.com/demirten/023008a63cd966e48b0ebcf9af7fc113

Closes: #640 (cherry-pick)
(cherry picked from commit 387d91f9ab95df8ac3d7bb58493310ad4a377dcf)
evutil.c
include/event2/listener.h
include/event2/util.h
listener.c