1833476 Members
3256 Online
110052 Solutions
New Discussion

Problem with /dev/lan0

 
Terry Washington_1
Frequent Advisor

Problem with /dev/lan0

My company is having a licensing problem with a client system that is running HP-UX 10.20. Our license attempts to authenticate software with info from /dev/lan0. The license script can't open /dev/lan0 for access read. I was able to re-create the problem on our Visualize C160 which is running HP-UX 11.00. I do a more of /dev/lan0 and get a message "no such device". I verified that lan0 was the name of the interface within lanadmin. You can do an ls of /dev/lan0 and it has the proper permissions. I even tried opening up the permissions to 777. When I do a "file" of /dev/lan0 I get the expected "character special" output. We had the client try these same steps on their system with identical results. We have numerous other clients that are able to authenticate their software using /dev/lan0 without a problem. Does anyone have any ideas?
10 REPLIES 10
Sachin Patel
Honored Contributor

Re: Problem with /dev/lan0

Hi Terry
It should be like this
crw------- 1 root root 239 0x000000 Sep 14 2001 lan0

Or you can remove this file and recreate it using
rmsf and then insf

Sachin
Is photography a hobby or another way to spend $
Jeff Schussele
Honored Contributor

Re: Problem with /dev/lan0

What happens if you do a
#tail -f /dev/lan0 ?
This will leave the read open until a ctrl-c.

Curious - just WHAT are you expecting to read?
Could it be that you are "hoping" there will be net traffic to read & there is none at the time you read?
Does the device have to be operational i.e. physically connected to something, at time of "license check"?


Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
pap
Respected Contributor

Re: Problem with /dev/lan0

Just do following.

#insf -e
#ioscan -fn | grep -i lan0

check the s/w state is CLAIMED for this device.
If it is ok then you are fine.

Can you give some more details like what exactly this software does? which user it uses to access lan0 device?

Thanks,

-pap
"Winners don't do different things , they do things differently"
Terry Washington_1
Frequent Advisor

Re: Problem with /dev/lan0

Jeff,

I received the below when I ran tail -f.

# tail -f /dev/lan0
tail: cannot open input
error: No such device on file lan0

I wanted to try Sachin's idea of removing the file and recreate it via rmsf/insf but I could not make a copy of the original file. It is almost as if it does not exist. I received the below when attempting to copy.

# cp /dev/lan0 /dev/lan0.020412.tew
cp: cannot open /dev/lan0: No such device

I did a more of /dev/lan0 on our other HP (an old Apollo series 700) running 10.20 and received an empty screen with "read error" at the bottom. I guess that the file was recognized but couldn't be read because it is a special file. I don't believe that there has to be network traffic or an operational device at the time of the read.
Jeff Schussele
Honored Contributor

Re: Problem with /dev/lan0

Terry,

Don't worry about copying the file. insf will recreate it. Also the autoconfig capability of HP-UX would recreate it at the next boot as well.
Also have you ran the ioscan as suggested earlier & if so what was the outpu?

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Terry Washington_1
Frequent Advisor

Re: Problem with /dev/lan0

I ran ioscan and received a message "no such device". I then deleted /dev/lan0 via rmsf. I then tried to recreate it using insf. I wasn't sure what argumants to use so I went ahead and rebooted thinking that /dev/lan0 would be receated upon reboot but it wasn't. I then ran insf -e which did recreate /dev/lan0. I then ran ioscan -fn |grep -i lan0 again and received the below output.

# ioscan -fn |grep -i lan0
/dev/diag/lan0 /dev/ether0 /dev/lan0

I then tried to do a more of /dev/lan0 again and received "no such device".

Here is some additional info about the license script. In it's simplest form, the application calls open() on /dev/lan0. The
application can be run by any user, so /dev/lan0 must be readable by all.
Below is a snippet of the code. It is this open that fails.

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include

#include
#include
#include

main()
{
int fd;
int i;
struct fis req;
unsigned char addr[6];
static char cpuname[30];

if ( (fd = open ("/dev/lan0", O_RDONLY)) < 0 )
{
printf (" open error %d fd= %d", errno,fd);
exit(1);
}
}




Roger Baptiste
Honored Contributor

Re: Problem with /dev/lan0

hi,

what does lanscan show?
Is the lan port plumbed? (set up for use).
(ifconfig plumb)/

HTH
raj
Take it easy.
Terry Washington_1
Frequent Advisor

Re: Problem with /dev/lan0

The results of lanscan are below. I am sure that lan0 is plumbed as I am logged into the system remotely.

# lanscan
Hardware Station Crd Hdw Net-Interface NM MAC HP-DLPI DLPI
Path Address In# State NamePPA ID Type Support Mjr#
8/16/6 0x0060B018DE64 0 UP lan0 snap0 1 ETHER Yes 119
Bill Hassell
Honored Contributor

Re: Problem with /dev/lan0

The problem is that you can't just open the LAN device. Unlike a tape or disk or terminal, it is not a stream of data that anyone can look at. inetd owns the interface and sorts out which daemon gets each message.

Most likely, the licensing code of the program must be changed to accomodate HP-UX. This is not unusual as there are very esoteric standards about hardware-level LAN access, none of which are found in general Unix standards. There are different methods depending on the rev of HP-UX and to a certain extent, patch level. What is the type of system call you're using to obtain LAn info?


Bill Hassell, sysadmin
Terry Washington_1
Frequent Advisor

Re: Problem with /dev/lan0

We have several clients that currently run the application on their systems running HP-UX version 10.20 and 11.00. It is able to open /dev/lan0 on their systems. The call is to 'open()'. I have included some sample code below.

main()
{
int fd;
int i;
struct fis req;
unsigned char addr[6];
static char cpuname[30];

if ( (fd = open ("/dev/lan0", O_RDONLY)) < 0 )
{
printf (" open error %d fd= %d", errno,fd);
exit(1);
}
}