hascall@cs.iastate.edu (John Hascall) (05/31/90)
I am working on a bootp client which I hope to use as follows (in /etc/rc.local): ifconfig `bootp-client` The aim of the program is to produce a string like the following: se0 129.186.1.62 netmask 255.255.255.0 broadcast 129.186.1.255 The client program creates a datagram socket, but when it attempts to bind (to addr=INADDR_ANY, port=BOOTP) it fails unless I preceed the bind with a SIOCSIFADDR (set address) ioctl call%. Herein lies the problem: the whole reason for this program is to discover the address! If I just stick in a bogus address (say 129.186.0.0) I get the bootp request sent fine, but I don't receive the reply. I have tried all sorts of things but none have worked... ...does any one have any ideas on how to make this work? Thanks again, John Hascall hascall@atanasoff.cs.iastate.edu % according to man side effect of SIOCSIFADDR is to initialize the interface
thinman@cup.portal.com (Lance C Norskog) (06/02/90)
You have a logical conundrum here. You are trying to figure out how to "turn on" IP, but you are trying to use IP to figure this out. You have to send and receive your own raw Ethernet packets. Ultrix may have some technique for doing this. System V has it's own scheme where the Ethernet devices have their own /dev entries (jeeez wotta concept) which you open and "bind" to a protocol number. good luck.