Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Programmatic creation of VLAN using ioctl - Not working as it should: (17 Items)
   
Programmatic creation of VLAN using ioctl - Not working as it should  
Hi,

I tried to programmatically add and delete VLAN group by using the following ioctl calls. Doesn't work as intended. I 
then checked the ifconfig sourcecode and it looks like for QNX we have to use ioctl_socket instead of ioctl. I checked 
the code I wrote with ioctl and ioctl_packet. No problems during compilation or running but the results are completely 
different. Things are setup correct with ioctl_socket but not so with ioctl.

My questions:
1. For QNX, should I be making a general rule to use ioctl_socket instead of ioctl?
2. Are there plans to make it a standard ioctl interface instead of ioctl_socket? Can someone explain me the reason why 
the interface definition was changed instead of changing the implementation within ioctl?

Thanks,
Santosh




Re: Programmatic creation of VLAN using ioctl - Not working as it should  
About mid way through this forum thread is a good description of the ioctl usage with io-pkt.

http://community.qnx.com/sf/discussion/do/listPosts/projects.networking/discussion.drivers.topc1801

The short answer is that because you can't pass pointers around with the ioctl in a message passing OS, you have to 
wrapper the  ioctl calls in your application.

  You'll probably still have some questions after reading the post, but that's a good place to start.

   Robert.
Re: Programmatic creation of VLAN using ioctl - Not working as it should  
On Sat, Aug 02, 2008 at 01:21:36PM -0400, Robert Craig wrote:
> About mid way through this forum thread is a good description of the ioctl usage with io-pkt.
> 
> http://community.qnx.com/sf/discussion/do/listPosts/projects.networking/discussion.drivers.topc1801
> 
> The short answer is that because you can't pass pointers around with the ioctl in a message passing OS, you have to 
wrapper the  ioctl calls in your application.
> 
>   You'll probably still have some questions after reading the post, but that's a good place to start.
> 

There is a PR internally to make some of the common ioctls
that use embedded pointers more 'intuituve'.  Since they
need special case handling there may always be some that
need to be addressed on a per instance basis.

-seanb
Re: Programmatic creation of VLAN using ioctl - Not working as it should  
Hi There,

Things seemed to be working with VLAN creation but for some reason, it stopped working for me and I'd like to get some 
urgent help on this.

I am using io-pkt (I think revision 400) a little old but I have applied some changes to io-pkt to support one feature 
currently available in RFC2292 only. Everything else seems to be working fine excepting that I cannot create VLAN groups
. I would like to add that it used to work a while back but not any more. The difference is that currently I am 
packaging io-pkt into a BSP and previously I used to run it out of compact flash. Im assuming that shouldnt make a 
difference.

Anyway, the exact problem is that the VLAN interface gets created, but in the following creation, ifconfig does a get of
 the interface and that fails.

Following the stack trace upon executing ifconfig vlan4 create vlan 256 vlanif en4:

Thread [2] (Suspended)	
	9 vlan_ioctl() /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/net/if_vlan.c:610 0x48081ca8	
	8 in_control() /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/netinet/in.c:587 0x48085ae8	
	7 udp_usrreq() /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/netinet/udp_usrreq.c:1282 0x480eb160	
	6 compat_ifioctl() /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/compat/common/uipc_syscalls_43.c:620 
0x480fda24	
	5 ifioctl() /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/net/if.c:2160 0x480618b4	
	4 soo_ioctl() /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/kern/sys_socket.c:182 0x480d3b8c	
	3 tcpip_devctl() /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/msg.c:1567 0x480ad6c8	
	2 startproc() /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/proc.c:703 0x480ba3e8

The exact area where the problem is discovered is:

memset(&vlr, 0, sizeof(vlr));
if (ifv->ifv_p != NULL) {
    snprintf(vlr.vlr_parent, sizeof(vlr.vlr_parent), "%s",
    ifv->ifv_p->if_xname);
    vlr.vlr_tag = ifv->ifv_tag;
}
#ifndef __QNXNTO__
	error = copyout(&vlr, ifr->ifr_data, sizeof(vlr));
#else
	error = copyout(&vlr, data + sizeof(*ifr), sizeof(vlr));

The contents of ifv is:
ifv	0x48563a00	
	ifv_u	{...}	
	ifv_p	0x00000000	
	ifv_mib	{...}	
	ifv_mc_listhead	{...}	
	ifv_list	{...}	
	ifv_flags	0	
	ifv_alloc	0x485639e0	



and quite obviously, the code returns with a BAD Address error. I dont know what happened to the data passed in the 
ioctl, seems like it never got to this point. How can I proceed to debug this?


Another issue is that during creation of vlan interface, the interface flags are set to IFF_BROADCAST | IFF_SIMPLEX | 
IFF_MULTICAST. Beats me as to why it is defaulted to SIMPLEX. Any idea? This is in the vlan_clone_create() function in 
sys/net/if_vlan.c

Thank you in Advance.

-Santosh



> Hi,
> 
> I tried to programmatically add and delete VLAN group by using the following 
> ioctl calls. Doesn't work as intended. I then checked the ifconfig sourcecode 
> and it looks like for QNX we have to use ioctl_socket instead of ioctl. I 
> checked the code I wrote with ioctl and ioctl_packet. No problems during 
> compilation or running but the results are completely different. Things are 
> setup correct with ioctl_socket but not so with ioctl.
> 
> My questions:
> 1. For QNX, should I be making a general rule to use ioctl_socket instead of 
> ioctl?
> 2. Are there plans to make it a standard ioctl interface instead of 
> ioctl_socket? Can someone explain me the reason why the interface definition 
> was changed instead of changing the implementation within ioctl?
> 
> Thanks,
> Santosh
> 
> 
> 
> 


Re: Programmatic creation of VLAN using ioctl - Not working as it should  
Hi,

More update on this. Apparently, I see this problem when I package io-pkt into our BSP but if I keep all binaries inside
 the stage directory and create an environment around it then the vlan configuration works just fine.

Looks like an environment issue. Is there a specific environment setting I need to create? Im running only io-pkt and so
 I start iopkt off and then mount all io-net network drivers followed by any other protocol I need like qnet etc...

Any advise of help would be much appreciated.

Thanks,
Santosh
> Hi There,
> 
> Things seemed to be working with VLAN creation but for some reason, it stopped
>  working for me and I'd like to get some urgent help on this.
> 
> I am using io-pkt (I think revision 400) a little old but I have applied some 
> changes to io-pkt to support one feature currently available in RFC2292 only. 
> Everything else seems to be working fine excepting that I cannot create VLAN 
> groups. I would like to add that it used to work a while back but not any more
> . The difference is that currently I am packaging io-pkt into a BSP and 
> previously I used to run it out of compact flash. Im assuming that shouldnt 
> make a difference.
> 
> Anyway, the exact problem is that the VLAN interface gets created, but in the 
> following creation, ifconfig does a get of the interface and that fails.
> 
> Following the stack trace upon executing ifconfig vlan4 create vlan 256 vlanif
>  en4:
> 
> Thread [2] (Suspended)	
> 	9 vlan_ioctl() /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/
> net/if_vlan.c:610 0x48081ca8	
> 	8 in_control() /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/
> netinet/in.c:587 0x48085ae8	
> 	7 udp_usrreq() /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/
> netinet/udp_usrreq.c:1282 0x480eb160	
> 	6 compat_ifioctl() /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/
> sys/compat/common/uipc_syscalls_43.c:620 0x480fda24	
> 	5 ifioctl() /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/net/
> if.c:2160 0x480618b4	
> 	4 soo_ioctl() /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/
> kern/sys_socket.c:182 0x480d3b8c	
> 	3 tcpip_devctl() /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/
> msg.c:1567 0x480ad6c8	
> 	2 startproc() /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/
> proc.c:703 0x480ba3e8
> 
> The exact area where the problem is discovered is:
> 
> memset(&vlr, 0, sizeof(vlr));
> if (ifv->ifv_p != NULL) {
>     snprintf(vlr.vlr_parent, sizeof(vlr.vlr_parent), "%s",
>     ifv->ifv_p->if_xname);
>     vlr.vlr_tag = ifv->ifv_tag;
> }
> #ifndef __QNXNTO__
> 	error = copyout(&vlr, ifr->ifr_data, sizeof(vlr));
> #else
> 	error = copyout(&vlr, data + sizeof(*ifr), sizeof(vlr));
> 
> The contents of ifv is:
> ifv	0x48563a00	
> 	ifv_u	{...}	
> 	ifv_p	0x00000000	
> 	ifv_mib	{...}	
> 	ifv_mc_listhead	{...}	
> 	ifv_list	{...}	
> 	ifv_flags	0	
> 	ifv_alloc	0x485639e0	
> 
> 
> 
> and quite obviously, the code returns with a BAD Address error. I dont know 
> what happened to the data passed in the ioctl, seems like it never got to this
>  point. How can I proceed to debug this?
> 
> 
> Another issue is that during creation of vlan interface, the interface flags 
> are set to IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST. Beats me as to why it 
> is defaulted to SIMPLEX. Any idea? This is in the vlan_clone_create() function
>  in sys/net/if_vlan.c
> 
> Thank you in Advance.
> 
> -Santosh
> 
> 
> 
> > Hi,
> > 
> > I tried to programmatically add and delete VLAN group by using the following
>  
> > ioctl calls. Doesn't work as intended. I then...
View Full Message
RE: Programmatic creation of VLAN using ioctl - Not working as it should  
Hi Santosh:

	It sounds like you're not including all of the binaries and/or
libraries that you need in your BSP and are ending up with a binary
compatibility issue. How do you create your BSP?  Do you use mkifs to
create an image?

	Robert.

-----Original Message-----
From: Santosh Kumar [mailto:community-noreply@qnx.com] 
Sent: Wednesday, August 20, 2008 1:17 AM
To: ionetmig-networking
Subject: Re: Programmatic creation of VLAN using ioctl - Not working as
it should

Hi,

More update on this. Apparently, I see this problem when I package
io-pkt into our BSP but if I keep all binaries inside the stage
directory and create an environment around it then the vlan
configuration works just fine.

Looks like an environment issue. Is there a specific environment setting
I need to create? Im running only io-pkt and so I start iopkt off and
then mount all io-net network drivers followed by any other protocol I
need like qnet etc...

Any advise of help would be much appreciated.

Thanks,
Santosh
> Hi There,
> 
> Things seemed to be working with VLAN creation but for some reason, it
stopped
>  working for me and I'd like to get some urgent help on this.
> 
> I am using io-pkt (I think revision 400) a little old but I have
applied some 
> changes to io-pkt to support one feature currently available in
RFC2292 only. 
> Everything else seems to be working fine excepting that I cannot
create VLAN 
> groups. I would like to add that it used to work a while back but not
any more
> . The difference is that currently I am packaging io-pkt into a BSP
and 
> previously I used to run it out of compact flash. Im assuming that
shouldnt 
> make a difference.
> 
> Anyway, the exact problem is that the VLAN interface gets created, but
in the 
> following creation, ifconfig does a get of the interface and that
fails.
> 
> Following the stack trace upon executing ifconfig vlan4 create vlan
256 vlanif
>  en4:
> 
> Thread [2] (Suspended)	
> 	9 vlan_ioctl()
/media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/
> net/if_vlan.c:610 0x48081ca8	
> 	8 in_control()
/media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/
> netinet/in.c:587 0x48085ae8	
> 	7 udp_usrreq()
/media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/
> netinet/udp_usrreq.c:1282 0x480eb160	
> 	6 compat_ifioctl()
/media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/
> sys/compat/common/uipc_syscalls_43.c:620 0x480fda24	
> 	5 ifioctl()
/media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/net/
> if.c:2160 0x480618b4	
> 	4 soo_ioctl()
/media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/
> kern/sys_socket.c:182 0x480d3b8c	
> 	3 tcpip_devctl()
/media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/
> msg.c:1567 0x480ad6c8	
> 	2 startproc()
/media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/
> proc.c:703 0x480ba3e8
> 
> The exact area where the problem is discovered is:
> 
> memset(&vlr, 0, sizeof(vlr));
> if (ifv->ifv_p != NULL) {
>     snprintf(vlr.vlr_parent, sizeof(vlr.vlr_parent), "%s",
>     ifv->ifv_p->if_xname);
>     vlr.vlr_tag = ifv->ifv_tag;
> }
> #ifndef __QNXNTO__
> 	error = copyout(&vlr, ifr->ifr_data, sizeof(vlr));
> #else
> 	error = copyout(&vlr, data + sizeof(*ifr), sizeof(vlr));
> 
> The contents of ifv is:
> ifv	0x48563a00	
> 	ifv_u	{...}	
> 	ifv_p	0x00000000	
> 	ifv_mib	{...}	
> 	ifv_mc_listhead	{...}	
> 	ifv_list	{...}	
> 	ifv_flags	0	
> 	ifv_alloc	0x485639e0	
> 
> 
> 
> and quite obviously, the code returns with a BAD Address error. I dont
know 
> what happened to the data passed in the ioctl, seems like it never got
to this
>  point. How can I proceed to debug this?
> 
> 
> Another issue is that...
View Full Message
Re: RE: Programmatic creation of VLAN using ioctl - Not working as it should  
Hi Robert,

Yes I use mkifs. I just copied over the socket, crypto ssl and shim libraries. I left everything else out.

Binaries I include many utilities and io-pkt-v4.

What are the needed elements?

Thanks,
Santosh

> Hi Santosh:
> 
> 	It sounds like you're not including all of the binaries and/or
> libraries that you need in your BSP and are ending up with a binary
> compatibility issue. How do you create your BSP?  Do you use mkifs to
> create an image?
> 
> 	Robert.
> 
> -----Original Message-----
> From: Santosh Kumar [mailto:community-noreply@qnx.com] 
> Sent: Wednesday, August 20, 2008 1:17 AM
> To: ionetmig-networking
> Subject: Re: Programmatic creation of VLAN using ioctl - Not working as
> it should
> 
> Hi,
> 
> More update on this. Apparently, I see this problem when I package
> io-pkt into our BSP but if I keep all binaries inside the stage
> directory and create an environment around it then the vlan
> configuration works just fine.
> 
> Looks like an environment issue. Is there a specific environment setting
> I need to create? Im running only io-pkt and so I start iopkt off and
> then mount all io-net network drivers followed by any other protocol I
> need like qnet etc...
> 
> Any advise of help would be much appreciated.
> 
> Thanks,
> Santosh
> > Hi There,
> > 
> > Things seemed to be working with VLAN creation but for some reason, it
> stopped
> >  working for me and I'd like to get some urgent help on this.
> > 
> > I am using io-pkt (I think revision 400) a little old but I have
> applied some 
> > changes to io-pkt to support one feature currently available in
> RFC2292 only. 
> > Everything else seems to be working fine excepting that I cannot
> create VLAN 
> > groups. I would like to add that it used to work a while back but not
> any more
> > . The difference is that currently I am packaging io-pkt into a BSP
> and 
> > previously I used to run it out of compact flash. Im assuming that
> shouldnt 
> > make a difference.
> > 
> > Anyway, the exact problem is that the VLAN interface gets created, but
> in the 
> > following creation, ifconfig does a get of the interface and that
> fails.
> > 
> > Following the stack trace upon executing ifconfig vlan4 create vlan
> 256 vlanif
> >  en4:
> > 
> > Thread [2] (Suspended)	
> > 	9 vlan_ioctl()
> /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/
> > net/if_vlan.c:610 0x48081ca8	
> > 	8 in_control()
> /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/
> > netinet/in.c:587 0x48085ae8	
> > 	7 udp_usrreq()
> /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/
> > netinet/udp_usrreq.c:1282 0x480eb160	
> > 	6 compat_ifioctl()
> /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/
> > sys/compat/common/uipc_syscalls_43.c:620 0x480fda24	
> > 	5 ifioctl()
> /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/net/
> > if.c:2160 0x480618b4	
> > 	4 soo_ioctl()
> /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/
> > kern/sys_socket.c:182 0x480d3b8c	
> > 	3 tcpip_devctl()
> /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/
> > msg.c:1567 0x480ad6c8	
> > 	2 startproc()
> /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/
> > proc.c:703 0x480ba3e8
> > 
> > The exact area where the problem is discovered is:
> > 
> > memset(&vlr, 0, sizeof(vlr));
> > if (ifv->ifv_p != NULL) {
> >     snprintf(vlr.vlr_parent, sizeof(vlr.vlr_parent), "%s",
> >     ifv->ifv_p->if_xname);
> >    ...
View Full Message
RE: RE: Programmatic creation of VLAN using ioctl - Not working as it should  
If you can send me a copy of your build file, I can let you know what
needs to be updated.   Essentially, all utilities and libraries that are
in the stating area produced by the build must be updated.  Is it
possible that your particular problem is with the ifconfig utility?

	Robert.


-----Original Message-----
From: Santosh Kumar [mailto:community-noreply@qnx.com] 
Sent: Wednesday, August 20, 2008 4:10 PM
To: ionetmig-networking
Subject: Re: RE: Programmatic creation of VLAN using ioctl - Not working
as it should

Hi Robert,

Yes I use mkifs. I just copied over the socket, crypto ssl and shim
libraries. I left everything else out.

Binaries I include many utilities and io-pkt-v4.

What are the needed elements?

Thanks,
Santosh

> Hi Santosh:
> 
> 	It sounds like you're not including all of the binaries and/or
> libraries that you need in your BSP and are ending up with a binary
> compatibility issue. How do you create your BSP?  Do you use mkifs to
> create an image?
> 
> 	Robert.
> 
> -----Original Message-----
> From: Santosh Kumar [mailto:community-noreply@qnx.com] 
> Sent: Wednesday, August 20, 2008 1:17 AM
> To: ionetmig-networking
> Subject: Re: Programmatic creation of VLAN using ioctl - Not working
as
> it should
> 
> Hi,
> 
> More update on this. Apparently, I see this problem when I package
> io-pkt into our BSP but if I keep all binaries inside the stage
> directory and create an environment around it then the vlan
> configuration works just fine.
> 
> Looks like an environment issue. Is there a specific environment
setting
> I need to create? Im running only io-pkt and so I start iopkt off and
> then mount all io-net network drivers followed by any other protocol I
> need like qnet etc...
> 
> Any advise of help would be much appreciated.
> 
> Thanks,
> Santosh
> > Hi There,
> > 
> > Things seemed to be working with VLAN creation but for some reason,
it
> stopped
> >  working for me and I'd like to get some urgent help on this.
> > 
> > I am using io-pkt (I think revision 400) a little old but I have
> applied some 
> > changes to io-pkt to support one feature currently available in
> RFC2292 only. 
> > Everything else seems to be working fine excepting that I cannot
> create VLAN 
> > groups. I would like to add that it used to work a while back but
not
> any more
> > . The difference is that currently I am packaging io-pkt into a BSP
> and 
> > previously I used to run it out of compact flash. Im assuming that
> shouldnt 
> > make a difference.
> > 
> > Anyway, the exact problem is that the VLAN interface gets created,
but
> in the 
> > following creation, ifconfig does a get of the interface and that
> fails.
> > 
> > Following the stack trace upon executing ifconfig vlan4 create vlan
> 256 vlanif
> >  en4:
> > 
> > Thread [2] (Suspended)	
> > 	9 vlan_ioctl()
> /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/
> > net/if_vlan.c:610 0x48081ca8	
> > 	8 in_control()
> /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/
> > netinet/in.c:587 0x48085ae8	
> > 	7 udp_usrreq()
> /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/
> > netinet/udp_usrreq.c:1282 0x480eb160	
> > 	6 compat_ifioctl()
> /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/
> > sys/compat/common/uipc_syscalls_43.c:620 0x480fda24	
> > 	5 ifioctl()
> /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/net/
> > if.c:2160 0x480618b4	
> > 	4 soo_ioctl()
> /media/sda2/workspace/mv/ne/thirdparty/Networking/trunk/sys/
> > kern/sys_socket.c:182 0x480d3b8c	
> > 	3...
View Full Message
Re: RE: RE: Programmatic creation of VLAN using ioctl - Not working as it should  
Attached is a copy of my build file. Im certainly not using all of the libraries in the staging area. That might be the 
case and you might be right that its the ifconfig which might be misbehaving due to improper environment.

Should I plugin all the binaries and libraries into ifs from the staging area? Anyway let me know.

Thanks,
Santosh
> If you can send me a copy of your build file, I can let you know what
> needs to be updated.   Essentially, all utilities and libraries that are
> in the stating area produced by the build must be updated.  Is it
> possible that your particular problem is with the ifconfig utility?
> 
> 	Robert.
> 
> 
> -----Original Message-----
> From: Santosh Kumar [mailto:community-noreply@qnx.com] 
> Sent: Wednesday, August 20, 2008 4:10 PM
> To: ionetmig-networking
> Subject: Re: RE: Programmatic creation of VLAN using ioctl - Not working
> as it should
> 
> Hi Robert,
> 
> Yes I use mkifs. I just copied over the socket, crypto ssl and shim
> libraries. I left everything else out.
> 
> Binaries I include many utilities and io-pkt-v4.
> 
> What are the needed elements?
> 
> Thanks,
> Santosh
> 
> > Hi Santosh:
> > 
> > 	It sounds like you're not including all of the binaries and/or
> > libraries that you need in your BSP and are ending up with a binary
> > compatibility issue. How do you create your BSP?  Do you use mkifs to
> > create an image?
> > 
> > 	Robert.
> > 
> > -----Original Message-----
> > From: Santosh Kumar [mailto:community-noreply@qnx.com] 
> > Sent: Wednesday, August 20, 2008 1:17 AM
> > To: ionetmig-networking
> > Subject: Re: Programmatic creation of VLAN using ioctl - Not working
> as
> > it should
> > 
> > Hi,
> > 
> > More update on this. Apparently, I see this problem when I package
> > io-pkt into our BSP but if I keep all binaries inside the stage
> > directory and create an environment around it then the vlan
> > configuration works just fine.
> > 
> > Looks like an environment issue. Is there a specific environment
> setting
> > I need to create? Im running only io-pkt and so I start iopkt off and
> > then mount all io-net network drivers followed by any other protocol I
> > need like qnet etc...
> > 
> > Any advise of help would be much appreciated.
> > 
> > Thanks,
> > Santosh
> > > Hi There,
> > > 
> > > Things seemed to be working with VLAN creation but for some reason,
> it
> > stopped
> > >  working for me and I'd like to get some urgent help on this.
> > > 
> > > I am using io-pkt (I think revision 400) a little old but I have
> > applied some 
> > > changes to io-pkt to support one feature currently available in
> > RFC2292 only. 
> > > Everything else seems to be working fine excepting that I cannot
> > create VLAN 
> > > groups. I would like to add that it used to work a while back but
> not
> > any more
> > > . The difference is that currently I am packaging io-pkt into a BSP
> > and 
> > > previously I used to run it out of compact flash. Im assuming that
> > shouldnt 
> > > make a difference.
> > > 
> > > Anyway, the exact problem is that the VLAN interface gets created,
> but
> > in the 
> > > following creation, ifconfig does a get of the interface and that
> > fails.
> > > 
> > > Following the stack trace upon executing ifconfig vlan4 create vlan
> > 256 vlanif
> > >  en4:
> > > 
> > > Thread [2] (Suspended)	
> > > 	9...
View Full Message
Attachment: Text project.bld 63.37 KB
Re: RE: RE: Programmatic creation of VLAN using ioctl - Not working as it should  
Santosh,
  You should use every binaries from the staging area to keep compatibility.
  One byte different in data will cause very serious confusion to io-*.
RE: RE: RE: Programmatic creation of VLAN using ioctl - Not working as it should  
Hi Santosh:
	Any binary / networking library that you use needs to come from
the staging area.  You also have to be very careful about including both
io-net and io-pkt in the same target.  Io-net and io-pkt utilities (e.g.
ifconfig) are incompatible.

I can't remember for sure, but does io-pkt-v4 include vlan support or is
it only in io-pkt-v4-hc?

Unfortunately, that's an IDE build file as opposed to a nice clean
command line build file, but here's what I think needs to be done to use
io-pkt:

Remove io-net.
Remove npm-tcpip.so
Remove npm-qnet.so
Remove nfm-bpf.so

These files need to come from the appropriate io-pkt staging area:
Maybe they are, but the fact that the build path us "" for them while
it's a "/home...etc" path for io-pkt-v4 makes me wonder.  My guess would
be that the search path results in io-net utilities getting used instead
of io-pkt.

tcpdump 
nicinfo
inetd
if_up
ftpd
dhcp.client
traceroute
sockstat
ping
openssl
netstat
ftp
arp
sysctl
route
pfctl
ifconfig
libssl.so.1
libssl.so
libcrypto.so.1
libcrypto.so
libsocket.so.2
libsocket.so



I think that's all of them....


	Robert.


-----Original Message-----
From: Santosh Kumar [mailto:community-noreply@qnx.com] 
Sent: Wednesday, August 20, 2008 4:20 PM
To: ionetmig-networking
Subject: Re: RE: RE: Programmatic creation of VLAN using ioctl - Not
working as it should

Attached is a copy of my build file. Im certainly not using all of the
libraries in the staging area. That might be the case and you might be
right that its the ifconfig which might be misbehaving due to improper
environment.

Should I plugin all the binaries and libraries into ifs from the staging
area? Anyway let me know.

Thanks,
Santosh
> If you can send me a copy of your build file, I can let you know what
> needs to be updated.   Essentially, all utilities and libraries that
are
> in the stating area produced by the build must be updated.  Is it
> possible that your particular problem is with the ifconfig utility?
> 
> 	Robert.
> 
> 
> -----Original Message-----
> From: Santosh Kumar [mailto:community-noreply@qnx.com] 
> Sent: Wednesday, August 20, 2008 4:10 PM
> To: ionetmig-networking
> Subject: Re: RE: Programmatic creation of VLAN using ioctl - Not
working
> as it should
> 
> Hi Robert,
> 
> Yes I use mkifs. I just copied over the socket, crypto ssl and shim
> libraries. I left everything else out.
> 
> Binaries I include many utilities and io-pkt-v4.
> 
> What are the needed elements?
> 
> Thanks,
> Santosh
> 
> > Hi Santosh:
> > 
> > 	It sounds like you're not including all of the binaries and/or
> > libraries that you need in your BSP and are ending up with a binary
> > compatibility issue. How do you create your BSP?  Do you use mkifs
to
> > create an image?
> > 
> > 	Robert.
> > 
> > -----Original Message-----
> > From: Santosh Kumar [mailto:community-noreply@qnx.com] 
> > Sent: Wednesday, August 20, 2008 1:17 AM
> > To: ionetmig-networking
> > Subject: Re: Programmatic creation of VLAN using ioctl - Not working
> as
> > it should
> > 
> > Hi,
> > 
> > More update on this. Apparently, I see this problem when I package
> > io-pkt into our BSP but if I keep all binaries inside the stage
> > directory and create an environment around it then the vlan
> > configuration works just fine.
> > 
> > Looks like an environment issue. Is there a specific environment
> setting
> > I need to create? Im running only io-pkt and so I start iopkt off
and
> > then mount all io-net network drivers followed by any other protocol
I
> > need like qnet etc...
> > 
> > Any advise of help would be much appreciated.
>...
View Full Message
Re: RE: RE: RE: Programmatic creation of VLAN using ioctl - Not working as it should  
Im sorry, the project.bld is a little confusing because, it contains the debug configuration. Sorry about that. I added 
the npm and io-net so that Im able to debug io-pkt. I think I removed it for the real one.

But you are right, I see " " for absolute path's in the IDE, which I was concerned but thought it handled things. I have
 a separate project in my BSP where I copy all the files from the release build of trunk and then BSP picks all binaries
 from that project.

I will make another clean build of bsp, fix all the path issues and try again. Maybe this time it would work. Will let 
you know.

Thanks,
Santosh
> Hi Santosh:
> 	Any binary / networking library that you use needs to come from
> the staging area.  You also have to be very careful about including both
> io-net and io-pkt in the same target.  Io-net and io-pkt utilities (e.g.
> ifconfig) are incompatible.
> 
> I can't remember for sure, but does io-pkt-v4 include vlan support or is
> it only in io-pkt-v4-hc?
> 
> Unfortunately, that's an IDE build file as opposed to a nice clean
> command line build file, but here's what I think needs to be done to use
> io-pkt:
> 
> Remove io-net.
> Remove npm-tcpip.so
> Remove npm-qnet.so
> Remove nfm-bpf.so
> 
> These files need to come from the appropriate io-pkt staging area:
> Maybe they are, but the fact that the build path us "" for them while
> it's a "/home...etc" path for io-pkt-v4 makes me wonder.  My guess would
> be that the search path results in io-net utilities getting used instead
> of io-pkt.
> 
> tcpdump 
> nicinfo
> inetd
> if_up
> ftpd
> dhcp.client
> traceroute
> sockstat
> ping
> openssl
> netstat
> ftp
> arp
> sysctl
> route
> pfctl
> ifconfig
> libssl.so.1
> libssl.so
> libcrypto.so.1
> libcrypto.so
> libsocket.so.2
> libsocket.so
> 
> 
> 
> I think that's all of them....
> 
> 
> 	Robert.
> 
> 
> -----Original Message-----
> From: Santosh Kumar [mailto:community-noreply@qnx.com] 
> Sent: Wednesday, August 20, 2008 4:20 PM
> To: ionetmig-networking
> Subject: Re: RE: RE: Programmatic creation of VLAN using ioctl - Not
> working as it should
> 
> Attached is a copy of my build file. Im certainly not using all of the
> libraries in the staging area. That might be the case and you might be
> right that its the ifconfig which might be misbehaving due to improper
> environment.
> 
> Should I plugin all the binaries and libraries into ifs from the staging
> area? Anyway let me know.
> 
> Thanks,
> Santosh
> > If you can send me a copy of your build file, I can let you know what
> > needs to be updated.   Essentially, all utilities and libraries that
> are
> > in the stating area produced by the build must be updated.  Is it
> > possible that your particular problem is with the ifconfig utility?
> > 
> > 	Robert.
> > 
> > 
> > -----Original Message-----
> > From: Santosh Kumar [mailto:community-noreply@qnx.com] 
> > Sent: Wednesday, August 20, 2008 4:10 PM
> > To: ionetmig-networking
> > Subject: Re: RE: Programmatic creation of VLAN using ioctl - Not
> working
> > as it should
> > 
> > Hi Robert,
> > 
> > Yes I use mkifs. I just copied over the socket, crypto ssl and shim
> > libraries. I left everything else out.
> > 
> > Binaries I include many utilities and io-pkt-v4.
> > 
> > What are the needed elements?
> > 
> > Thanks,
> > Santosh
> > 
> > > Hi Santosh:
> > > 
> > > 	It sounds like you're not including all of the binaries and/or
> > > libraries that you need in your BSP and are...
View Full Message
RE: RE: RE: RE: Programmatic creation of VLAN using ioctl - Not working as it should  
You can also do a "use -i" on the binary in question and that will tell
you where it was built once you get it on your target.

	Good luck! :>

		Robert.

-----Original Message-----
From: Santosh Kumar [mailto:community-noreply@qnx.com] 
Sent: Wednesday, August 20, 2008 5:42 PM
To: ionetmig-networking
Subject: Re: RE: RE: RE: Programmatic creation of VLAN using ioctl - Not
working as it should

Im sorry, the project.bld is a little confusing because, it contains the
debug configuration. Sorry about that. I added the npm and io-net so
that Im able to debug io-pkt. I think I removed it for the real one.

But you are right, I see " " for absolute path's in the IDE, which I was
concerned but thought it handled things. I have a separate project in my
BSP where I copy all the files from the release build of trunk and then
BSP picks all binaries from that project.

I will make another clean build of bsp, fix all the path issues and try
again. Maybe this time it would work. Will let you know.

Thanks,
Santosh
> Hi Santosh:
> 	Any binary / networking library that you use needs to come from
> the staging area.  You also have to be very careful about including
both
> io-net and io-pkt in the same target.  Io-net and io-pkt utilities
(e.g.
> ifconfig) are incompatible.
> 
> I can't remember for sure, but does io-pkt-v4 include vlan support or
is
> it only in io-pkt-v4-hc?
> 
> Unfortunately, that's an IDE build file as opposed to a nice clean
> command line build file, but here's what I think needs to be done to
use
> io-pkt:
> 
> Remove io-net.
> Remove npm-tcpip.so
> Remove npm-qnet.so
> Remove nfm-bpf.so
> 
> These files need to come from the appropriate io-pkt staging area:
> Maybe they are, but the fact that the build path us "" for them while
> it's a "/home...etc" path for io-pkt-v4 makes me wonder.  My guess
would
> be that the search path results in io-net utilities getting used
instead
> of io-pkt.
> 
> tcpdump 
> nicinfo
> inetd
> if_up
> ftpd
> dhcp.client
> traceroute
> sockstat
> ping
> openssl
> netstat
> ftp
> arp
> sysctl
> route
> pfctl
> ifconfig
> libssl.so.1
> libssl.so
> libcrypto.so.1
> libcrypto.so
> libsocket.so.2
> libsocket.so
> 
> 
> 
> I think that's all of them....
> 
> 
> 	Robert.
> 
> 
> -----Original Message-----
> From: Santosh Kumar [mailto:community-noreply@qnx.com] 
> Sent: Wednesday, August 20, 2008 4:20 PM
> To: ionetmig-networking
> Subject: Re: RE: RE: Programmatic creation of VLAN using ioctl - Not
> working as it should
> 
> Attached is a copy of my build file. Im certainly not using all of the
> libraries in the staging area. That might be the case and you might be
> right that its the ifconfig which might be misbehaving due to improper
> environment.
> 
> Should I plugin all the binaries and libraries into ifs from the
staging
> area? Anyway let me know.
> 
> Thanks,
> Santosh
> > If you can send me a copy of your build file, I can let you know
what
> > needs to be updated.   Essentially, all utilities and libraries that
> are
> > in the stating area produced by the build must be updated.  Is it
> > possible that your particular problem is with the ifconfig utility?
> > 
> > 	Robert.
> > 
> > 
> > -----Original Message-----
> > From: Santosh Kumar [mailto:community-noreply@qnx.com] 
> > Sent: Wednesday, August 20, 2008 4:10 PM
> > To: ionetmig-networking
> > Subject: Re: RE: Programmatic creation of VLAN using ioctl - Not
> working
> > as it should
> > 
> > Hi Robert,
> > 
> > Yes I use mkifs. I just copied over the socket, crypto ssl and...
View Full Message
Re: RE: RE: RE: RE: Programmatic creation of VLAN using ioctl - Not working as it should  
Robert,

Thanks. The problem is resolved. I feel silly now. Apparently, during startup, we had a whole bunch of applications 
starting off after the bootup was successful.  This compact flash image contained its own libsockt and overwrote the 
LD_LIBRARY_PATH and that made ifconfig and other utilities behave strangely. I got rid of this  directory on CF and 
restarted....and everything worked like a charm. Cant believe, I Wasted almost 2 days over this seemingly trivial issue.


Thanks for your help.

-Santosh
> You can also do a "use -i" on the binary in question and that will tell
> you where it was built once you get it on your target.
> 
> 	Good luck! :>
> 
> 		Robert.
> 
> -----Original Message-----
> From: Santosh Kumar [mailto:community-noreply@qnx.com] 
> Sent: Wednesday, August 20, 2008 5:42 PM
> To: ionetmig-networking
> Subject: Re: RE: RE: RE: Programmatic creation of VLAN using ioctl - Not
> working as it should
> 
> Im sorry, the project.bld is a little confusing because, it contains the
> debug configuration. Sorry about that. I added the npm and io-net so
> that Im able to debug io-pkt. I think I removed it for the real one.
> 
> But you are right, I see " " for absolute path's in the IDE, which I was
> concerned but thought it handled things. I have a separate project in my
> BSP where I copy all the files from the release build of trunk and then
> BSP picks all binaries from that project.
> 
> I will make another clean build of bsp, fix all the path issues and try
> again. Maybe this time it would work. Will let you know.
> 
> Thanks,
> Santosh
> > Hi Santosh:
> > 	Any binary / networking library that you use needs to come from
> > the staging area.  You also have to be very careful about including
> both
> > io-net and io-pkt in the same target.  Io-net and io-pkt utilities
> (e.g.
> > ifconfig) are incompatible.
> > 
> > I can't remember for sure, but does io-pkt-v4 include vlan support or
> is
> > it only in io-pkt-v4-hc?
> > 
> > Unfortunately, that's an IDE build file as opposed to a nice clean
> > command line build file, but here's what I think needs to be done to
> use
> > io-pkt:
> > 
> > Remove io-net.
> > Remove npm-tcpip.so
> > Remove npm-qnet.so
> > Remove nfm-bpf.so
> > 
> > These files need to come from the appropriate io-pkt staging area:
> > Maybe they are, but the fact that the build path us "" for them while
> > it's a "/home...etc" path for io-pkt-v4 makes me wonder.  My guess
> would
> > be that the search path results in io-net utilities getting used
> instead
> > of io-pkt.
> > 
> > tcpdump 
> > nicinfo
> > inetd
> > if_up
> > ftpd
> > dhcp.client
> > traceroute
> > sockstat
> > ping
> > openssl
> > netstat
> > ftp
> > arp
> > sysctl
> > route
> > pfctl
> > ifconfig
> > libssl.so.1
> > libssl.so
> > libcrypto.so.1
> > libcrypto.so
> > libsocket.so.2
> > libsocket.so
> > 
> > 
> > 
> > I think that's all of them....
> > 
> > 
> > 	Robert.
> > 
> > 
> > -----Original Message-----
> > From: Santosh Kumar [mailto:community-noreply@qnx.com] 
> > Sent: Wednesday, August 20, 2008 4:20 PM
> > To: ionetmig-networking
> > Subject: Re: RE: RE: Programmatic creation of VLAN using ioctl - Not
> > working as it should
> > 
> > Attached is a copy of my build file. Im certainly not using all of the
> > libraries in the staging area. That might be the case and you might be
> > right that its the ifconfig which...
View Full Message
RE: RE: RE: RE: RE: Programmatic creation of VLAN using ioctl - Not working as it should  
Don't you love those sort of problems? :->  Nice to know that we were on
the right track though!

	Robert.

-----Original Message-----
From: Santosh Kumar [mailto:community-noreply@qnx.com] 
Sent: Wednesday, August 20, 2008 7:51 PM
To: ionetmig-networking
Subject: Re: RE: RE: RE: RE: Programmatic creation of VLAN using ioctl -
Not working as it should

Robert,

Thanks. The problem is resolved. I feel silly now. Apparently, during
startup, we had a whole bunch of applications starting off after the
bootup was successful.  This compact flash image contained its own
libsockt and overwrote the LD_LIBRARY_PATH and that made ifconfig and
other utilities behave strangely. I got rid of this  directory on CF and
restarted....and everything worked like a charm. Cant believe, I Wasted
almost 2 days over this seemingly trivial issue.

Thanks for your help.

-Santosh
> You can also do a "use -i" on the binary in question and that will
tell
> you where it was built once you get it on your target.
> 
> 	Good luck! :>
> 
> 		Robert.
> 
> -----Original Message-----
> From: Santosh Kumar [mailto:community-noreply@qnx.com] 
> Sent: Wednesday, August 20, 2008 5:42 PM
> To: ionetmig-networking
> Subject: Re: RE: RE: RE: Programmatic creation of VLAN using ioctl -
Not
> working as it should
> 
> Im sorry, the project.bld is a little confusing because, it contains
the
> debug configuration. Sorry about that. I added the npm and io-net so
> that Im able to debug io-pkt. I think I removed it for the real one.
> 
> But you are right, I see " " for absolute path's in the IDE, which I
was
> concerned but thought it handled things. I have a separate project in
my
> BSP where I copy all the files from the release build of trunk and
then
> BSP picks all binaries from that project.
> 
> I will make another clean build of bsp, fix all the path issues and
try
> again. Maybe this time it would work. Will let you know.
> 
> Thanks,
> Santosh
> > Hi Santosh:
> > 	Any binary / networking library that you use needs to come from
> > the staging area.  You also have to be very careful about including
> both
> > io-net and io-pkt in the same target.  Io-net and io-pkt utilities
> (e.g.
> > ifconfig) are incompatible.
> > 
> > I can't remember for sure, but does io-pkt-v4 include vlan support
or
> is
> > it only in io-pkt-v4-hc?
> > 
> > Unfortunately, that's an IDE build file as opposed to a nice clean
> > command line build file, but here's what I think needs to be done to
> use
> > io-pkt:
> > 
> > Remove io-net.
> > Remove npm-tcpip.so
> > Remove npm-qnet.so
> > Remove nfm-bpf.so
> > 
> > These files need to come from the appropriate io-pkt staging area:
> > Maybe they are, but the fact that the build path us "" for them
while
> > it's a "/home...etc" path for io-pkt-v4 makes me wonder.  My guess
> would
> > be that the search path results in io-net utilities getting used
> instead
> > of io-pkt.
> > 
> > tcpdump 
> > nicinfo
> > inetd
> > if_up
> > ftpd
> > dhcp.client
> > traceroute
> > sockstat
> > ping
> > openssl
> > netstat
> > ftp
> > arp
> > sysctl
> > route
> > pfctl
> > ifconfig
> > libssl.so.1
> > libssl.so
> > libcrypto.so.1
> > libcrypto.so
> > libsocket.so.2
> > libsocket.so
> > 
> > 
> > 
> > I think that's all of them....
> > 
> > 
> > 	Robert.
> > 
> > 
> > -----Original Message-----
> > From: Santosh Kumar [mailto:community-noreply@qnx.com] 
> > Sent: Wednesday, August...
View Full Message
Re: RE: RE: RE: RE: RE: Programmatic creation of VLAN using ioctl - Not working as it should  
If libsocket makes things messed up then I will suggest we change libsocket.so major version to 3, it does make sense 
and won't let it happen. All new tools requested to rebuild then
RE: RE: RE: RE: RE: RE: Programmatic creation of VLAN using ioctl - Not working as it should  
Hi Yao:
	The new libsocket is fully backwards compatible with the old
libsocket interface (i.e. you can use the new libsocket with io-net), so
there's no need to increment the library version number.  It's only if
we break or change an existing API that the versioning has to change.  

	R.

-----Original Message-----
From: Yao Zhao [mailto:community-noreply@qnx.com] 
Sent: Thursday, August 21, 2008 11:12 AM
To: ionetmig-networking
Subject: Re: RE: RE: RE: RE: RE: Programmatic creation of VLAN using
ioctl - Not working as it should

If libsocket makes things messed up then I will suggest we change
libsocket.so major version to 3, it does make sense and won't let it
happen. All new tools requested to rebuild then

_______________________________________________
io-net migration
http://community.qnx.com/sf/go/post12203