Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Converting io-net filter to pfil hook: (4 Items)
   
Converting io-net filter to pfil hook  
We are attempting to migrate an io-net filter to an io-pkt pfil hook.
Thus far, we've only had limited success. When we try to mount our hook,
we end up with quite a few undefined symbols. These symbols are defined
in shared libraries that we build from our sources and then link into
the hook. The LD_LIBRARY_PATH variable is set to the location of the
required shared object files. Unfortunately, mount can't seem to find
them. Is there some other way to specify where mount should look for
shared libraries or is shared library use by LSM's just not supported?

 

The answer to the question above seems be "LSM's can load shared
modules" because when we tried starting a second instance of io-pkt we
were able to mount our pfil hook. Unfortunately, the second instance of
io-pkt didn't have any interfaces. Additionally, starting the second
instance of io-pkt seems to kill the existing, working interfaces (i.e.
we can no longer telnet into the box, ifconfig only lists lo0). So,
mounting our hook onto a second io-pkt instance doesn't do us much good
because there are no interfaces for data. When we try to mount a driver
onto the second io-pkt instance, the mount fails (Can't mount / (type
io-pkt2)). We tried creating the second instance of io-pkt because we
were using a second instance of io-net for our filter. Having two
instances of the stack probably doesn't make much sense because we want
to attach our hook to one interface on an Intel 82563 dual interface
NIC.

 

Any ideas on what we're missing would be appreciated?

 

Mark

 

Re: Converting io-net filter to pfil hook  
On Fri, Mar 12, 2010 at 03:31:08PM -0500, Mark Dowdy wrote:
> We are attempting to migrate an io-net filter to an io-pkt pfil hook.
> Thus far, we've only had limited success. When we try to mount our hook,
> we end up with quite a few undefined symbols. These symbols are defined
> in shared libraries that we build from our sources and then link into
> the hook. The LD_LIBRARY_PATH variable is set to the location of the
> required shared object files. Unfortunately, mount can't seem to find
> them. Is there some other way to specify where mount should look for
> shared libraries or is shared library use by LSM's just not supported?

You need to set LD_LIBRARY path on io-pkt, not mount.

> 
>  
> 
> The answer to the question above seems be "LSM's can load shared
> modules" because when we tried starting a second instance of io-pkt we
> were able to mount our pfil hook. Unfortunately, the second instance of
> io-pkt didn't have any interfaces. Additionally, starting the second
> instance of io-pkt seems to kill the existing, working interfaces (i.e.
> we can no longer telnet into the box, ifconfig only lists lo0). So,
> mounting our hook onto a second io-pkt instance doesn't do us much good
> because there are no interfaces for data. When we try to mount a driver
> onto the second io-pkt instance, the mount fails (Can't mount / (type
> io-pkt2)). We tried creating the second instance of io-pkt because we
> were using a second instance of io-net for our filter. Having two
> instances of the stack probably doesn't make much sense because we want
> to attach our hook to one interface on an Intel 82563 dual interface
> NIC.

Check out the io-pkt docs for the options that control
targeting multiple stacks.  In particular

# io-pkt -i1 -ptcpip prefix=/alt ...
# mount -T io-pkt1 ...
# SOCK=/alt ifconfig

Regards,

-seanb
Re: Converting io-net filter to pfil hook  
Thanks for the LD_LIBRARY_PATH key. That was the missing piece. If we slay io-pkt and  restart it after we've included 
the path to our binaries in LD_LIBRARY_PATH, we are able to mount our hook. We'll likely head down that path instead of 
wrestling with the second instance of io-pkt.

FWIW, here's what we see when we try to start the second instance of io-pkt.

# io-pkt-v4 -i1 -ptcpip prefix=/alt
# SOCK=/alt ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33192
        inet 127.0.0.1 netmask 0xff000000
# mount -Tio-pkt1 /lib/dll/devnp-e1000.so
mount: Can't mount / (type io-pkt1)
mount: Possible reason: No such device

When we run sloginfo, we see an entry that contains
'Unable to init /lib/dll/devnp-e1000.so : No such device
RE: Converting io-net filter to pfil hook  
The pci manager only allows a device to be attached to once.  If the
first stack has a driver handling a particular nic the second instance
of the driver in the second stack will fail.

Regards,

-seanb

-----Original Message-----
From: Mark Dowdy [mailto:community-noreply@qnx.com]
Sent: Fri 3/12/2010 7:06 PM
To: ionetmig-networking
Subject: Re: Converting io-net filter to pfil hook
 
Thanks for the LD_LIBRARY_PATH key. That was the missing piece. If we slay io-pkt and  restart it after we've included 
the path to our binaries in LD_LIBRARY_PATH, we are able to mount our hook. We'll likely head down that path instead of 
wrestling with the second instance of io-pkt.

FWIW, here's what we see when we try to start the second instance of io-pkt.

# io-pkt-v4 -i1 -ptcpip prefix=/alt
# SOCK=/alt ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33192
        inet 127.0.0.1 netmask 0xff000000
# mount -Tio-pkt1 /lib/dll/devnp-e1000.so
mount: Can't mount / (type io-pkt1)
mount: Possible reason: No such device

When we run sloginfo, we see an entry that contains
'Unable to init /lib/dll/devnp-e1000.so : No such device




_______________________________________________

io-net migration
http://community.qnx.com/sf/go/post49399


Attachment: Text winmail.dat 3.08 KB