I am very confused now. Simply speaking, the application layer calls the udp_sendmsg() to send packets, then udp_sendmsg() will call IP to do that. What I am trying to do is to make the packet to wait X jiffies before it is passed to IP.

1st way is to make the sending process to wait X jiffies and then send the packet.

2nd way is to invoke another process by using add_timer in the sendmsg() function. Then, what should be the return value of sendmsg()? Because before the sendmsg() function exits, nothing could be get (such as length, bytes) from add_timer...

What difference is between 1st and 2nd way? Is anything wrong with it?

Thanks for your advice.