[dtn-interest] A patch for DTN2

Jeff Allen <jeff.allen@gmail.com> Mon, 10 January 2005 04:41 UTC

Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.198]) by webbie.berkeley.intel-research.net (8.11.6/8.11.6) with ESMTP id j0A4fX112981 for <dtn-interest@mailman.dtnrg.org>; Sun, 9 Jan 2005 20:41:33 -0800
Received: by wproxy.gmail.com with SMTP id 69so300585wri for <dtn-interest@mailman.dtnrg.org>; Sun, 09 Jan 2005 20:41:06 -0800 (PST)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type; b=OOW8DLNz6QFvXr6UDQteU54vcH/j9ZIIyeWPaCSWld4N6+OKmdjoBXZ9HxPBMBHOOqQKj0+JhUbctyV+PIiOHu7rj5d6ZYSk2u7zjk8uduQ13tiVlai1YEUt06d5W7PX89BJxgKFPOYepS3/CnocRHatNwAs8HCoPk1oe3he41o=
Received: by 10.54.57.15 with SMTP id f15mr187121wra; Sun, 09 Jan 2005 20:41:06 -0800 (PST)
Received: by 10.54.3.4 with HTTP; Sun, 9 Jan 2005 20:41:06 -0800 (PST)
Message-ID: <bccc8ac805010920417962e4b3@mail.gmail.com>
Date: Sun, 09 Jan 2005 20:41:06 -0800
From: Jeff Allen <jeff.allen@gmail.com>
Reply-To: jra@nella.org
To: dtn-interest@mailman.dtnrg.org
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="----=_Part_2708_15823565.1105332066576"
Subject: [dtn-interest] A patch for DTN2
Sender: dtn-interest-admin@mailman.dtnrg.org
Errors-To: dtn-interest-admin@mailman.dtnrg.org
X-BeenThere: dtn-interest@mailman.dtnrg.org
X-Mailman-Version: 2.0.13
Precedence: bulk
List-Help: <mailto:dtn-interest-request@mailman.dtnrg.org?subject=help>
List-Post: <mailto:dtn-interest@mailman.dtnrg.org>
List-Subscribe: <http://mailman.dtnrg.org/mailman/listinfo/dtn-interest>, <mailto:dtn-interest-request@mailman.dtnrg.org?subject=subscribe>
List-Id: Delay Tolerant Networking Interest List <dtn-interest.mailman.dtnrg.org>
List-Unsubscribe: <http://mailman.dtnrg.org/mailman/listinfo/dtn-interest>, <mailto:dtn-interest-request@mailman.dtnrg.org?subject=unsubscribe>
List-Archive: <http://mailman.dtnrg.org/pipermail/dtn-interest/>

I was working on getting the software working, and I ran across a
problem. Luckily, the fix is pretty easy.

If you do not have a .dtndebug file, you get this when you start the daemon:

  [jra@nano daemon]$ ./dtnd
  couldn't open debug file /home/jra/.dtndebug: No such file or directory
  Segmentation fault (core dumped)

The problem is in Log.cc, where rule_list_ is inited to NULL. Log.cc
assumes that rule_list_ will always be a valid object (i.e. calling
->begin() on it without checking for null, etc). So a better value to
initialize it to is "new RuleList()". It looks like parse_debug_file()
will do the right thing and delete the rule list, in the case that the
.dtndebug file exists.

A patch is attached.

I'll now get back to plugging away at making things work.

  -jra