Rev 73 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 73 | Rev 78 | ||
---|---|---|---|
1 | #! /bin/sh /usr/share/dpatch/dpatch-run |
1 | #! /bin/sh /usr/share/dpatch/dpatch-run |
2 | ## ipv6_v6only.dpatch by Magnus Holmgren <holmgren@debian.org> |
2 | ## ipv6_v6only.dpatch by Magnus Holmgren <holmgren@debian.org> |
3 | ## |
3 | ## |
4 | ## DP: Set the IPV6_V6ONLY socket option on AF_INET6 sockets; since |
4 | ## DP: Set the IPV6_V6ONLY socket option on AF_INET6 sockets; since |
5 | ## DP: lshd by default enumerates available address families and calls |
5 | ## DP: lshd by default enumerates available address families and calls |
6 | ## DP: bind() once for each, conflicts will occur otherwise. |
6 | ## DP: bind() once for each, conflicts will occur otherwise. |
7 | 7 | ||
8 | @DPATCH@ |
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 |
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 |
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 |
11 | +++ trunk/src/io.c 2010-07-27 02:17:04.000000000 +0200 |
12 | @@ -1690,6 +1690,13 @@ |
12 | @@ -1690,6 +1690,13 @@ |
13 | { |
13 | { |
14 | int yes = 1; |
14 | int yes = 1; |
15 | setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char*)&yes, sizeof yes); |
15 | setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char*)&yes, sizeof yes); |
16 | +#if WITH_IPV6 && defined (IPV6_V6ONLY) |
16 | +#if WITH_IPV6 && defined (IPV6_V6ONLY) |
17 | + if (local->sa_family == AF_INET6) |
17 | + if (local->sa_family == AF_INET6) |
18 | + { |
18 | + { |
19 | + if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, &yes, sizeof(yes)) < 0) |
19 | + if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, &yes, sizeof(yes)) < 0) |
20 | + werror("setsockopt IPV6_V6ONLY failed: %e.\n", errno); |
20 | + werror("setsockopt IPV6_V6ONLY failed: %e.\n", errno); |
21 | + } |
21 | + } |
22 | +#endif |
22 | +#endif |
23 | } |
23 | } |
24 | 24 | ||
25 | if (bind(s, local, length) < 0) |
25 | if (bind(s, local, length) < 0) |