I am trying without success to append or reorder packets on a Linux network driver. I am new on this so any help would be appreciated.
First of all I am aware that his is a bad practice and so on, I am open to other options but in the meantime I want to do it this way.
I am using the bonding driver with 2 slave interfaces, in the xmit method I receive the sk_buff and I am not able to know which queue it is in and I am not able to reorder the packets on that list.
In theory it should be easy, it is a double linked list so it should be a matter of changing the prev/next pointers. But it is not that easy. All the skb_* functions work with the struct sk_buff_head which was removed from sk_buff since kernel 2.6.* and swapped by struct list_head (which does not have qlen or a lock). I also tried to get the qdisc from the net_device and modify the queue there, but without success.
So, given the following function:
static netdev_tx_t bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_dev);
How could I go and reorder/append packets on that skb's queue? I would be happy to just clone the current skb and enqueue it on the list.