login
Header Space

 
 

Generic Netlink subsytem

November 19, 2008 - 11:04am
Submitted by Anonymous on November 19, 2008 - 11:04am.
Linux

Hi,

Please let me know the following problem is a real issue or not?

I have written a program using generic netlinks to communicate to/from kernel space. The user program sends a string and expects two strings from the kernel.

The program is working well and as expected kernel sends two hello strings to the user.

But the problem is kernel is sending one more message on the same socket which I don't expect.

I.e after the first two reads on the socket, the third should block for the data until kernel sends further messages.

But instead of blocking, the third read in the user application reads a message which seems to be an error message from kernel.

Please check below for the message prints from kernel.

On first socket read using recv(......)

38 00 00 00 30 00 00 00 1F 13 24 49 00 00 00 00 8 . . . 0 . . . . . $I . . . .

01 01 00 00 22 00 01 00 68 65 6C 6C 6F 20 77 6F . . . . " . . . h e l l o w o

72 6C 64 20 66 72 6F 6D 20 6B 65 72 6E 65 6C 20 r l d f r o m k e r n e l

73 70 61 63 65 00 00 00 s p a c e . . .

second read

40 00 00 00 30 00 00 00 1F 13 24 49 00 00 00 00 @ . . . 0 . . . . . $ I . . . .

01 01 00 00 29 00 01 00 53 65 63 6F 6E 64 20 68 . . . . ) . . . S e c o n d h

65 6C 6C 6F 20 77 6F 72 6C 64 20 66 72 6F 6D 20 e l l o w o r l d f r o m

6B 65 72 6E 65 6C 20 73 70 61 63 65 00 00 00 00 k e r n e l s p a c e . . . .

Third read which should block is receiving following message from kernel which I think is a bug.

24 00 00 00 02 00 00 00 1E 13 24 49 68 39 00 00 $ . . . . . . . . . $ I h 9 . .

00 00 00 00 30 00 00 00 30 00 05 00 1E 13 24 49 . . . . 0 . . . 0 . . . . . $ I

68 39 00 00 h 9 . .

The third message is not sent by my kernel generic driver but is always received in the user application.

Please help resolve the above issue.

Thanks in advance.....

speck-geostationary