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 7113819C003C for ; Mon, 9 Nov 2015 17:52:11 +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 7FE8EB5D8F1 for ; Mon, 9 Nov 2015 18:21:38 +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 DA3FA18CC7F3 for ; Mon, 9 Nov 2015 18:21:38 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 59B8F120488; Mon, 9 Nov 2015 18:21:37 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o2.heroku.sendgrid.net (o2.heroku.sendgrid.net [67.228.50.55]) by neon.ruby-lang.org (Postfix) with ESMTPS id 466B2120441 for ; Mon, 9 Nov 2015 18:21:34 +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=H2dg+EG46tUfHrEXmgjgV2Ux6sQ=; b=MZI/3qK/Ple6JwHccW /GJ57yAMhenYxqckDAaCArchk6HQtQ518S0MBy/7X9XDXDilqZaTT8S5Yzs0/2ch U53mZD9RBoGGAdhaY8jyLr8RRBf6lRhsKvnsOiYztAI3C5N/GVh84nnjv+00YYvp wC82ixau6LSTUkD+IGyRS3J3o= Received: by filter-395.sjc1.sendgrid.net with SMTP id filter-395.31200.5640659934 2015-11-09 09:21:29.572454239 +0000 UTC Received: from herokuapp.com (ec2-54-145-97-147.compute-1.amazonaws.com [54.145.97.147]) by ismtpd0006p1iad1.sendgrid.net (SG) with ESMTP id juN_U-e5R0yBbnrCbXnWSg for ; Mon, 09 Nov 2015 09:21:29.634 +0000 (UTC) Date: Mon, 09 Nov 2015 09:21:29 +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: 46054 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS7ymbX/IwtxxlYHnAdHUJ+5kHbMz7f152H4MW F2hgwzEfigyMw/RChd5TWi8SrmoQufA68VMyZxrkMXrQuQqCXQAYGfCx7tiXwo7uIfcz+LvDOyro+0 sn+kDhE1r+S5zxc= X-SendGrid-Contentd-ID: {"test_id":"1447060890"} X-ML-Name: ruby-core X-Mail-Count: 71411 Subject: [ruby-core:71411] [Ruby trunk - Bug #11632] 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 updated by Hannes Georg. Pull submitted: https://github.com/ruby/ruby/pull/1088 ---------------------------------------- Bug #11632: Resolv::DNS::Message.encode fails to encode messages larger than 16383 byte https://bugs.ruby-lang.org/issues/11632#change-54781 * 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/