Go to most recent revision | Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 73 | magnus | 1 | #! /bin/sh /usr/share/dpatch/dpatch-run |
| 2 | ## ipv6_v6only.dpatch by Magnus Holmgren <holmgren@debian.org> |
||
| 3 | ## |
||
| 4 | ## DP: Set the IPV6_V6ONLY socket option on AF_INET6 sockets; since |
||
| 5 | ## DP: lshd by default enumerates available address families and calls |
||
| 6 | ## DP: bind() once for each, conflicts will occur otherwise. |
||
| 7 | |||
| 8 | @DPATCH@ |
||
| 9 | diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' trunk~/src/io.c trunk/src/io.c |
||
| 10 | --- trunk~/src/io.c 2006-01-23 18:49:58.000000000 +0100 |
||
| 11 | +++ trunk/src/io.c 2010-07-27 02:17:04.000000000 +0200 |
||
| 12 | @@ -1690,6 +1690,13 @@ |
||
| 13 | { |
||
| 14 | int yes = 1; |
||
| 15 | setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char*)&yes, sizeof yes); |
||
| 16 | +#if WITH_IPV6 && defined (IPV6_V6ONLY) |
||
| 17 | + if (local->sa_family == AF_INET6) |
||
| 18 | + { |
||
| 19 | + if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, &yes, sizeof(yes)) < 0) |
||
| 20 | + werror("setsockopt IPV6_V6ONLY failed: %e.\n", errno); |
||
| 21 | + } |
||
| 22 | +#endif |
||
| 23 | } |
||
| 24 | |||
| 25 | if (bind(s, local, length) < 0) |