Tony Collins wrote:
> All,
> 
> Our product requires a STREAMS module to be pushed on all open TCP/UDP 
> streams.  What is the recommended way to deliver a package that does this on 
> Solaris 10?

What problem are you trying to solve?
The reason I'm asking is that some TCP streams are setup by the kernel 
during boot (the TCP default queue) and there isn't an easy way to 
interpose on that one. But depending on what you want to do, you might 
not need to see that.

> Currently, we attempt to do this using SMF.  We have a "service" that simply 
> calls a program that "autopushes" the module on the TCP and UDP devices.  I'm 
> not sure why the original developers did not use autopush rather than writing 
> a home grown program to do the same thing, but there does seem to be a 
> problem with using autopush (more on that later).  The postinstall script in 
> our package calls svccfg import and svcadm enable to import and enable the 
> service.  This mechanism seems to work except for running in a Jumpstart 
> environment.  There, the svcadm and svccfg commands are not valid.
> 
> If all we need to do is autopush a STREAMS module, using SMF seems like 
> overkill.  We could just add a line to /etc/inittab to do the autopush, 
> similar to what is already being done there with iu.ap.  It has been pointed 
> out to me that we could also just modify iu.ap itself, although, I was not 
> aware that Sun would recommend that 3rd-party installers modify that file.  
> Is this a better way to go than creating a "service" that does the autopush?  
> Is modifying iu.ap supported?
> 
> I have experimented with adding a line into /etc/inittab to call autopush for 
> our module.  It gives weird behavior though.  Even though we autopush on TCP 
> and UDP, if I do strconf on /dev/udp and /dev/udp6 after the autopush, our 
> module does not show up.  It does for /dev/tcp and /dev/tcp6.  When calling 
> our homegrown program installed, it works for all four devices consistently.  
> I have included our program if anyone wants to look at it.  It is only 200 
> lines.

That is probably because there is already autopush for udp (setup by the 
kernel but not for TCP. (Prior to Solaris 10 there was similar setup for 
TCP.) So your ioctl might just fail because there is an existing setup 
for UDP. The kernel setup is done in
http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/io/strplumb.c


Also be aware that the details of the autopush setup has changed in 
Nevada. See http://cr.grommit.com/~nordmark/ipd0/ip-plumbing-design.pdf

The way to do a autopush that would work across different releases of 
solaris would be to first get the autopush information (akin to how 
'autopush -g -M 41 -m 0' gets it), and if that returns a list then 
append to that list of modules. Otherwise just set autopush for your module.

But as I said above, I'd really like to understand what problem your 
STREAMS module is trying to solve. There might be easier ways to 
accomplish what it does.

    Erik
_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to