The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
Changes 03
Interface.pm 11
Interface.xs 58
META.yml 22
4 files changed (This is a version diff) 814
@@ -1,4 +1,7 @@
 Revision history for Perl extension IO::Interface.
+1.07    Sun Jun  8 21:29:58 EDT 2014
+	Apply patch from Miolaj Kucharski to fix segfault on OpenBSD.	
+
 1.06    Thu Jul 21 13:40:49 EDT 2011
         Address test 5 failure on systems with aliases on loopback.        
 
@@ -28,7 +28,7 @@ my @flags     = qw(IFF_ALLMULTI    IFF_AUTOMEDIA  IFF_BROADCAST
 @EXPORT = qw( );
 
 @ISA = qw(Exporter DynaLoader);
-$VERSION = '1.06';
+$VERSION = '1.07';
 
 sub AUTOLOAD {
     # This AUTOLOAD is used to 'autoload' constants from the constant()
@@ -566,7 +566,7 @@ if_hwaddr(sock, name, ...)
      IOCTL_CMD_T    operation;
      struct ifreq   ifr;
 #if (defined(USE_GETIFADDRS) && defined(HAVE_SOCKADDR_DL_STRUCT))
-     struct ifaddrs* ifap = NULL;
+     struct ifaddrs *ifap, *ifa;
      struct sockaddr_dl* sdl;
      sa_family_t  family;
      char *sdlname, *haddr, *s;
@@ -583,11 +583,11 @@ if_hwaddr(sock, name, ...)
      getifaddrs(&ifap);
 
      while(1) {
-       if (ifap == NULL) break;
-       if (strncmp(name, ifap -> ifa_name, IFNAMSIZ) == 0) {
-         family = ifap -> ifa_addr -> sa_family;
+     for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
+       if (strncmp(name, ifa->ifa_name, IFNAMSIZ) == 0) {
+         family = ifa->ifa_addr->sa_family;
          if (family == AF_LINK) {
-           sdl = (struct sockaddr_dl *) ifap->ifa_addr;
+           sdl = (struct sockaddr_dl *) ifa->ifa_addr;
            haddr = sdl->sdl_data + sdl->sdl_nlen;
            hlen = sdl->sdl_alen;
            break;
@@ -608,6 +608,9 @@ if_hwaddr(sock, name, ...)
          s += len;
        }
      }
+
+     freeifaddrs(ifap);
+
      RETVAL = hwaddr;
 #elif (defined(HAS_IOCTL) && defined(SIOCGIFHWADDR))
      bzero((void*)&ifr,sizeof(struct ifreq));
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               IO-Interface
-version:            1.06
+version:            1.07
 abstract:           ~
 author:  []
 license:            unknown
@@ -14,7 +14,7 @@ no_index:
     directory:
         - t
         - inc
-generated_by:       ExtUtils::MakeMaker version 6.55_02
+generated_by:       ExtUtils::MakeMaker version 6.57_05
 meta-spec:
     url:      http://module-build.sourceforge.net/META-spec-v1.4.html
     version:  1.4