Date: Thu, 14 Aug 2003 19:53:42 +0100 From: Bruce M Simpson <bms@spc.org> To: Bill Fenner <fenestro@freebsd.org> Cc: freebsd-net@freebsd.org Subject: Netmasks and PF_ROUTE rockets Message-ID: <20030814185342.GK1409@spc.org>
next in thread | raw e-mail | index | archive | help
Bill, Thanks for your help the other week. It seems, though, that in order to fix my code, I had to replicate exactly what route(8) did. Specifically, it fills out the netmask sockaddr_in in this way: it counts the number of bytes of netmask set within the sockaddr and sets sin_len accordingly. It is also necessary to pad each sockaddr after the rtmsg header to the nearest longword, otherwise nothing works. I have actually managed to panic the 5.1 kernel by passing a wrongly formatted routing message in. The on-demand routing example now works on its own without the need for the user to configure an interface or a route; they do have to specify a network address in CIDR notation which will be used with the XRESOLVE flag and the disc1 interface. They also need to kldload if_disc, I haven't brought maybeload in from ifconfig(8) [yet]. BMS
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030814185342.GK1409>