Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - devn driver causes a route to get added in the system: (4 Items)
   
devn driver causes a route to get added in the system  
Hi.. 
We have developed a devn driver which can be mounted into io-net.  The interface shows up fine (dpd0) and generally 
things seem to work.  But when I do a netstat -rn I see that a route to lo0 has been added.  

If I assign address 192.168.0.1 to the interface I created..  then the following line appears in the routing table.  

Destination:         Gateway            Flags       Refs   Use   MTU  Interface
192.168.0.1        192.168.0.1        UH          0        0      -      lo0


Also, I see my tx_done function (the third function in the io_net_registrant_funcs_t) gets called when I do ifconfig 
dpd0 192.168.0.1 

Here is the entire routing table and output of the ifconfig (We also have an ethernet en1 interface running).  

Destination        Gateway                 Flags     Refs     Use    Mtu  Interface
default              77.177.39.1              UG         1        9      -         en1
127.0.0.1          127.0.0.1                 UH         0        0  33212      lo0
77.177.39/24      link#3                    UC         1        0      -          en1
77.177.39.1       00:00:5e:00:01:01   UHLc      1        0      -          en1
192.168            192.168.0.1             U           0        0      -          dpd0
192.168.0.1        192.168.0.1            UH        0        0      -           lo0

lo0: flags=8009<UP,LOOPBACK,MULTICAST> mtu 33212
        capabilities=7<IP4CSUM,TCP4CSUM,UDP4CSUM>
        enabled=0<>
        inet 127.0.0.1 netmask 0xff000000
dpd0: flags=c43<UP,BROADCAST,RUNNING,OACTIVE,SIMPLEX> mtu 1500
        inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255
en1: flags=8a43<UP,BROADCAST,RUNNING,ALLMULTI,SIMPLEX,MULTICAST> mtu 1500
        address: 00:80:c8:3a:96:a2
        inet 77.177.39.101 netmask 0xffffff00 broadcast 77.177.39.25

Re: devn driver causes a route to get added in the system  
> Hi.. 
> We have developed a devn driver which can be mounted into io-net.  The 
> interface shows up fine (dpd0) and generally things seem to work.  But when I 
> do a netstat -rn I see that a route to lo0 has been added.  
> 
> If I assign address 192.168.0.1 to the interface I created..  then the 
> following line appears in the routing table.  
> 
> Destination:         Gateway            Flags       Refs   Use   MTU  
> Interface
> 192.168.0.1        192.168.0.1        UH          0        0      -      lo0
> 
> 
> Also, I see my tx_done function (the third function in the 
> io_net_registrant_funcs_t) gets called when I do ifconfig dpd0 192.168.0.1 
> 
> Here is the entire routing table and output of the ifconfig (We also have an 
> ethernet en1 interface running).  
> 
> Destination        Gateway                 Flags     Refs     Use    Mtu  
> Interface
> default              77.177.39.1              UG         1        9      -    
>      en1
> 127.0.0.1          127.0.0.1                 UH         0        0  33212     
>  lo0
> 77.177.39/24      link#3                    UC         1        0      -      
>     en1
> 77.177.39.1       00:00:5e:00:01:01   UHLc      1        0      -          en1
> 
> 192.168            192.168.0.1             U           0        0      -      
>     dpd0
> 192.168.0.1        192.168.0.1            UH        0        0      -         
>   lo0
> 
> lo0: flags=8009<UP,LOOPBACK,MULTICAST> mtu 33212
>         capabilities=7<IP4CSUM,TCP4CSUM,UDP4CSUM>
>         enabled=0<>
>         inet 127.0.0.1 netmask 0xff000000
> dpd0: flags=c43<UP,BROADCAST,RUNNING,OACTIVE,SIMPLEX> mtu 1500
>         inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255
> en1: flags=8a43<UP,BROADCAST,RUNNING,ALLMULTI,SIMPLEX,MULTICAST> mtu 1500
>         address: 00:80:c8:3a:96:a2
>         inet 77.177.39.101 netmask 0xffffff00 broadcast 77.177.39.25
> 


I guess I never really put what my question was..   I have two..  
1) Why does it add that route?
2) Why does my tx_done function (the third function in the 
> io_net_registrant_funcs_t) get called when I do ifconfig ?
Re: devn driver causes a route to get added in the system  
On Wed, Mar 18, 2009 at 08:46:27AM -0400, Mihir Daftari wrote:
> > Hi.. 
> > We have developed a devn driver which can be mounted into io-net.  The 
> > interface shows up fine (dpd0) and generally things seem to work.  But when I 
> > do a netstat -rn I see that a route to lo0 has been added.  
> > 
> > If I assign address 192.168.0.1 to the interface I created..  then the 
> > following line appears in the routing table.  
> > 
> > Destination:         Gateway            Flags       Refs   Use   MTU  
> > Interface
> > 192.168.0.1        192.168.0.1        UH          0        0      -      lo0
> > 
> > 
> > Also, I see my tx_done function (the third function in the 
> > io_net_registrant_funcs_t) gets called when I do ifconfig dpd0 192.168.0.1 
> > 
> > Here is the entire routing table and output of the ifconfig (We also have an 
> > ethernet en1 interface running).  
> > 
> > Destination        Gateway                 Flags     Refs     Use    Mtu  
> > Interface
> > default              77.177.39.1              UG         1        9      -    
> >      en1
> > 127.0.0.1          127.0.0.1                 UH         0        0  33212     
> >  lo0
> > 77.177.39/24      link#3                    UC         1        0      -      
> >     en1
> > 77.177.39.1       00:00:5e:00:01:01   UHLc      1        0      -          en1
> > 
> > 192.168            192.168.0.1             U           0        0      -      
> >     dpd0
> > 192.168.0.1        192.168.0.1            UH        0        0      -         
> >   lo0
> > 
> > lo0: flags=8009<UP,LOOPBACK,MULTICAST> mtu 33212
> >         capabilities=7<IP4CSUM,TCP4CSUM,UDP4CSUM>
> >         enabled=0<>
> >         inet 127.0.0.1 netmask 0xff000000
> > dpd0: flags=c43<UP,BROADCAST,RUNNING,OACTIVE,SIMPLEX> mtu 1500
> >         inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255
> > en1: flags=8a43<UP,BROADCAST,RUNNING,ALLMULTI,SIMPLEX,MULTICAST> mtu 1500
> >         address: 00:80:c8:3a:96:a2
> >         inet 77.177.39.101 netmask 0xffffff00 broadcast 77.177.39.25
> > 
> 
> 
> I guess I never really put what my question was..   I have two..  
> 1) Why does it add that route?

Are you sure it's happening on ifconfig.  The subnet route
will be created which is this one in your out put above:

192.168    192.168.0.1    U     0    0    - dp0

Is the lo0 one being made on first access? eg when you
ping yourself?

> 2) Why does my tx_done function (the third function in the 
> > io_net_registrant_funcs_t) get called when I do ifconfig ?

Someone must be returning a packet you sent up or you're
calling it yourself (sending up a packet that no one took).

-seanb
Re: devn driver causes a route to get added in the system  
Thanks for your quick response.  

I was looking at the wrong thing..   My RxDown gets called when I do an ifconfig and not TxDown.  

And regarding that route being added .. I am sure that ifconfig dpd0 x.x.x.x causes that route to be added.    

Here is what I do to make sure that ifconfig is causing it. 

1) Delete that route from the routing table using:

route delete 192.168.0.1

2) Then I do:
 ifconfig dpd0 192.168.0.1

Doing that ifconfig causes rx_down being called.  

3) Then doing netstat -rn causes the following route

192.168.0.1        192.168.0.1        UH          0        0      -  lo0