Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Jun 1999 23:26:02 +0200 (CEST)
From:      Stefan Zehl <sec@42.org>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/12216: rwhod triggers dial on demand (patch)
Message-ID:  <199906142126.XAA00816@btl.42.org>

next in thread | raw e-mail | index | archive | help

>Number:         12216
>Category:       bin
>Synopsis:       rwhod triggers dial on demand (patch)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 14 14:30:00 PDT 1999
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199906142126.XAA00816>