]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
lib/resolve: use maximum unfragmented UDP payload for iter as default
authorMarek Vavruša <marek.vavrusa@nic.cz>
Wed, 22 Jul 2015 10:47:20 +0000 (12:47 +0200)
committerMarek Vavruša <marek.vavrusa@nic.cz>
Wed, 22 Jul 2015 10:47:20 +0000 (12:47 +0200)
this is a saner default for large answers. instead of waiting for
probably lost/thrown away fragmented packet, do the query over TCP
instead

lib/defines.h
lib/resolve.c

index 9709380c9d164c07828ad38fe3fb0f6b4b7ebef5..d3f3f76fdec62e36fa37ad6fdd796315630d5454 100644 (file)
@@ -36,12 +36,12 @@ static inline int __attribute__((__cold__)) kr_error(int x) {
  * @cond internal
  */
 #define KR_CONN_RTT_MAX 3000 /* Timeout for network activity */
-#define KR_ITER_LIMIT 50        /* Built-in iterator limit */
+#define KR_ITER_LIMIT 50     /* Built-in iterator limit */
 
 /*
  * Defines.
  */
 #define KR_DNS_PORT   53
 #define KR_EDNS_VERSION 0
-#define KR_EDNS_PAYLOAD 4096
+#define KR_EDNS_PAYLOAD 1452 /* Maximum payload for unfragmented UDP/v6 */
 /* @endcond */
index 85b968e7f4077fba111fcb6df339c461eb50b339..75f0d7bb40bf5f5767dbd05bf409ec5d49e8d5c8 100644 (file)
@@ -290,7 +290,7 @@ int kr_resolve(struct kr_context* ctx, knot_pkt_t *answer,
                .ctx = mp_new (KNOT_WIRE_MAX_PKTSIZE),
                .alloc = (mm_alloc_t) mp_alloc
        };
-       knot_pkt_t *query = knot_pkt_new(NULL, KNOT_EDNS_MAX_UDP_PAYLOAD, &pool);
+       knot_pkt_t *query = knot_pkt_new(NULL, KR_EDNS_PAYLOAD, &pool);
        knot_pkt_t *resp = knot_pkt_new(NULL, KNOT_WIRE_MAX_PKTSIZE, &pool);
        if (!query || !resp) {
                mp_delete(pool.ctx);