[Xenomai] rtdm_socket() error -97 for sending UDP or RAW packets

Gilles Chanteperdrix gilles.chanteperdrix at xenomai.org
Fri Apr 29 22:06:28 CEST 2016


On Fri, Apr 29, 2016 at 01:45:53PM +0000, Umair Ali wrote:
> Hello there,
> 
> I am working to make a module which will uses the Rtnet module to
> send the UDP or RAW pakets. My aim is to use the interface
> 'rteth0' in kernel space same like in userspace. Therefore I think
> I should create the socket and then using the created socket link
> the interface rteth0 with it. But when I use the function
> 'rtdm_socket(PF_INET, SOCK_RAW,0)' or 'rtdm_socket(PF_PACKET,
> SOCK_RAW,0)' or 'rtdm_socket(PF_INET, SOCK_DGRAM,0)' or anything
> with available options i.e also with sock_stream. I got the error
> -97. Which I have looked in google means the family of protocol is
> not supported. Please tell me if it is possible to send the UDP
> packets from the kernel space using interface rteth0 and socket or
> not. Can u guide me how I can solve the error -97. Thanks in
> advance

Sorry, no, I never used RTnet interface in kernel-space. I seem to
recall not all functions may be called from all contexts (for
instance, calling socket may work from the init module, but not from
a real-time thread or vice versa), but apart from that, I have no
clue. The best answer at this point would be "use the source, Luke".

Regards.

-- 
					    Gilles.
https://click-hack.org



More information about the Xenomai mailing list