"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "getifaddr.c" between
minidlna-1.2.1.tar.gz and minidlna-1.3.0.tar.gz

About: ReadyMedia (formerly known as MiniDLNA) is a simple media server software, with the aim of being fully compliant with DLNA/UPnP-AV clients.

getifaddr.c  (minidlna-1.2.1):getifaddr.c  (minidlna-1.3.0)
skipping to change at line 46 skipping to change at line 46
#include <net/if.h> #include <net/if.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <netdb.h> #include <netdb.h>
#include <errno.h> #include <errno.h>
#if defined(sun) #if defined(sun)
#include <sys/sockio.h> #include <sys/sockio.h>
#endif #endif
#include "config.h" #include "config.h"
#include "event.h"
#if HAVE_GETIFADDRS #if HAVE_GETIFADDRS
# include <ifaddrs.h> # include <ifaddrs.h>
# ifdef __linux__ # ifdef __linux__
# ifndef AF_LINK # ifndef AF_LINK
# define AF_LINK AF_INET # define AF_LINK AF_INET
# endif # endif
# else # else
# include <net/if_dl.h> # include <net/if_dl.h>
# endif # endif
# ifndef IFF_SLAVE # ifndef IFF_SLAVE
skipping to change at line 207 skipping to change at line 208
fd = socket(AF_INET, SOCK_DGRAM, 0); fd = socket(AF_INET, SOCK_DGRAM, 0);
if (fd < 0) if (fd < 0)
continue; continue;
strncpy(ifr.ifr_name, p->ifa_name, IFNAMSIZ); strncpy(ifr.ifr_name, p->ifa_name, IFNAMSIZ);
ret = ioctl(fd, SIOCGIFHWADDR, &ifr); ret = ioctl(fd, SIOCGIFHWADDR, &ifr);
close(fd); close(fd);
if (ret < 0) if (ret < 0)
continue; continue;
memcpy(mac, ifr.ifr_hwaddr.sa_data, 6); memcpy(mac, ifr.ifr_hwaddr.sa_data, 6);
#else #else
if (p->ifa_addr->sa_family != AF_LINK)
continue;
struct sockaddr_dl *sdl; struct sockaddr_dl *sdl;
sdl = (struct sockaddr_dl*)p->ifa_addr; sdl = (struct sockaddr_dl*)p->ifa_addr;
memcpy(mac, LLADDR(sdl), sdl->sdl_alen); if (sdl->sdl_alen != 6)
continue;
memcpy(mac, LLADDR(sdl), 6);
#endif #endif
if (MACADDR_IS_ZERO(mac)) if (MACADDR_IS_ZERO(mac))
continue; continue;
ret = 0; ret = 0;
break; break;
} }
} }
freeifaddrs(ifap); freeifaddrs(ifap);
#else #else
struct if_nameindex *ifaces, *if_idx; struct if_nameindex *ifaces, *if_idx;
skipping to change at line 380 skipping to change at line 385
return -1; return -1;
} }
return s; return s;
#else #else
return -1; return -1;
#endif #endif
} }
void void
ProcessMonitorEvent(int s) ProcessMonitorEvent(struct event *ev)
{ {
#ifdef HAVE_NETLINK #ifdef HAVE_NETLINK
int s = ev->fd;
int len; int len;
char buf[4096]; char buf[4096];
struct nlmsghdr *nlh; struct nlmsghdr *nlh;
int changed = 0; int changed = 0;
nlh = (struct nlmsghdr*)buf; nlh = (struct nlmsghdr*)buf;
len = recv(s, nlh, sizeof(buf), 0); len = recv(s, nlh, sizeof(buf), 0);
if (len <= 0) if (len <= 0)
return; return;
 End of changes. 5 change blocks. 
2 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)