code: def _getaddr (self, ifname, func):
          
          try:
              result = self._ioctl(func, self._getifreq(ifname))
          except IOError as msg:
              log.warn(LOG_CHECK,
                    "error getting addr for interface %r: %s", ifname, msg)
              return None
          return socket.inet_ntoa(result[20:24])
docs: Get interface address.