X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-core%2Fsocket.c;h=0487023dd9f68bb4106672cf1f6874fb77e5be60;hb=9aa4773acbfadbcf95aaf0063510f8be8ddcbd86;hp=b3bdac23a226d276c3c71a493bd42574421eb0e9;hpb=cd8fbe0eae35f5edd72b1265efd2b2145c3fae43;p=catta diff --git a/avahi-core/socket.c b/avahi-core/socket.c index b3bdac2..0487023 100644 --- a/avahi-core/socket.c +++ b/avahi-core/socket.c @@ -292,7 +292,7 @@ static int ipv6_pktinfo(int fd) { int avahi_open_socket_ipv4(int no_reuse) { struct sockaddr_in local; - int fd = -1, r; + int fd = -1, r, ittl; uint8_t ttl, cyes; if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { @@ -306,8 +306,8 @@ int avahi_open_socket_ipv4(int no_reuse) { goto fail; } - ttl = 255; - if (setsockopt(fd, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl)) < 0) { + ittl = 255; + if (setsockopt(fd, IPPROTO_IP, IP_TTL, &ittl, sizeof(ittl)) < 0) { avahi_log_warn("IP_TTL failed: %s", strerror(errno)); goto fail; } @@ -491,10 +491,11 @@ int avahi_send_dns_packet_ipv4(int fd, int interface, AvahiDnsPacket *p, const A msg.msg_control = cmsg_data; msg.msg_controllen = sizeof(cmsg_data); } +#else +#ifdef __GNUC__ +#warning "FIXME: We need some code to set the outgoing interface here if IP_PKTINFO is not available" +#endif #endif - - /** FIXME: We need some code to set the outgoing interface here if - * IP_PKTINFO is not available */ return sendmsg_loop(fd, &msg, 0); } @@ -678,7 +679,6 @@ AvahiDnsPacket* avahi_recv_dns_packet_ipv6(int fd, struct sockaddr_in6 *ret_sa, uint8_t aux[64]; ssize_t l; int ms; - struct cmsghdr *cmsg; int found_ttl = 0, found_iface = 0;