]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix WKS records on kvm autobuild host, with default protobyname
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 28 Aug 2017 13:00:45 +0000 (13:00 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 28 Aug 2017 13:00:45 +0000 (13:00 +0000)
  entries for udp and tcp.

git-svn-id: file:///svn/unbound/trunk@4314 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
sldns/str2wire.c
sldns/wire2str.c

index 1946a94a4cbd5677c5edcb927ebf201d97d3dd01..1333c8387373b3b76ccaab42a19ecb29b37aad6b 100644 (file)
@@ -4,6 +4,8 @@
        - Fix #1415: [dnscrypt] shared secret cache, patch from
          Manu Bretelle.
        - Small fixes for the shared secret cache patch.
+       - Fix WKS records on kvm autobuild host, with default protobyname
+         entries for udp and tcp.
 
 23 August 2017: Wouter
        - Fix #1407: Add ECS options check to unbound-checkconf.
index 0e5145888b9d51c927666922650c690badb43b9f..9de94f3acfc0bcc1225f35263489dfd0985c9514 100644 (file)
@@ -1693,6 +1693,8 @@ int sldns_str2wire_wks_buf(const char* str, uint8_t* rd, size_t* len)
                        struct protoent *p = getprotobyname(token);
                        have_proto = 1;
                        if(p) rd[0] = (uint8_t)p->p_proto;
+                       else if(!p && strcasecmp(token, "tcp")==0) rd[0]=6;
+                       else if(!p && strcasecmp(token, "udp")==0) rd[0]=17;
                        else rd[0] = (uint8_t)atoi(token);
                        (void)strlcpy(proto_str, token, sizeof(proto_str));
                } else {
index c1162e7bab8ee3761eac79e7fac599559cc4686c..52b1ed0c2aa92d03d89614070eeccfe414d7ad67 100644 (file)
@@ -1471,6 +1471,10 @@ int sldns_wire2str_wks_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
        if(protocol && (protocol->p_name != NULL)) {
                w += sldns_str_print(s, sl, "%s", protocol->p_name);
                proto_name = protocol->p_name;
+       } else if(protocol_nr == 6) {
+               w += sldns_str_print(s, sl, "tcp");
+       } else if(protocol_nr == 17) {
+               w += sldns_str_print(s, sl, "udp");
        } else  {
                w += sldns_str_print(s, sl, "%u", (unsigned)protocol_nr);
        }