Sending UDP packet in Linux Kernel

前端 未结 4 1478
礼貌的吻别
礼貌的吻别 2020-12-21 22:50

For a project, I\'m trying to send UDP packets from Linux kernel-space. I\'m currently \'hard-coding\' my code into the kernel (which I appreciate isn\'t the best/neatest wa

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-21 23:28

    You may find it easier to use the netpoll API for UDP. Take a look at netconsole for an example of how it's used. The APIs you're using are more intended for userspace (you should never have to play with segment descriptors to send network data!)

提交回复
热议问题