From owner-freebsd-net Sun Nov 14 14:49:47 1999 Delivered-To: freebsd-net@freebsd.org Received: from mail-out1.apple.com (mail-out1.apple.com [17.254.0.52]) by hub.freebsd.org (Postfix) with ESMTP id E31A614BC7 for ; Sun, 14 Nov 1999 14:49:45 -0800 (PST) (envelope-from justin@walker3.apple.com) Received: from mailgate2.apple.com ([17.129.100.225]) by mail-out1.apple.com (8.9.3/8.9.3) with ESMTP id OAA13575 for ; Sun, 14 Nov 1999 14:49:44 -0800 (PST) Received: from scv1.apple.com (scv1.apple.com) by mailgate2.apple.com (Content Technologies SMTPRS 2.0.15) with ESMTP id for ; Sun, 14 Nov 1999 14:49:36 -0800 Received: from walker3.apple.com (walkeridsl1.apple.com [17.219.158.66]) by scv1.apple.com (8.9.3/8.9.3) with ESMTP id OAA20873 for ; Sun, 14 Nov 1999 14:49:35 -0800 (PST) Received: by walker3.apple.com (8.9.1/8.9.1) id OAA00738 for freebsd-net@freebsd.org; Sun, 14 Nov 1999 14:49:40 -0800 (PST) Message-Id: <199911142249.OAA00738@walker3.apple.com> To: freebsd-net@freebsd.org Subject: Question about netmask retrieval Date: Sun, 14 Nov 1999 14:49:39 -0800 From: "Justin C. Walker" Reply-To: justin@apple.com X-Mailer: by Apple MailViewer (2.105.dev) Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org This is a quickie, I think: in doing the obvious (to me) thing to retrieve the netmask associated with an IP address assigned to an interface, I use SIOCGIFNETMASK with an ifreq struct that I get from SIOCGIFCONF. If there are aliases assigned, I see the netmask associated with the "primary" (?) IP address, rather than that of the alias address in question (the one specified in the ifreq). This seems to be caused by the fact that the kernel code find the "first" ifaddr struct for the interface, and stops looking. Bug? Feature? I know there are alternative ways to do this, but I'm curious about the reason for this behavior. Regards, Justin -- Justin C. Walker, Curmudgeon-At-Large * Institute for General Semantics | Manager, CoreOS Networking | Men are from Earth. Apple Computer, Inc. | Women are from Earth. 2 Infinite Loop | Deal with it. Cupertino, CA 95014 | *-------------------------------------*-------------------------------* To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message