ambrop7 15 lat temu
rodzic
commit
ff753ff0f9
3 zmienionych plików z 4 dodań i 4 usunięć
  1. 2 2
      ncd/NCDIfConfig.c
  2. 1 1
      ncd/NCDInterfaceMonitor.c
  3. 1 1
      ncd/ncd.c

+ 2 - 2
ncd/NCDIfConfig.c

@@ -181,7 +181,7 @@ int NCDIfConfig_set_dns_servers (uint32_t *servers, size_t num_servers)
     char line[60];
     
     sprintf(line, "# generated by badvpn-ncd\n");
-    if (!write_to_file(line, strlen(line), temp_file)) {
+    if (!write_to_file((uint8_t *)line, strlen(line), temp_file)) {
         BLog(BLOG_ERROR, "failed to write to resolvconf temp file");
         goto fail1;
     }
@@ -190,7 +190,7 @@ int NCDIfConfig_set_dns_servers (uint32_t *servers, size_t num_servers)
         uint8_t *addr = (uint8_t *)&servers[i];
         sprintf(line, "nameserver %"PRIu8".%"PRIu8".%"PRIu8".%"PRIu8"\n",
                 addr[0], addr[1], addr[2], addr[3]);
-        if (!write_to_file(line, strlen(line), temp_file)) {
+        if (!write_to_file((uint8_t *)line, strlen(line), temp_file)) {
             BLog(BLOG_ERROR, "failed to write to resolvconf temp file");
             goto fail1;
         }

+ 1 - 1
ncd/NCDInterfaceMonitor.c

@@ -104,7 +104,7 @@ void process_buffer (NCDInterfaceMonitor *o)
             int attr_len = RTA_PAYLOAD(rta);
             
             if (rta->rta_type == IFLA_IFNAME && attr_len > 0 && attr[attr_len - 1] == '\0') {
-                ifname = attr;
+                ifname = (char *)attr;
             }
         }
         

+ 1 - 1
ncd/ncd.c

@@ -257,7 +257,7 @@ int main (int argc, char **argv)
     }
     
     // parse config file
-    if (!NCDConfigParser_Parse(file, file_len, &configuration)) {
+    if (!NCDConfigParser_Parse((char *)file, file_len, &configuration)) {
         BLog(BLOG_ERROR, "NCDConfigParser_Parse failed");
         free(file);
         goto fail3;