sendto(msg) points to uninitialised byte(s)



My program is to send data using socket.. but I got the error message:
"sendto(msg) points to uninitialised byte(s) " This is my source code

1. key_list = emalloc(BUFSIZE - sizeof(Key) - sizeof(byte) -
sizeof(int));
bzero(key_list, sizeof(*key_list));

bp = key_list;

memmove(bp, key, ID_LEN);
bp += ID_LEN;

memmove(bp, &ip_num, sizeof(int));
bp += sizeof(int);

pack_addr = htonl(addr);
memmove(bp, &pack_addr, sizeof(ulong));
bp +=sizeof(ulong);

Ivn_send_key(srv, ttl, succ->addr, succ->port, bp, (bp -
key_list), addr, port);

2.
void Ivn_send_key(Vnode *srv, byte ttl, ulong to_addr, ushort
to_port, uchar *key_list, int list_len, ulong addr, ushort port)
{
byte buf[BUFSIZE];

Ivn_send_raw(srv, to_addr, to_port, Ivn_pack_key(buf, ttl, key_list,
list_len, addr, port), buf);
}

3.
int Ivn_pack_key(uchar *buf, byte ttl, uchar *key_list, int list_len,
ulong addr, ushort port)
{
//return Ivn_pack(buf, "ccxls", CHORD_KEY, ttl, key_list , port);
uchar *bp;
ushort sport;

bp = buf;

*bp++ = CHORD_KEY;

*bp++ = ttl;

sport = htons(port); //port number
memmove(bp, (char *)&sport, sizeof(ushort));
bp += sizeof(ushort);

memmove(bp, key_list, list_len);
bp += list_len;
free(key_list);

return bp -buf;
}

4.
void Ivn_send_raw(Vnode *srv, in_addr_t addr, in_port_t port, int n,
uchar *buf)
{
struct sockaddr_in dest;

memset(&dest, 0, sizeof(dest));
dest.sin_family = AF_INET;
dest.sin_port = htons(port);
dest.sin_addr.s_addr = htonl(addr);

//fprintf(stderr, " dst addr is %s\n", inet_ntoa(dest.sin_addr));

if (sendto(srv->out_sock, buf, n, 0, (struct sockaddr *) &dest,
sizeof(dest)) < 0)
warnm("sendto failed:"); /* ignore errors for now */
}


please help to correct the error?

.



Relevant Pages

  • Re: port 4125
    ... The error message indeed indicates that there is some process use the port ... then please try to logon to SBS server box to test the ... This newsgroup only focuses on SBS technical issues. ... I attached a screenshot of the error message I receive. ...
    (microsoft.public.windows.server.sbs)
  • Re: COM1 not behaving...
    ... perhaps the BIOS is handing off 4 and OS is assigning 7 because it thinks 4 is used and there is the error message? ... What's weird though, is that I just noticed that COM1 now has IRQ 7, while it had IRQ 4 yesterday. ... I haven't swapped the expansion card to a different PCI slot yet, ... I seem to have a stubborn serial port. ...
    (microsoft.public.windowsxp.hardware)
  • Re: COM1 not behaving...
    ... Erik wrote: ... Now, when I start my PC, right before my mouse lights up, my device connected to COM1 clicks as it has done for all the years that I've been using it. ... I have gone through the event viewer again, but there are no new errors concerning the com port. ... I've done a Google search for this error message; ...
    (microsoft.public.windowsxp.hardware)
  • Re: COM1 not behaving...
    ... IRQ's the same, memory allocations, nothing changed to speed ... connected to COM1 clicks as it has done for all the years that I've ... serial port, a fifo was detected. ... search for this error message; ...
    (microsoft.public.windowsxp.hardware)
  • Re: COM1 not behaving...
    ... "Bob I" wrote: ... connected to COM1 clicks as it has done for all the years that I've ... serial port, a fifo was detected. ... search for this error message; ...
    (microsoft.public.windowsxp.hardware)