[syslinux] IP details in COM32 module

Coe, Colin C. (Unix Engineer) Colin.Coe at woodside.com.au
Mon Jun 11 16:54:43 PDT 2007


Thanks lfr, that helps to explain more of what I'm doing wrong.

Another problem I'm finding is that I'm not always seeing all of the
DHCP options.  For example, my dhcp (ISC DHCP) config looks somewhat
like
--
group {
        subnet 10.1.1.0 netmask 255.255.254.0 {
                option domain-name "company.com.au";
                option subnet-mask 255.255.254.0;
                option broadcast-address 10.1.1.255;
                option domain-name-servers 192.168.1.2, 192.168.1.3;
                option routers 10.1.1.1;
                option nis-domain "company.com.au";
        }
        # PXE-specific configuration directives...
        next-server 192.168.1.4;
        filename "linux-install/pxelinux.0";
snip
        host linux96 {
                hardware ethernet 00:1A:4B:53:58:79;
                fixed-address 10.1.1.96;
                option host-name "linux96";
        }
snip
--

The code that parse the DHCP info looks like this (should look pretty
familiar):
--
unsigned int i;
for (i = 0; i < dhcp_params.length; i++) {
   const struct option_val *o = dhcp_params.buffer;
   printf("Counter: %d, %s: %s\n", i, o[i].desc, o[i].value);
}         
--
Shouldn't all of the DHCP info get printed?  Is there any reason that
the option 'host-name' isn't showing up in the list?

Alternatively, is there any way of doing a reverse DNS lookup on the
workstations IP address?

I'm pretty sure that this is my last hurdle.

TIA

CC

> -----Original Message-----
> From: syslinux-bounces at zytor.com 
> [mailto:syslinux-bounces at zytor.com] On Behalf Of Luciano Rocha
> Sent: Monday, 11 June 2007 6:40 PM
> To: syslinux at zytor.com
> Subject: Re: [syslinux] IP details in COM32 module
> 
> On Mon, Jun 11, 2007 at 06:10:02PM +0800, Coe, Colin C. (Unix 
> Engineer) wrote:
> > buff is defined as 'char *buff'.
> > 
> > Many thanks for the pointer, the code no longer produces a 
> hard hang.
> > 
> > I found a few other problems with my code as well.  Things 
> seem to work better when defined as 'char something[n]' 
> rather than 'char *something' but I'm not sure why this would 
> be the case.
> 
> Yes, things usually go better when you define memory for them.
> char something[n] defines an array of size n (the compiler 
> allocates the buffer, usually on the stack). char *something 
> defines a pointer to an area of memory. Unless you initialize 
> it (like something = malloc(n) or something = some_array), it 
> points to a random area of memory, and you're likely to corrupt data.
> 
> --
> lfr
> 0/0
> 

NOTICE: This email and any attachments are confidential. 
They may contain legally privileged information or 
copyright material. You must not read, copy, use or 
disclose them without authorisation. If you are not an 
intended recipient, please contact us at once by return 
email and then delete both messages and all attachments.




More information about the Syslinux mailing list