From vladimir.levijev at gmail.com Mon Dec 2 16:28:05 2019 From: vladimir.levijev at gmail.com (Vladimir Levijev) Date: Mon, 2 Dec 2019 18:28:05 +0200 Subject: [ldns-users] NSID support In-Reply-To: References: <2cedfc1e-7d14-c7df-28e5-d58c72d91de5@nlnetlabs.nl> Message-ID: On Thu, Sep 5, 2019 at 6:23 PM Vladimir Levijev wrote: Hi, Getting back to your example that fetches NSID from the target name server (see question below). > > I have attached a "small" example program (nsid-example.c) that > > illustrates how to use the ldns_pkt_set_edns_data() and > > ldns_pkt_edns_data() functions to set and get EDNS Options. > > Here are some usage examples: > > > > $ ./nsid-example > > ./nsid-example > > > > $ ./nsid-example 193.0.14.129 > > upstream 193.0.14.129, returned NSID: "ns2.nl-ams.k.ripe.net" > > > > $ ./nsid-example 37.209.192.10 > > upstream 37.209.192.10, returned NSID: "dns5.mel" > > > > $ ./nsid-example 9.9.9.10 > > upstream 9.9.9.10, returned NSID: "res210.ams.rrdns.pch.net" > > > > $ ./nsid-example 8.8.8.8 > > Could not get EDNS data One question regarding the part of the code where the NSID is fetched from reply, specifically: --------------------------------------------------------------------------------------- while (size >= 4) { /* Read option code */ opt_code = ldns_read_uint16(data); size -= 2; data += 2; /* Read option length */ opt_len = ldns_read_uint16(data); size -= 2; data += 2; if (opt_code == LDNS_EDNS_NSID) { printf("upstream "); ldns_rdf_print(stdout, upstream); printf(", returned NSID: \"%.*s\"\n", (int)opt_len, data); break; } /* Next option */ size = opt_len > size ? 0 : size - opt_len; } --------------------------------------------------------------------------------------- If `opt_code` is not `LDNS_EDNS_NSID` (commented as "Next option"), shouldn't we skip `opt_len` bytes in `data`? ? ?Cheers, VL From willem at nlnetlabs.nl Tue Dec 3 09:51:16 2019 From: willem at nlnetlabs.nl (Willem Toorop) Date: Tue, 3 Dec 2019 10:51:16 +0100 Subject: [ldns-users] NSID support In-Reply-To: References: <2cedfc1e-7d14-c7df-28e5-d58c72d91de5@nlnetlabs.nl> Message-ID: <242631e7-4306-34e5-30ba-17e4a511f073@nlnetlabs.nl> Op 02-12-2019 om 17:28 schreef Vladimir Levijev: > On Thu, Sep 5, 2019 at 6:23 PM Vladimir Levijev > wrote: > > Hi, > > Getting back to your example that fetches NSID from the target name > server (see question below). > >>> I have attached a "small" example program (nsid-example.c) that >>> illustrates how to use the ldns_pkt_set_edns_data() and >>> ldns_pkt_edns_data() functions to set and get EDNS Options. >>> Here are some usage examples: >>> >>> $ ./nsid-example >>> ./nsid-example >>> >>> $ ./nsid-example 193.0.14.129 >>> upstream 193.0.14.129, returned NSID: "ns2.nl-ams.k.ripe.net" >>> >>> $ ./nsid-example 37.209.192.10 >>> upstream 37.209.192.10, returned NSID: "dns5.mel" >>> >>> $ ./nsid-example 9.9.9.10 >>> upstream 9.9.9.10, returned NSID: "res210.ams.rrdns.pch.net" >>> >>> $ ./nsid-example 8.8.8.8 >>> Could not get EDNS data > > One question regarding the part of the code where the NSID is fetched > from reply, specifically: > > --------------------------------------------------------------------------------------- > while (size >= 4) { > /* Read option code */ > opt_code = ldns_read_uint16(data); > size -= 2; data += 2; > > /* Read option length */ > opt_len = ldns_read_uint16(data); > size -= 2; data += 2; > > if (opt_code == LDNS_EDNS_NSID) { > printf("upstream "); > ldns_rdf_print(stdout, upstream); > printf(", returned NSID: \"%.*s\"\n", (int)opt_len, data); > break; > } > > /* Next option */ > size = opt_len > size ? 0 : size - opt_len; > } > --------------------------------------------------------------------------------------- > > If `opt_code` is not `LDNS_EDNS_NSID` (commented as "Next option"), > shouldn't we skip `opt_len` bytes in `data`? Absolutely! Good catch! Cheers, WT > ? > ?Cheers, > > VL > From jeroen at nlnetlabs.nl Tue Dec 10 13:57:14 2019 From: jeroen at nlnetlabs.nl (Jeroen Koekkoek) Date: Tue, 10 Dec 2019 14:57:14 +0100 Subject: [ldns-users] Mailing list migration Message-ID: <24f4b715b8cc6ef825d442bf55657444cd89efb3.camel@nlnetlabs.nl> Hi all, On December 16th 2019 the ldns-users mailing list will be migrated to a different provider. The oppertunity will also be used to move the mailing list to the dedicated lists.nlnetlabs.nl subdomain. You will automatically be subscribed to the new list and care is taken to make the transition as smooth as possible. During the migration though, the mailing list may be unreachable. From December 16th 2019 please direct questions to ldns at lists.nlnetlabs.nl and ensure any filters you may have configured are updated to recognize the address. Best regards, Jeroen Koekkoek, NLnet Labs -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: This is a digitally signed message part URL: From jeroen at nlnetlabs.nl Tue Dec 10 15:12:25 2019 From: jeroen at nlnetlabs.nl (Jeroen Koekkoek) Date: Tue, 10 Dec 2019 16:12:25 +0100 Subject: [ldns-users] Mailing list migration In-Reply-To: <24f4b715b8cc6ef825d442bf55657444cd89efb3.camel@nlnetlabs.nl> References: <24f4b715b8cc6ef825d442bf55657444cd89efb3.camel@nlnetlabs.nl> Message-ID: Hi all, ldns at lists.nlnetlabs.nl below should read ldns-users at lists.nlnetlabs.nl . Best regards, Jeroen Koekkoek, NLnet Labs On Tue, 2019-12-10 at 14:57 +0100, Jeroen Koekkoek wrote: > Hi all, > > On December 16th 2019 the ldns-users mailing list will be migrated to > a > different provider. The oppertunity will also be used to move the > mailing list to the dedicated lists.nlnetlabs.nl subdomain. > > You will automatically be subscribed to the new list and care is > taken > to make the transition as smooth as possible. During the migration > though, the mailing list may be unreachable. > > From December 16th 2019 please direct questions to > ldns at lists.nlnetlabs.nl and ensure any filters you may have > configured > are updated to recognize the address. > > Best regards, > Jeroen Koekkoek, NLnet Labs > _______________________________________________ > ldns-users mailing list > ldns-users at nlnetlabs.nl > https://open.nlnetlabs.nl/mailman/listinfo/ldns-users -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: This is a digitally signed message part URL: