From owner-freebsd-bugs@FreeBSD.ORG Tue Mar 25 22:10:14 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A130737B404 for ; Tue, 25 Mar 2003 22:10:14 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id BCE0043FCB for ; Tue, 25 Mar 2003 22:10:12 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h2Q6ACNS034873 for ; Tue, 25 Mar 2003 22:10:12 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h2Q6ACcV034872; Tue, 25 Mar 2003 22:10:12 -0800 (PST) Resent-Date: Tue, 25 Mar 2003 22:10:12 -0800 (PST) Resent-Message-Id: <200303260610.h2Q6ACcV034872@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Ignacio Solis Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2D0DB37B401 for ; Tue, 25 Mar 2003 22:03:38 -0800 (PST) Received: from miramar.cse.ucsc.edu (miramar.cse.ucsc.edu [128.114.63.92]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9F6BE43F85 for ; Tue, 25 Mar 2003 22:03:37 -0800 (PST) (envelope-from isolis@miramar.cse.ucsc.edu) Received: from miramar.cse.ucsc.edu (localhost.cse.ucsc.edu [127.0.0.1]) by miramar.cse.ucsc.edu (8.12.8/8.12.5) with ESMTP id h2Q6DdGk049972; Tue, 25 Mar 2003 22:13:39 -0800 (PST) (envelope-from isolis@miramar.cse.ucsc.edu) Received: (from isolis@localhost) by miramar.cse.ucsc.edu (8.12.8/8.12.6/Submit) id h2Q6Dcg7049971; Tue, 25 Mar 2003 22:13:38 -0800 (PST) Message-Id: <200303260613.h2Q6Dcg7049971@miramar.cse.ucsc.edu> Date: Tue, 25 Mar 2003 22:13:38 -0800 (PST) From: Ignacio Solis To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 X-Spam-Status: No, hits=-6.5 required=5.0 tests=MSG_ID_ADDED_BY_MTA_3,PATCH_UNIFIED_DIFF,RESENT_TO autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) cc: Ignacio Solis Subject: bin/50310: natd / libalias fix to allow dcc resume in irc X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Ignacio Solis List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2003 06:10:15 -0000 X-List-Received-Date: Wed, 26 Mar 2003 06:10:15 -0000 >Number: 50310 >Category: bin >Synopsis: natd / libalias fix to allow dcc resume in irc >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Mar 25 22:10:12 PST 2003 >Closed-Date: >Last-Modified: >Originator: Ignacio Solis >Release: FreeBSD 5.0-RELEASE i386 >Organization: UC Santa Cruz, California, US >Environment: System: FreeBSD imperial.casa.igso.net 5.0-RELEASE FreeBSD 5.0-RELEASE #5: Tue Jan 28 23:31:36 PST 2003 isolis@imperial.casa.igso.net:/usr/obj/usr/src/sys/IMPERIAL i386 Machine running natd as router/firewall, clients trying to do DCC RESUME while downloading files from irc >Description: The current implementation of libalias has a simple way of doing NAT for irc connections. It assumes that DCC messages all have the same format, namely "DCC command file ip port .... etc". The RESUME command has a different structure, and hence the simple assumptions of libalias make RESUME fail, sending out erroneously translated messages. The format of RESUME is: "DCC RESUME port size", where port is the port of the sender of the file (where we connect), hence no translation is necesary. The problem can be clearly seen with 2 tcpdumps (with packet contents) at the sides of the nat box. >How-To-Repeat: Enable natd on the firewall/router. Have a client connect to IRC. Download a piece of a file. Now try to download the rest of the file with a RESUME. >Fix: This is a simple fix that just passes the packet through if it sees it's a RESUME command. --- libalias_dcc_resume.diff begins here --- --- alias_irc.c.backup Tue Mar 25 01:28:12 2003 +++ alias_irc.c Tue Mar 25 02:39:39 2003 @@ -140,6 +140,20 @@ } } + + if( sptr[i+0] == 'R' && + sptr[i+1] == 'E' && + sptr[i+2] == 'S' && + sptr[i+3] == 'U' && + sptr[i+4] == 'M' && + sptr[i+5] == 'E' && + sptr[i+6] == ' '){ + /* It's a resume packet, let it through, lBAD_CTCP + * will copy the rest of the packet */ + DBprintf(("RESUME command...\n")); + goto lBAD_CTCP; + } + DBprintf(("Transferring command...\n")); while(sptr[i] != ' ') { newpacket[iCopy++] = sptr[i]; --- libalias_dcc_resume.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: