From sec@42.org Mon Jun 14 14:26:15 1999
Return-Path: <sec@42.org>
Received: from matrix.42.org (matrix.42.org [194.246.250.200])
	by hub.freebsd.org (Postfix) with ESMTP id ECFB2154F3
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 14 Jun 1999 14:26:03 -0700 (PDT)
	(envelope-from sec@42.org)
Received: from btl.42.org (btl.42.org [194.246.250.193])
	by matrix.42.org (8.8.8/8.8.5) with ESMTP id XAA25170
	for <FreeBSD-gnats-submit@freebsd.org> (sender <sec@btl.42.org>);
	Mon, 14 Jun 1999 23:26:01 +0200 (CEST)
Received: (from root@localhost)
	by btl.42.org (8.9.3/8.9.1) id XAA00816;
	Mon, 14 Jun 1999 23:26:02 +0200 (CEST)
	(envelope-from sec)
Message-Id: <199906142126.XAA00816@btl.42.org>
Date: Mon, 14 Jun 1999 23:26:02 +0200 (CEST)
From: Stefan Zehl <sec@42.org>
Reply-To: sec@42.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: rwhod triggers dial on demand (patch)
X-Send-Pr-Version: 3.2

>Number:         12216
>Category:       bin
>Synopsis:       rwhod triggers dial on demand (patch)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    brian
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 14 14:30:00 PDT 1999
>Closed-Date:    Wed Jun 16 14:05:31 PDT 1999
>Last-Modified:  Fri Jun 18 20:10:01 PDT 1999
>Originator:     Stefan Zehl
>Release:        FreeBSD 3.2-STABLE i386
>Organization:
>Environment:

A box wich connects a lan to the internet via some point to point link.

>Description:

rwho broadcasts its uptime on all interfaces which match either
IFF_BROADCAST or IFF_POINTOPOINT.
On a box with i4b and dial on demand, the packets sent via the isp0
interface trigger dialouts.

>How-To-Repeat:

configure point to point interface up and for dial on demand, then start
rwhod.

>Fix:
	
Attached is a patch which adds the '-p' option to disable sending packets
on pointopoint links.

While creating the patch, I found out that the variables 'insecure_mode'
and 'quiet_mode' are both not initialized to 0. Shouldn't this be added ?

--- rwhod.c.orig	Mon Jun 14 23:14:51 1999
+++ rwhod.c	Mon Jun 14 23:14:51 1999
@@ -117,6 +117,7 @@
 
 int			insecure_mode;
 int			quiet_mode;
+int			dialup_mode = 0;
 int			multicast_mode  = NO_MULTICAST;
 int			multicast_scope;
 struct sockaddr_in	multicast_addr  = { sizeof multicast_addr, AF_INET };
@@ -200,6 +201,8 @@
 			insecure_mode = 1;
 		else if (strcmp(*argv, "-l") == 0)
 			quiet_mode = 1;
+		else if (strcmp(*argv, "-p") == 0)
+			dialup_mode = 1;
 		else
 			usage();
 		argv++, argc--;
@@ -604,7 +607,8 @@
 		if ((flags & IFF_UP) == 0 ||
 		    (flags & (((multicast_mode == PER_INTERFACE_MULTICAST) ?
 				IFF_MULTICAST : 0) |
-				IFF_BROADCAST|IFF_POINTOPOINT)) == 0)
+				IFF_BROADCAST |
+				(dialup_mode?0:IFF_POINTOPOINT))) == 0)
 			continue;
 		if (ifm->ifm_type != RTM_NEWADDR)
 			quit("out of sync parsing NET_RT_IFLIST");

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->brian 
Responsible-Changed-By: brian 
Responsible-Changed-When: Wed Jun 16 08:38:47 PDT 1999 
Responsible-Changed-Why:  
This looks like a worthwhile change :-) 
State-Changed-From-To: open->closed 
State-Changed-By: brian 
State-Changed-When: Wed Jun 16 14:05:31 PDT 1999 
State-Changed-Why:  
Patches (kind-of) applied to -current. 

From: Steve Price <sprice@hiwaay.net>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: bin/12216: rwhod triggers dial on demand (patch) (fwd)
Date: Fri, 18 Jun 1999 22:03:16 -0500 (CDT)

 ---------- Forwarded message ----------
 Date: Tue, 15 Jun 1999 11:38:16 +0200
 From: Stefan `Sec` Zehl <sec@42.org>
 To: gnats-admin@FreeBSD.org, freebsd-bugs@FreeBSD.org
 Subject: Re: bin/12216: rwhod triggers dial on demand (patch)
 
 Whoops, i forgot the patch for the man page.
 
 here it is.
 
 --- rwhod.8.orig	Tue Jun 15 11:34:21 1999
 +++ rwhod.8	Tue Jun 15 11:34:57 1999
 @@ -40,6 +40,7 @@
  .Sh SYNOPSIS
  .Nm rwhod
  .Op Fl i
 +.Op Fl p
  .Op Fl l
  .Op Fl m Op Ar ttl
  .Sh DESCRIPTION
 @@ -74,6 +75,13 @@
  option enables insecure mode, which causes
  .Nm
  to ignore the source port on incoming packets.
 +.Pp
 +The
 +.Fl p
 +option enables 'dialup' mode, which causes
 +.Nm
 +to stop sending packets on point to point links,
 +and thus not bringing up dial on demand lines.
  .Pp
  The
  .Fl l
 
 
>Unformatted:
