Socket CAN descriptor using in epoll is not getting updated with its latest Network status

Jayasankar Bandaru

New Member
Joined
Dec 1, 2023
Messages
2
Reaction score
0
Credits
26
Hello Folks,

I have an issue in my implementation of socket CAN. The design is like,

Receive Thread:
register start,shutdown descriptor in epoll_ctrl
epoll_wait
----if start descriptor
-------register socket CAN descriptor to epoll
----if shutdown descriptor
------close socket descriptor

User control interfaces:
Start Interface()
----If the network interface is not UP
--------up the interface using ioctl
----write into start handler descriptor using write API

Issue:
A call to Start Interface(), it enables (UP) the network interface.
epoll wait comes out with an event EPOLLIN with start descriptor then it register the socket descriptor in epoll.
epoll wait keep returning with EPOLLERR event with socket descriptor. When the error number read using getsocketopt API, it says "Network is Down".

Query:
Why the network interface state in socket descriptor is not updated while waiting for an event in the epoll-wait and always returns error event EPOLLERR even though It had enabled in start interface.
 
Last edited:


This sounds like homework or an assignment.

Have a look through https://linux.org/forums/linux-networking.144/ , choose where it should go, and get back to me and I'll move it there.

Wizard
Hi,
Apologies for the worst presentation of my problem. But hope u have better understanding capabilities.
I had reviewed the related thread and didn’t find any solution for it.
So I posted here as there are experts in Linux subsystems
 

Members online


Latest posts

Top