Subject: Kernel Module
To: NetBSD Tech-Net <tech-net@netbsd.org>
From: Radivoje Todorovic <radivojet@jaspur.com>
List: tech-net
Date: 06/14/2001 13:22:18
This is a multi-part message in MIME format.

------=_NextPart_000_07F4_01C0F4D5.09672560
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello,

I have created loadable kernel module that registers pseudo device, say, =
bla0. The code basically fills in "if_net" and then does if_attach. So =
everything works fine....


Now say I do:
    ifconfig bla0 10.0.5.1 netmask 255.255.255.0

and then I want to add some remote subnet in the routing table, so the =
packets that are to be sent to this subnet, have to pass through the =
device:

route add -net 10.0.6.0 -interface bla0

This fails since it says that bla0 cannot be found. It seems that =
routing code cannot "see" my device?! Can somebody elaborate on this =
issue.=20

Note that the same (similar) code works on FreeBSD.

Regards,
Radivoje Todorovic


------=_NextPart_000_07F4_01C0F4D5.09672560
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hello,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I have created loadable kernel module =
that=20
registers pseudo device, say, bla0. The code basically fills in "if_net" =
and=20
then does if_attach. So everything works fine....</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Now say I do:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; ifconfig bla0 =
10.0.5.1 netmask=20
255.255.255.0</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>and then I want to add some remote =
subnet in the=20
routing table, so the packets that are to be sent to this subnet, have =
to pass=20
through the device:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>route add -net 10.0.6.0 -interface=20
bla0</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>This fails since it says that bla0 =
cannot be found.=20
It seems that routing code cannot "see" my device?! Can somebody =
elaborate on=20
this issue. </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Note that the same (similar) code works =
on=20
FreeBSD.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Regards,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Radivoje Todorovic</FONT></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_07F4_01C0F4D5.09672560--