From owner-freebsd-net Sat Jan 12 6:52:12 2002 Delivered-To: freebsd-net@freebsd.org Received: from korak.sk (korak.sk [195.72.9.135]) by hub.freebsd.org (Postfix) with ESMTP id 3179537B402; Sat, 12 Jan 2002 06:52:06 -0800 (PST) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by korak.sk (Postfix) with SMTP id 9679253E9E; Sat, 12 Jan 2002 15:51:59 +0100 (CET) Received: by korak.sk (Postfix, from userid 501) id 66C1353FC8; Sat, 12 Jan 2002 15:51:48 +0100 (CET) Date: Sat, 12 Jan 2002 15:51:48 +0100 From: Jan Oravec To: ru@FreeBSD.org, net@FreeBSD.org, freebsd-gnats-submit@FreeBSD.org Subject: Re: kern/33747: bug in rt socket Message-ID: <20020112155148.A30990@korak.sk> Reply-To: Jan Oravec Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.21i X-Operating-System: UNIX Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org > > there is a bug in rt socket in kernel, file net/rtsock.c: > > > > function rt_ifmsg contains: > > ifm->ifm_addrs = 0; > > > > we should set RTA_IFP attribute instead and send interface name, > > because information that some interface has been created without > > name of interface is unusable. > > > I wouldn't call it a bug, but rather a design issue. In > BSD, rt_ifmsg() doesn't set any sockaddrs, and this is > documented in Stevens' TCP/IP Illustrated Vol. 2 on the > bottom of page 627. What made you think we SHOULD supply > IFP to this message? Usually, daemons remember interface > index (see natd(8) for a working example), and on receipt > of an RTM_IFINFO message with a matching ifm_index, some > actions take place. Yes, but we may create interfaces while daemon runs. The typical example is 'gif' interface. When daemon starts, gif0 does not exist. After start of daemon, we create interface with 'ifconfig gif0 create'. Since interface did not exist, daemon doesn't know about his name and ID and when daemon receive RTM_IFINFO message, daemon knows only that interface has been created, but doesn't know his name. > I've looked into the latest revisions of rtsock.c in > OpenBSD, NetBSD and BSD/OS; they all do not seem to > set any sockaddrs in "info" before calling rt_msg1(), > and all set ifm_addrs = 0. Are you sure you're not > looking at some locally modified OpenBSD sources? oops, my fault. i didn't see problem on OpenBSD because gif interfaces are statically created on boot time. > The fix is rather trivial but I don't think we should > commit it, for the reasons specified above. ifm->ifm_addrs should be set to info.rti_addrs only in case interface is created (not on up/down events) Regards, -- Jan Oravec XS26 - 'Access to IPv6' jan.oravec@xs26.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message