ipupdate: fix endianness-issue
authorHauke Mehrtens <hauke@hauke-m.de>
Sat, 9 Apr 2011 15:28:22 +0000 (15:28 +0000)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 9 Apr 2011 15:28:22 +0000 (15:28 +0000)
Thank you Sven Roederer for the patch.

This closes #9066.

SVN-Revision: 26546

net/ipupdate/patches/100-name_conflict.patch
net/ipupdate/patches/200-byteorder.patch [new file with mode: 0644]

index 8790dcd6ad2172cc4a6fdd64dac76de1e1859705..b0b1c93a4a94c3a61eb75e47c317ed873e26672f 100644 (file)
@@ -18,7 +18,7 @@
  {
        char** args = NULL;
        int inc;
-@@ -53,7 +53,7 @@
+@@ -53,7 +53,7 @@ char** split(char* str, const char* del,
  }
  
  /*
@@ -27,7 +27,7 @@
  **
  ** remove length elements from array starting at offset
  ** All trailing elements will be left aligned
-@@ -70,7 +70,7 @@
+@@ -70,7 +70,7 @@ char** split(char* str, const char* del,
  ** Returns the number of elements removed
  */
  
@@ -48,7 +48,7 @@
 +int array_splice(void**, int, int, int);
 --- a/ipupdate.c
 +++ b/ipupdate.c
-@@ -295,7 +295,7 @@
+@@ -295,7 +295,7 @@ int DoUpdate(int check)
                                free(zone->keyname);
                                free(server->zones[j]);
  
@@ -57,7 +57,7 @@
                                continue;
                        }
  
-@@ -317,7 +317,7 @@
+@@ -317,7 +317,7 @@ int DoUpdate(int check)
                        free(server->zones);
                        free(cfg.servers[i]);
  
@@ -66,7 +66,7 @@
                        continue;
                }
                i++;
-@@ -414,7 +414,7 @@
+@@ -414,7 +414,7 @@ int checkcname(int *s, struct server *se
                        asprintf(&msg, "checkcname: server %s: zone %s: host %s: host disabled", server->name, zone->name, zone->hosts[i]);
                        PostMsgFree(msg);
  
@@ -75,7 +75,7 @@
                        continue;
                }
  
-@@ -446,7 +446,7 @@
+@@ -446,7 +446,7 @@ int checkcname(int *s, struct server *se
                        asprintf(&msg, "checkcname: server %s: zone %s: host %s: host disabled", server->name, zone->name, zone->hosts[i]);
                        PostMsgFree(msg);
        
@@ -84,7 +84,7 @@
                        continue;
                }
                //append the record to the packet
-@@ -488,7 +488,7 @@
+@@ -488,7 +488,7 @@ int checkcname(int *s, struct server *se
                        asprintf(&msg, "checkcname: server %s: zone %s: host %s: host disabled", server->name, zone->name, zone->hosts[i]);
                        PostMsgFree(msg);
  
@@ -93,7 +93,7 @@
                        continue;
                }
  
-@@ -561,7 +561,7 @@
+@@ -561,7 +561,7 @@ int checkip(int *s, struct server *serve
                        asprintf(&msg, "checkip: server %s: zone %s: host %s: host disabled", server->name, zone->name, zone->hosts[i]);
                        PostMsgFree(msg);
  
                                continue;
 --- a/config.c
 +++ b/config.c
-@@ -873,7 +873,7 @@
+@@ -873,7 +873,7 @@ void cfg_zone(struct server *server, str
                                switch (cfg_readblock(data, &term, &ptr)) {
                                case CFG_QUOTED:
                                        zone->hostp = term;
diff --git a/net/ipupdate/patches/200-byteorder.patch b/net/ipupdate/patches/200-byteorder.patch
new file mode 100644 (file)
index 0000000..48cb9c6
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/include/dns.c
++++ b/include/dns.c
+@@ -127,7 +127,7 @@ int dns_t2wtsig(char *pktdata, unsigned
+       tsig.hitime = 0;
+       tsig.lotime = htonl(signtime);
+       tsig.fudge = htons(fudge);
+-      tsig.macsize = 0x1000;  //16
++      tsig.macsize = htons(16);
+       memset(tsig.mac, 0, 16);
+       memcpy(&tsig.id, pktdata, 2);
+       tsig.error = 0;