avahi is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
avahi is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
avahi is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
Public License for more details.
avahi is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with avahi; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
You should have received a copy of the GNU Lesser General Public
License along with avahi; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
if ((bytes = recvmsg(nl->fd, &smsg, 0)) < 0) {
if (errno == EAGAIN || errno == EINTR)
return 0;
if ((bytes = recvmsg(nl->fd, &smsg, 0)) < 0) {
if (errno == EAGAIN || errno == EINTR)
return 0;
avahi_log_error(__FILE__": recvmsg() failed: %s", strerror(errno));
return -1;
}
cmsg = CMSG_FIRSTHDR(&smsg);
avahi_log_error(__FILE__": recvmsg() failed: %s", strerror(errno));
return -1;
}
cmsg = CMSG_FIRSTHDR(&smsg);
- if (cmsg == NULL || cmsg->cmsg_type != SCM_CREDENTIALS) {
- avahi_log_error("No sender credentials received, ignoring data.");
+ if (!cmsg || cmsg->cmsg_type != SCM_CREDENTIALS) {
+ avahi_log_warn("No sender credentials received, ignoring data.");
for (; bytes > 0; p = NLMSG_NEXT(p, bytes)) {
if (!NLMSG_OK(p, (size_t) bytes)) {
avahi_log_warn(__FILE__": packet truncated");
return -1;
}
for (; bytes > 0; p = NLMSG_NEXT(p, bytes)) {
if (!NLMSG_OK(p, (size_t) bytes)) {
avahi_log_warn(__FILE__": packet truncated");
return -1;
}
memset(&addr, 0, sizeof(addr));
addr.nl_family = AF_NETLINK;
addr.nl_groups = groups;
memset(&addr, 0, sizeof(addr));
addr.nl_family = AF_NETLINK;
addr.nl_groups = groups;
if (bind(fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
avahi_log_error(__FILE__": bind(): %s", strerror(errno));
if (bind(fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
avahi_log_error(__FILE__": bind(): %s", strerror(errno));
}
if (setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)) < 0) {
}
if (setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)) < 0) {