From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id B239919C0021 for ; Wed, 28 Oct 2015 23:31:30 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 4C1D0B5D864 for ; Wed, 28 Oct 2015 23:59:26 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 6520495241E for ; Wed, 28 Oct 2015 23:59:26 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 29AD21204C5; Wed, 28 Oct 2015 23:59:25 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o10.shared.sendgrid.net (o10.shared.sendgrid.net [173.193.132.135]) by neon.ruby-lang.org (Postfix) with ESMTPS id ED957120497 for ; Wed, 28 Oct 2015 23:59:20 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=farExWHFLRFHwgC+5j8WvWDLN4U=; b=NrHUuqjjzG6HDE0R94 1L1QjDgkbJp8Tac6WIcr4J5rXdcGIzBgWJsKaVZftVWoH1VQIusP4qu/tqS7DJKi GZDou8Ly8mutOA0/WqoAbxqCFY2bmolryo4RtElWe1nsrN1ee6HH2hWRyd4ItDbi OI+ffiMLb+TK+uUCBOaPqkAso= Received: by filter0560p1mdw1.sendgrid.net with SMTP id filter0560p1mdw1.16171.5630E2C11C 2015-10-28 14:59:13.404750737 +0000 UTC Received: from herokuapp.com (ec2-54-90-227-81.compute-1.amazonaws.com [54.90.227.81]) by ismtpd0003p1iad1.sendgrid.net (SG) with ESMTP id Fg4hKTyOTO2O3LW-LOEfNQ for ; Wed, 28 Oct 2015 14:59:13.351 +0000 (UTC) Date: Wed, 28 Oct 2015 14:59:13 +0000 From: hannes.georg@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Redmine-MailingListIntegration-Message-Ids: 45878 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11632 X-Redmine-Issue-Author: hannes.georg X-Redmine-Sender: hannes.georg X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS6JZRQuxvr6wc1/FOYgRHXL1NDY0dp6xMAAZp xpzMQ8jYteYOhCeNCZ6QBACW56R5wV3x0ObFU5pK+SxAXbn9KNUMqqGfboqksiqWtDb6vELEvDwqyR MyZ9cs8bM1TUZVU4BsBnDaGdq+QdRaq2VKXD X-ML-Name: ruby-core X-Mail-Count: 71248 Subject: [ruby-core:71248] [Ruby trunk - Bug #11632] [Open] Resolv::DNS::Message.encode fails to encode messages larger than 16383 byte X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #11632 has been reported by Hannes Georg. ---------------------------------------- Bug #11632: Resolv::DNS::Message.encode fails to encode messages larger than 16383 byte https://bugs.ruby-lang.org/issues/11632 * Author: Hannes Georg * Status: Open * Priority: Normal * Assignee: * ruby -v: * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- Hello Rubyists The ruby dns message encoder automatically remembers _all_ label addresses to be reused later ( see https://github.com/ruby/ruby/blob/v2_2_3/lib/resolv.rb#L1470 ). The address field however is limited to 14 bits ( see https://tools.ietf.org/html/rfc1035#section-4.1.4 ). If the message gets larger than 16383 bytes the addresses of new labels won't fit anymore. The encoder takes this into account and truncates the addresses on write which makes them invalid ( see https://github.com/ruby/ruby/blob/v2_2_3/lib/resolv.rb#L1467 ). My suggested solution is to not store addresses larger than 16383. Is a github pr okay for that? -- https://bugs.ruby-lang.org/