* debian/patches/04_function_return.patch
- Added. Ensure a value is always returned from a non-void function (From
upstream svn)
* debian/patches/05_dns_sd_dont_bump_soname.patch
- Added. Undo the bumping of the micro soname version to keep the soname
fully in sync with apple's (From upstream svn)
* debian/patches/06_dont_log_broken_packets.patch
- Added. Don't log errors from recvmsg if there caused by broken ip
packets. Fixes log flooding on machines with bad links (From
upstream svn) (Closes: #386239)
* debian/patches/07_ia64_unaligned_access.patch
- Added. Some fixes for unaligned accesses as seen on ia64 (From upstream
svn)
* debian/patches/08_unicast_ipv6_only.patch
- Added. Set the unicast ipv6 socket as ipv6 only, as the linux ipv4 in
ipv6 misses some control info (From upstream svn)
* debian/patches/09_fionread.patch
- Added. It's valid for FIONREAD so handle this instead of throwing a
warning and failing (From upstream svn)
* debian/patches/10_widearea_socket_types.patch
- Added. Only create a unicast ipv4 or ipv6 socket for widecast if
respectively ipv4 or ipv6 is enabled. (From upstream svn)
* debian/patches/12_bogus_static_host_error_message.patch
- Added. Prevent logging of bogus error message when adding static .local
hosts. (from upstream svn)
* debian/patches/13_NULL_dns_service_refs.patch
- Added. Let the bonjour compatibility layer handle NULL services
references gracefully and don't use the service reference after
unreffing it. (From upstream svn)
git-svn-id: svn+ssh://svn.debian.org/svn/pkg-utopia/packages/unstable/avahi@1208 ceb527fc-18e6-0310-9fe2-813c157c29e7
Sjoerd Simons
17 years ago
12 | 12 | - Don't run if resolvconf is installed |
13 | 13 | * debian/avahi-daemon.resolvconf |
14 | 14 | - Added. Hook script for resolvconf |
15 | ||
16 | -- Sjoerd Simons <sjoerd@debian.org> Wed, 3 Jan 2007 11:22:59 +0100 | |
15 | * debian/patches/04_function_return.patch | |
16 | - Added. Ensure a value is always returned from a non-void function (From | |
17 | upstream svn) | |
18 | * debian/patches/05_dns_sd_dont_bump_soname.patch | |
19 | - Added. Undo the bumping of the micro soname version to keep the soname | |
20 | fully in sync with apple's (From upstream svn) | |
21 | * debian/patches/06_dont_log_broken_packets.patch | |
22 | - Added. Don't log errors from recvmsg if there caused by broken ip | |
23 | packets. Fixes log flooding on machines with bad links (From | |
24 | upstream svn) (Closes: #386239) | |
25 | * debian/patches/07_ia64_unaligned_access.patch | |
26 | - Added. Some fixes for unaligned accesses as seen on ia64 (From upstream | |
27 | svn) | |
28 | * debian/patches/08_unicast_ipv6_only.patch | |
29 | - Added. Set the unicast ipv6 socket as ipv6 only, as the linux ipv4 in | |
30 | ipv6 misses some control info (From upstream svn) | |
31 | * debian/patches/09_fionread.patch | |
32 | - Added. It's valid for FIONREAD so handle this instead of throwing a | |
33 | warning and failing (From upstream svn) | |
34 | * debian/patches/10_widearea_socket_types.patch | |
35 | - Added. Only create a unicast ipv4 or ipv6 socket for widecast if | |
36 | respectively ipv4 or ipv6 is enabled. (From upstream svn) | |
37 | * debian/patches/12_bogus_static_host_error_message.patch | |
38 | - Added. Prevent logging of bogus error message when adding static .local | |
39 | hosts. (from upstream svn) | |
40 | * debian/patches/13_NULL_dns_service_refs.patch | |
41 | - Added. Let the bonjour compatibility layer handle NULL services | |
42 | references gracefully and don't use the service reference after | |
43 | unreffing it. (From upstream svn) | |
44 | ||
45 | -- Sjoerd Simons <sjoerd@debian.org> Sun, 7 Jan 2007 15:32:56 +0100 | |
17 | 46 | |
18 | 47 | avahi (0.6.16-1) unstable; urgency=low |
19 | 48 |
0 | ------------------------------------------------------------------------ | |
1 | r1353 | lathiat | 2006-12-29 13:50:03 +0100 (Fri, 29 Dec 2006) | 2 lines | |
2 | ||
3 | * Make sure we return -1 if we fall of the end of consume_labels() | |
4 | ||
5 | ------------------------------------------------------------------------ | |
6 | Index: avahi-core/dns.c | |
7 | =================================================================== | |
8 | --- avahi-core/dns.c (revision 1352) | |
9 | +++ avahi-core/dns.c (revision 1353) | |
10 | @@ -400,6 +400,8 @@ | |
11 | } else | |
12 | return -1; | |
13 | } | |
14 | + | |
15 | + return -1; | |
16 | } | |
17 | ||
18 | int avahi_dns_packet_consume_name(AvahiDnsPacket *p, char *ret_name, size_t l) { |
0 | ------------------------------------------------------------------------ | |
1 | r1354 | lathiat | 2006-12-29 13:55:23 +0100 (Fri, 29 Dec 2006) | 4 lines | |
2 | ||
3 | * Un-bump DNS-SD soname, we are following apple's version so we | |
4 | shouldn't bump it (woops) | |
5 | ||
6 | ||
7 | ------------------------------------------------------------------------ | |
8 | Index: configure.ac | |
9 | =================================================================== | |
10 | --- configure.ac (revision 1353) | |
11 | +++ configure.ac (revision 1354) | |
12 | @@ -34,7 +34,7 @@ | |
13 | AC_SUBST(LIBAVAHI_GLIB_VERSION_INFO, [1:1:0]) | |
14 | AC_SUBST(LIBAVAHI_QT3_VERSION_INFO, [1:1:0]) | |
15 | AC_SUBST(LIBAVAHI_QT4_VERSION_INFO, [1:1:0]) | |
16 | -AC_SUBST(LIBAVAHI_COMPAT_LIBDNS_SD_VERSION_INFO, [1:1:0]) | |
17 | +AC_SUBST(LIBAVAHI_COMPAT_LIBDNS_SD_VERSION_INFO, [1:0:0]) | |
18 | AC_SUBST(LIBAVAHI_COMPAT_HOWL_VERSION_INFO, [0:0:0]) | |
19 | AC_SUBST(HOWL_COMPAT_VERSION, [0.9.8]) | |
20 |
0 | ------------------------------------------------------------------------ | |
1 | r1361 | lennart | 2006-12-31 18:33:57 +0100 (Sun, 31 Dec 2006) | 2 lines | |
2 | ||
3 | Ignore EAGAIN errors on recvmsg() (Closes #60) | |
4 | ||
5 | ------------------------------------------------------------------------ | |
6 | Index: avahi-core/socket.c | |
7 | =================================================================== | |
8 | --- avahi-core/socket.c (revision 1360) | |
9 | +++ avahi-core/socket.c (revision 1361) | |
10 | @@ -635,6 +635,9 @@ | |
11 | goto fail; | |
12 | } | |
13 | ||
14 | + if (ms <= 0) | |
15 | + goto fail; | |
16 | + | |
17 | p = avahi_dns_packet_new(ms + AVAHI_DNS_PACKET_EXTRA_SIZE); | |
18 | ||
19 | io.iov_base = AVAHI_DNS_PACKET_DATA(p); | |
20 | @@ -650,7 +653,14 @@ | |
21 | msg.msg_flags = 0; | |
22 | ||
23 | if ((l = recvmsg(fd, &msg, 0)) < 0) { | |
24 | - avahi_log_warn("recvmsg(): %s", strerror(errno)); | |
25 | + /* Linux returns EAGAIN when an invalid IP packet has been | |
26 | + recieved. We suppress warnings in this case because this might | |
27 | + create quite a bit of log traffic on machines with unstable | |
28 | + links. (See #60) */ | |
29 | + | |
30 | + if (errno != EAGAIN) | |
31 | + avahi_log_warn("recvmsg(): %s", strerror(errno)); | |
32 | + | |
33 | goto fail; | |
34 | } | |
35 | ||
36 | @@ -768,6 +778,9 @@ | |
37 | avahi_log_warn("ioctl(): %s", strerror(errno)); | |
38 | goto fail; | |
39 | } | |
40 | + | |
41 | + if (ms <= 0) | |
42 | + goto fail; | |
43 | ||
44 | p = avahi_dns_packet_new(ms + AVAHI_DNS_PACKET_EXTRA_SIZE); | |
45 | ||
46 | @@ -785,7 +798,14 @@ | |
47 | msg.msg_flags = 0; | |
48 | ||
49 | if ((l = recvmsg(fd, &msg, 0)) < 0) { | |
50 | - avahi_log_warn("recvmsg(): %s", strerror(errno)); | |
51 | + /* Linux returns EAGAIN when an invalid IP packet has been | |
52 | + recieved. We suppress warnings in this case because this might | |
53 | + create quite a bit of log traffic on machines with unstable | |
54 | + links. (See #60) */ | |
55 | + | |
56 | + if (errno != EAGAIN) | |
57 | + avahi_log_warn("recvmsg(): %s", strerror(errno)); | |
58 | + | |
59 | goto fail; | |
60 | } | |
61 |
0 | ------------------------------------------------------------------------ | |
1 | r1363 | lennart | 2007-01-05 00:53:39 +0100 (Fri, 05 Jan 2007) | 1 line | |
2 | ||
3 | Some more ia64 fixes. (Closes #90) | |
4 | ------------------------------------------------------------------------ | |
5 | Index: avahi-core/socket.c | |
6 | =================================================================== | |
7 | --- avahi-core/socket.c (revision 1362) | |
8 | +++ avahi-core/socket.c (revision 1363) | |
9 | @@ -475,10 +475,10 @@ | |
10 | struct iovec io; | |
11 | #ifdef IP_PKTINFO | |
12 | struct cmsghdr *cmsg; | |
13 | - uint8_t cmsg_data[CMSG_SPACE(sizeof(struct in_pktinfo))]; | |
14 | + size_t cmsg_data[( CMSG_SPACE(sizeof(struct in_pktinfo)) / sizeof(size_t)) + 1]; | |
15 | #elif defined(IP_SENDSRCADDR) | |
16 | struct cmsghdr *cmsg; | |
17 | - uint8_t cmsg_data[CMSG_SPACE(sizeof(struct in_addr))]; | |
18 | + size_t cmsg_data[( CMSG_SPACE(sizeof(struct in_addr)) / sizeof(size_t)) + 1]; | |
19 | #endif | |
20 | ||
21 | assert(fd >= 0); | |
22 | @@ -565,7 +565,7 @@ | |
23 | struct msghdr msg; | |
24 | struct iovec io; | |
25 | struct cmsghdr *cmsg; | |
26 | - uint8_t cmsg_data[CMSG_SPACE(sizeof(struct in6_pktinfo))]; | |
27 | + size_t cmsg_data[(CMSG_SPACE(sizeof(struct in6_pktinfo))/sizeof(size_t)) + 1]; | |
28 | ||
29 | assert(fd >= 0); | |
30 | assert(p); |
0 | ------------------------------------------------------------------------ | |
1 | r1370 | lennart | 2007-01-06 17:10:01 +0100 (Sat, 06 Jan 2007) | 3 lines | |
2 | ||
3 | * set IPV6_V6ONLY for unicast DNS sockets, too | |
4 | ||
5 | ------------------------------------------------------------------------ | |
6 | Index: avahi-core/socket.c | |
7 | =================================================================== | |
8 | --- avahi-core/socket.c (revision 1369) | |
9 | +++ avahi-core/socket.c (revision 1370) | |
10 | @@ -912,13 +937,19 @@ | |
11 | ||
12 | int avahi_open_unicast_socket_ipv6(void) { | |
13 | struct sockaddr_in6 local; | |
14 | - int fd = -1; | |
15 | + int fd = -1, yes; | |
16 | ||
17 | if ((fd = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { | |
18 | avahi_log_warn("socket() failed: %s", strerror(errno)); | |
19 | goto fail; | |
20 | } | |
21 | ||
22 | + yes = 1; | |
23 | + if (setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &yes, sizeof(yes)) < 0) { | |
24 | + avahi_log_warn("IPV6_V6ONLY failed: %s", strerror(errno)); | |
25 | + goto fail; | |
26 | + } | |
27 | + | |
28 | memset(&local, 0, sizeof(local)); | |
29 | local.sin6_family = AF_INET6; | |
30 |
0 | r1370 | lennart | 2007-01-06 17:10:01 +0100 (Sat, 06 Jan 2007) | 3 lines | |
1 | ||
2 | * print a warning when FIONREAD returns an invalid size | |
3 | ||
4 | Index: avahi-core/socket.c | |
5 | =================================================================== | |
6 | --- avahi-core/socket.c (revision 1369) | |
7 | +++ avahi-core/socket.c (revision 1370) | |
8 | @@ -635,8 +649,10 @@ | |
9 | goto fail; | |
10 | } | |
11 | ||
12 | - if (ms <= 0) | |
13 | + if (ms < 0) { | |
14 | + avahi_log_warn("FIONREAD returned negative value."); | |
15 | goto fail; | |
16 | + } | |
17 | ||
18 | p = avahi_dns_packet_new(ms + AVAHI_DNS_PACKET_EXTRA_SIZE); | |
19 | ||
20 | @@ -779,8 +802,10 @@ | |
21 | goto fail; | |
22 | } | |
23 | ||
24 | - if (ms <= 0) | |
25 | + if (ms < 0) { | |
26 | + avahi_log_warn("FIONREAD returned negative value."); | |
27 | goto fail; | |
28 | + } | |
29 | ||
30 | p = avahi_dns_packet_new(ms + AVAHI_DNS_PACKET_EXTRA_SIZE); | |
31 |
0 | ------------------------------------------------------------------------ | |
1 | r1371 | lennart | 2007-01-06 17:10:47 +0100 (Sat, 06 Jan 2007) | 2 lines | |
2 | ||
3 | create unicast IPv4 socket oly if IPv4 is enabled, same for unicast IPv6 | |
4 | ||
5 | ------------------------------------------------------------------------ | |
6 | Index: avahi-core/wide-area.c | |
7 | =================================================================== | |
8 | --- avahi-core/wide-area.c (revision 1370) | |
9 | +++ avahi-core/wide-area.c (revision 1371) | |
10 | @@ -579,8 +579,8 @@ | |
11 | e->cleanup_dead = 0; | |
12 | ||
13 | /* Create sockets */ | |
14 | - e->fd_ipv4 = avahi_open_unicast_socket_ipv4(); | |
15 | - e->fd_ipv6 = avahi_open_unicast_socket_ipv6(); | |
16 | + e->fd_ipv4 = s->config.use_ipv4 ? avahi_open_unicast_socket_ipv4() : -1; | |
17 | + e->fd_ipv6 = s->config.use_ipv6 ? avahi_open_unicast_socket_ipv6() : -1; | |
18 | ||
19 | if (e->fd_ipv4 < 0 && e->fd_ipv6 < 0) { | |
20 | avahi_log_error(__FILE__": Failed to create wide area sockets: %s", strerror(errno)); |
0 | --- avahi-daemon/static-hosts.c.orig 2006-12-26 11:42:17.000000000 +0100 | |
1 | +++ avahi-daemon/static-hosts.c 2007-01-07 19:18:27.000000000 +0100 | |
2 | @@ -114,7 +114,7 @@ | |
3 | ||
4 | if (!h->group) | |
5 | if (!(h->group = avahi_s_entry_group_new (avahi_server, entry_group_callback, h))) { | |
6 | - avahi_log_error("avahi_s_entry_group_new() failed: %s", avahi_strerror(err)); | |
7 | + avahi_log_error("avahi_s_entry_group_new() failed: %s", avahi_strerror(avahi_server_errno(avahi_server))); | |
8 | return; | |
9 | } | |
10 | ||
11 | @@ -123,7 +123,7 @@ | |
12 | return; | |
13 | } | |
14 | ||
15 | - if ((err = avahi_server_add_address(avahi_server, h->group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, h->host, &a))) { | |
16 | + if ((err = avahi_server_add_address(avahi_server, h->group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, h->host, &a)) < 0) { | |
17 | avahi_log_error ("Static host name %s: avahi_server_add_address failure: %s", h->host, avahi_strerror(err)); | |
18 | return; | |
19 | } |
0 | ------------------------------------------------------------------------ | |
1 | r1374 | lennart | 2007-01-06 17:51:42 +0100 (Sat, 06 Jan 2007) | 3 lines | |
2 | ||
3 | * handle NULL sdrefs gracefully. | |
4 | * fix mutex locking order in DNSProcessResult | |
5 | ||
6 | ------------------------------------------------------------------------ | |
7 | Index: avahi-compat-libdns_sd/compat.c | |
8 | =================================================================== | |
9 | --- avahi-compat-libdns_sd/compat.c (revision 1373) | |
10 | +++ avahi-compat-libdns_sd/compat.c (revision 1374) | |
11 | @@ -469,25 +469,26 @@ | |
12 | } | |
13 | ||
14 | int DNSSD_API DNSServiceRefSockFD(DNSServiceRef sdref) { | |
15 | + | |
16 | + AVAHI_WARN_LINKAGE; | |
17 | + | |
18 | if (!sdref || sdref->n_ref <= 0) | |
19 | return -1; | |
20 | ||
21 | - AVAHI_WARN_LINKAGE; | |
22 | - | |
23 | return sdref->main_fd; | |
24 | } | |
25 | ||
26 | DNSServiceErrorType DNSSD_API DNSServiceProcessResult(DNSServiceRef sdref) { | |
27 | DNSServiceErrorType ret = kDNSServiceErr_Unknown; | |
28 | ||
29 | - assert(sdref); | |
30 | - assert(sdref->n_ref >= 1); | |
31 | - | |
32 | AVAHI_WARN_LINKAGE; | |
33 | ||
34 | + if (!sdref || sdref->n_ref <= 0) | |
35 | + return kDNSServiceErr_BadParam; | |
36 | + | |
37 | + sdref_ref(sdref); | |
38 | + | |
39 | ASSERT_SUCCESS(pthread_mutex_lock(&sdref->mutex)); | |
40 | - | |
41 | - sdref_ref(sdref); | |
42 | ||
43 | /* Cleanup notification socket */ | |
44 | if (read_command(sdref->main_fd) != COMMAND_POLL_DONE) | |
45 | @@ -512,10 +513,10 @@ | |
46 | ||
47 | finish: | |
48 | ||
49 | + ASSERT_SUCCESS(pthread_mutex_unlock(&sdref->mutex)); | |
50 | + | |
51 | sdref_unref(sdref); | |
52 | ||
53 | - ASSERT_SUCCESS(pthread_mutex_unlock(&sdref->mutex)); | |
54 | - | |
55 | return ret; | |
56 | } | |
57 | ||
58 | @@ -613,7 +614,6 @@ | |
59 | ||
60 | if (!ret_sdref) | |
61 | return kDNSServiceErr_BadParam; | |
62 | - | |
63 | *ret_sdref = NULL; | |
64 | ||
65 | assert(regtype); | |
66 | @@ -739,7 +739,10 @@ | |
67 | ||
68 | AVAHI_WARN_LINKAGE; | |
69 | ||
70 | - assert(ret_sdref); | |
71 | + if (!ret_sdref) | |
72 | + return kDNSServiceErr_BadParam; | |
73 | + *ret_sdref = NULL; | |
74 | + | |
75 | assert(name); | |
76 | assert(regtype); | |
77 | assert(domain); | |
78 | @@ -853,7 +856,10 @@ | |
79 | ||
80 | AVAHI_WARN_LINKAGE; | |
81 | ||
82 | - assert(ret_sdref); | |
83 | + if (!ret_sdref) | |
84 | + return kDNSServiceErr_BadParam; | |
85 | + *ret_sdref = NULL; | |
86 | + | |
87 | assert(callback); | |
88 | ||
89 | if (interface == kDNSServiceInterfaceIndexLocalOnly || | |
90 | @@ -1096,7 +1102,6 @@ | |
91 | ||
92 | if (!ret_sdref) | |
93 | return kDNSServiceErr_BadParam; | |
94 | - | |
95 | *ret_sdref = NULL; | |
96 | ||
97 | if (!regtype) | |
98 | @@ -1210,10 +1215,12 @@ | |
99 | ||
100 | int ret = kDNSServiceErr_Unknown; | |
101 | AvahiStringList *txt = NULL; | |
102 | - assert(sdref); | |
103 | ||
104 | AVAHI_WARN_LINKAGE; | |
105 | ||
106 | + if (!sdref || sdref->n_ref <= 0) | |
107 | + return kDNSServiceErr_BadParam; | |
108 | + | |
109 | if (flags || rref) { | |
110 | AVAHI_WARN_UNSUPPORTED; | |
111 | return kDNSServiceErr_Unsupported; |