tcprt and tcptk 5.0 problem

I’ve recently upgraded to the new versions of tcprt and tcptk from 4.25 to
5.0 for QNX 4.25J in order to take advantage of the multicasting features it
provides. I’m running the new Tcpip socket manager since Socket and Socklet
have been removed. I’ve got software which no longer runs correctly because
it now fails during an ioctl of a socket file descriptor. The errno
returned now is #6 ENXIO, no such device or address.

Here’s the line of code that is failing, the remainder of the function is
below:
if( (code = ioctl( socketfd, SIOCGIFBRDADDR, (caddr_t)&brd_ifreq )) < 0 )

Does anyone know what may have changed in this 4.25 to 5.0 tcp upgrade to
cause this error??


The file descriptor socketfd passed in is established prior to this call in
a call:
socketfd = socket( AF_INET, SOCK_DGRAM, 0 );

and is bind()'d and has socket options:

int on;

on=1;
setsockopt (socketfd, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on)



Here’s the function:




long
getbroadcastaddr( int socketfd, long net_addr, int family )
{
struct ifconf host_conf; // Host configuration structure
struct ifreq my_ifreqs[20]; // Arrayt of host interfaces
struct ifreq *ifreqptr;
struct ifreq brd_ifreq;

struct sockaddr_in *my_sin;

int code;

char *module = “getbroadcastaddr()”;

host_conf.ifc_len = sizeof( my_ifreqs );
host_conf.ifc_req = my_ifreqs;

if( (code = ioctl( socketfd, SIOCGIFCONF, (caddr_t)&host_conf)) < 0 )
{
debug( 0, module, “Unable to ioctl socket, errno = (%d)”, errno );
return( 0 );
}


for( ifreqptr = host_conf.ifc_req; strlen( ifreqptr->ifr_name) > 0;
ifreqptr = (struct ifreq *)((caddr_t)ifreqptr + IFNAMSIZ +
ifreqptr->ifr_ifru.ifru_addr.sa_len ))
{
debug( 0, module, “interface (%s)”, ifreqptr->ifr_name );

my_sin = (struct sockaddr_in *)&ifreqptr->ifr_addr;

if( family != my_sin->sin_family )
continue;

if( net_addr != my_sin->sin_addr.s_addr )
continue;

// We found a match so get the broadcast address

debug( 0, module, “Match on interface” );

bzero( (char *)&brd_ifreq, sizeof( brd_ifreq ));
strncpy( brd_ifreq.ifr_name, ifreqptr->ifr_name, sizeof(
brd_ifreq.ifr_name ));

if( (code = ioctl( socketfd, SIOCGIFBRDADDR, (caddr_t)&brd_ifreq )) < 0 )
{
debug( 0, module, “Unable to ioctl socket, errno = (%d)”, errno );
return( 0 );
}

my_sin = (struct sockaddr_in *)&brd_ifreq.ifr_addr;
debug( 0, module, “Broadcast addr (%s)”, inet_ntoa(my_sin->sin_addr ));

return( my_sin->sin_addr.s_addr );
}

“John Yunker” <jyunker@buschmanco.com> wrote in message
news:9pslnd$7sc$1@inn.qnx.com

I’ve recently upgraded to the new versions of tcprt and tcptk from 4.25 to
5.0 for QNX 4.25J in order to take advantage of the multicasting features
it
provides. I’m running the new Tcpip socket manager since Socket and
Socklet
have been removed. I’ve got software which no longer runs correctly
because
it now fails during an ioctl of a socket file descriptor. The errno
returned now is #6 ENXIO, no such device or address.


Here’s the line of code that is failing, the remainder of the function is
below:
if( (code = ioctl( socketfd, SIOCGIFBRDADDR, (caddr_t)&brd_ifreq ))
0 )

Does anyone know what may have changed in this 4.25 to 5.0 tcp upgrade to
cause this error??


FYI, TCPIP 5.0 is a beta product and according to the beta agreement cannot

be used in a commercial product.

The file descriptor socketfd passed in is established prior to this call
in
a call:
socketfd = socket( AF_INET, SOCK_DGRAM, 0 );

and is bind()'d and has socket options:

int on;

on=1;
setsockopt (socketfd, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on)



Here’s the function:




long
getbroadcastaddr( int socketfd, long net_addr, int family )
{
struct ifconf host_conf; // Host configuration structure
struct ifreq my_ifreqs[20]; // Arrayt of host interfaces
struct ifreq *ifreqptr;
struct ifreq brd_ifreq;

struct sockaddr_in *my_sin;

int code;

char *module = “getbroadcastaddr()”;

host_conf.ifc_len = sizeof( my_ifreqs );
host_conf.ifc_req = my_ifreqs;

if( (code = ioctl( socketfd, SIOCGIFCONF, (caddr_t)&host_conf)) < 0 )
{
debug( 0, module, “Unable to ioctl socket, errno = (%d)”, errno );
return( 0 );
}


for( ifreqptr = host_conf.ifc_req; strlen( ifreqptr->ifr_name) > 0;
ifreqptr = (struct ifreq *)((caddr_t)ifreqptr + IFNAMSIZ +
ifreqptr->ifr_ifru.ifru_addr.sa_len ))
{
debug( 0, module, “interface (%s)”, ifreqptr->ifr_name );

my_sin = (struct sockaddr_in *)&ifreqptr->ifr_addr;

if( family != my_sin->sin_family )
continue;

if( net_addr != my_sin->sin_addr.s_addr )
continue;

// We found a match so get the broadcast address

debug( 0, module, “Match on interface” );

bzero( (char *)&brd_ifreq, sizeof( brd_ifreq ));
strncpy( brd_ifreq.ifr_name, ifreqptr->ifr_name, sizeof(
brd_ifreq.ifr_name ));

if( (code = ioctl( socketfd, SIOCGIFBRDADDR, (caddr_t)&brd_ifreq ))
0 )
{
debug( 0, module, “Unable to ioctl socket, errno = (%d)”, errno );
return( 0 );
}

my_sin = (struct sockaddr_in *)&brd_ifreq.ifr_addr;
debug( 0, module, “Broadcast addr (%s)”, inet_ntoa(my_sin->sin_addr ));

return( my_sin->sin_addr.s_addr );
}
\

“Mario Charest” <mcharest@clipzinformatic.com> wrote in message
news:9punk4$ehl$1@inn.qnx.com

“John Yunker” <> jyunker@buschmanco.com> > wrote in message
news:9pslnd$7sc$> 1@inn.qnx.com> …
I’ve recently upgraded to the new versions of tcprt and tcptk from 4.25
to
5.0 for QNX 4.25J in order to take advantage of the multicasting
features
it
provides. I’m running the new Tcpip socket manager since Socket and
Socklet
have been removed. I’ve got software which no longer runs correctly
because
it now fails during an ioctl of a socket file descriptor. The errno
returned now is #6 ENXIO, no such device or address.


Here’s the line of code that is failing, the remainder of the function
is
below:
if( (code = ioctl( socketfd, SIOCGIFBRDADDR, (caddr_t)&brd_ifreq ))
0 )

Does anyone know what may have changed in this 4.25 to 5.0 tcp upgrade
to
cause this error??


FYI, TCPIP 5.0 is a beta product and according to the beta agreement
cannot
be used in a commercial product.

Mario,

I think TCPIP 5.0 has been release? I could be wrong!

Augie

The file descriptor socketfd passed in is established prior to this call
in
a call:
socketfd = socket( AF_INET, SOCK_DGRAM, 0 );

and is bind()'d and has socket options:

int on;

on=1;
setsockopt (socketfd, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on)



Here’s the function:




long
getbroadcastaddr( int socketfd, long net_addr, int family )
{
struct ifconf host_conf; // Host configuration structure
struct ifreq my_ifreqs[20]; // Arrayt of host interfaces
struct ifreq *ifreqptr;
struct ifreq brd_ifreq;

struct sockaddr_in *my_sin;

int code;

char *module = “getbroadcastaddr()”;

host_conf.ifc_len = sizeof( my_ifreqs );
host_conf.ifc_req = my_ifreqs;

if( (code = ioctl( socketfd, SIOCGIFCONF, (caddr_t)&host_conf)) < 0 )
{
debug( 0, module, “Unable to ioctl socket, errno = (%d)”, errno );
return( 0 );
}


for( ifreqptr = host_conf.ifc_req; strlen( ifreqptr->ifr_name) > 0;
ifreqptr = (struct ifreq *)((caddr_t)ifreqptr + IFNAMSIZ +
ifreqptr->ifr_ifru.ifru_addr.sa_len ))
{
debug( 0, module, “interface (%s)”, ifreqptr->ifr_name );

my_sin = (struct sockaddr_in *)&ifreqptr->ifr_addr;

if( family != my_sin->sin_family )
continue;

if( net_addr != my_sin->sin_addr.s_addr )
continue;

// We found a match so get the broadcast address

debug( 0, module, “Match on interface” );

bzero( (char *)&brd_ifreq, sizeof( brd_ifreq ));
strncpy( brd_ifreq.ifr_name, ifreqptr->ifr_name, sizeof(
brd_ifreq.ifr_name ));

if( (code = ioctl( socketfd, SIOCGIFBRDADDR, (caddr_t)&brd_ifreq ))
0 )
{
debug( 0, module, “Unable to ioctl socket, errno = (%d)”, errno );
return( 0 );
}

my_sin = (struct sockaddr_in *)&brd_ifreq.ifr_addr;
debug( 0, module, “Broadcast addr (%s)”,
inet_ntoa(my_sin->sin_addr ));

return( my_sin->sin_addr.s_addr );
}


\

Mario,

I think TCPIP 5.0 has been release? I could be wrong!

Source of info: http://www.qnx.com/products/os/qnx4support.html

“Mario Charest” <mcharest@clipzinformatic.com> wrote in message
news:9puu4s$i2e$1@inn.qnx.com

Mario,

I think TCPIP 5.0 has been release? I could be wrong!


Source of info: > http://www.qnx.com/products/os/qnx4support.html



http://qdn.qnx.com/download/updates/index.html

I downloaded from “updates” from the above link, is this still beta?? I
realize the link provided shows 4.xx as the supported version. I do have
the runtime and toolkit 4.2x license as shown on this link. I’ve not
updated from the website before and am not familiar with where beta vs.
released software is kept. Thank you for any additional information about
this and possibly my original request if available.

“John Yunker” <jyunker@buschmanco.com> wrote in message
news:9pv2b1$kdu$1@inn.qnx.com

“Mario Charest” <> mcharest@clipzinformatic.com> > wrote in message
news:9puu4s$i2e$> 1@inn.qnx.com> …


Mario,

I think TCPIP 5.0 has been release? I could be wrong!


Source of info: > http://www.qnx.com/products/os/qnx4support.html



http://qdn.qnx.com/download/updates/index.html

I downloaded from “updates” from the above link, is this still beta?? I
realize the link provided shows 4.xx as the supported version. I do have
the runtime and toolkit 4.2x license as shown on this link. I’ve not
updated from the website before and am not familiar with where beta vs.
released software is kept. Thank you for any additional information about
this and possibly my original request if available.

I think QNX needs to clarify this.

“Mario Charest” <mcharest@clipzinformatic.com> wrote in message
news:9pv2mg$kma$1@inn.qnx.com

“John Yunker” <> jyunker@buschmanco.com> > wrote in message
news:9pv2b1$kdu$> 1@inn.qnx.com> …

“Mario Charest” <> mcharest@clipzinformatic.com> > wrote in message
news:9puu4s$i2e$> 1@inn.qnx.com> …


Mario,

I think TCPIP 5.0 has been release? I could be wrong!


Source of info: > http://www.qnx.com/products/os/qnx4support.html



http://qdn.qnx.com/download/updates/index.html

I downloaded from “updates” from the above link, is this still beta?? I
realize the link provided shows 4.xx as the supported version. I do
have
the runtime and toolkit 4.2x license as shown on this link. I’ve not
updated from the website before and am not familiar with where beta vs.
released software is kept. Thank you for any additional information
about
this and possibly my original request if available.


I think QNX needs to clarify this.


I’ve found the answer to the original problem to be my compiler flags
being set to -zp4 instead of the default -zp1. This affects memory

alignment and possibly the latest tcp lib’s were not compiled friendly to my
zp4 setting. I would still be interested in knowing whether tcpip 5.0 is
released or still beta.

“Mario Charest” <mcharest@clipzinformatic.com> wrote in message
news:9punk4$ehl$1@inn.qnx.com

FYI, TCPIP 5.0 is a beta product and according to the beta agreement
cannot
be used in a commercial product.

5.0 has been released for a while now.

Bill Caroselli

“Bill Caroselli (Q-TPS)” <qtps@earthlink.net> wrote:

“Mario Charest” <> mcharest@clipzinformatic.com> > wrote in message
news:9punk4$ehl$> 1@inn.qnx.com> …
FYI, TCPIP 5.0 is a beta product and according to the beta agreement
cannot
be used in a commercial product.

5.0 has been released for a while now.

Correct, 5.0 is released.

-Adam

“Operating System for Tech Supp” <os@qnx.com> wrote in message
news:9q1fqf$j90$2@nntp.qnx.com

“Bill Caroselli (Q-TPS)” <> qtps@earthlink.net> > wrote:

“Mario Charest” <> mcharest@clipzinformatic.com> > wrote in message
news:9punk4$ehl$> 1@inn.qnx.com> …
FYI, TCPIP 5.0 is a beta product and according to the beta agreement
cannot
be used in a commercial product.

5.0 has been released for a while now.

Correct, 5.0 is released.

-Adam

Okay, thanks.

This is probably in the new CD?

Augie

Augie Henriques <augiehenriques@hotmail.com> wrote:

“Operating System for Tech Supp” <> os@qnx.com> > wrote in message
news:9q1fqf$j90$> 2@nntp.qnx.com> …
“Bill Caroselli (Q-TPS)” <> qtps@earthlink.net> > wrote:

“Mario Charest” <> mcharest@clipzinformatic.com> > wrote in message
news:9punk4$ehl$> 1@inn.qnx.com> …
FYI, TCPIP 5.0 is a beta product and according to the beta agreement
cannot
be used in a commercial product.

5.0 has been released for a while now.

Correct, 5.0 is released.

-Adam

Okay, thanks.

This is probably in the new CD?

Augie

You can download TCP/IP 5.0 from http://qdn.qnx.com/download/updates/index.html
You just have to scroll to the bottom of the page.

Barry