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 90D1319C0064 for ; Thu, 12 Nov 2015 20:17:40 +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 9940FB5D8F4 for ; Thu, 12 Nov 2015 20:47:31 +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 E67A618CC7D0 for ; Thu, 12 Nov 2015 20:47:31 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 61440120497; Thu, 12 Nov 2015 20:47:29 +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 7F37E120450 for ; Thu, 12 Nov 2015 20:47:25 +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=OwyY2x5mJj0LUuSRywZAC1JgasA=; b=p+U4mtsYnkTgWENKMk LvDiPaxnsgc8XamBv1EHSUGAv09B6/jLULChOpw/9mquKM25/GlpS6A0dZM50e/4 jUy3awwh53JNPWn+f/XG5ewCOpqLsS1n/vSDSi1Yr7XAwFkExqIQreXIuXB0VUyF bxlejd39IluxhABnLe5SNCFyA= Received: by filter0539p1mdw1.sendgrid.net with SMTP id filter0539p1mdw1.25919.56447C4752 2015-11-12 11:47:19.752013981 +0000 UTC Received: from herokuapp.com (ec2-54-227-47-166.compute-1.amazonaws.com [54.227.47.166]) by ismtpd0005p1iad1.sendgrid.net (SG) with ESMTP id 6iKTZHLPRqqkOrqs6Cxg0w for ; Thu, 12 Nov 2015 11:47:19.603 +0000 (UTC) Date: Thu, 12 Nov 2015 11:47:19 +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: 46106 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS75pCOrHZi8W5BzwtI0OgwTTfA4ssJc2P5K0y teHUOv/zuCbwsgSGrn3fBn4dMyHy5KZpiRPIIkOow7iL9LSbGSf2pca8jbh+1+GZ7XwlWvEkP0wGZm hfNbQJHVc85eTmXFoDO52Xg2EPZcrO4MVxAx X-ML-Name: ruby-core X-Mail-Count: 71463 Subject: [ruby-core:71463] [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. Cool, thank you! ---------------------------------------- Bug #11632: Resolv::DNS::Message.encode fails to encode messages larger than 16383 byte https://bugs.ruby-lang.org/issues/11632#change-54834 * Author: Hannes Georg * Status: Closed * 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/