Date: Fri, 4 Oct 2002 19:26:57 +0300 From: Ruslan Ermilov <ru@FreeBSD.ORG> To: yatin chalke <yat_33@yahoo.com> Cc: freebsd-net@FreeBSD.ORG Subject: Re: Parsing route dump received using sysctl Message-ID: <20021004162657.GB91159@sunbay.com> In-Reply-To: <20021004160850.25674.qmail@web9501.mail.yahoo.com> References: <20021004160850.25674.qmail@web9501.mail.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On Fri, Oct 04, 2002 at 09:08:50AM -0700, yatin chalke wrote: > Hi, > > I am currently trying to get a route dump in > freebsd4.4 using sysctl with NET_RT_DUMP. > > I am running into problems while parsing the returned > rt_msghdr structures. > > The sockaddr structures returned after the rt_msghdr > are messed up and it is not giving correct gateway or > netmask. > > For ex: when I am parsing the received route dump the > netmask received is nonzero(random value) for a > default route (which it returns as 0.0.0.0) and also > netmask doesnt appear to be a sockaddr structure. > > Also for further routes gateway and netmasks are > 0.0.0.0. > I am parsing the received sockaddr structures to get > all the values depending on flag bits set in rt_msghdr > structure. > > If anyone can help me in this matter it will be a > great help. > Look at the route(8) code, you're probably missing the necessary alignments (with the ROUNDUP() macro). Cheers, -- Ruslan Ermilov Sysadmin and DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iD8DBQE9ncFRUkv4P6juNwoRAgnVAJ9kNPjMibQbduU01bjYKC8nUnL+hgCfbOes yaI3HgpbSwZyT5sJ0itXwnM= =Nby+ -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021004162657.GB91159>
