Answer the question
In order to leave comments, you need to log in
How to safely replace the network interface operations table?
The network interface in Linux is represented by the structure:
struct net_device {
...
const struct net_device_ops *netdev_ops;
...
};
rtnl_lock()
?
Answer the question
In order to leave comments, you need to log in
Solve problems as they come. By the way, setting a semaphore does not guarantee access security in case of concurrency, but only reduces the probability of collisions to almost 0.
As far as I understand, the link to net_device_ops does not change often at all, so IMHO it will be enough:
struct net_device dev;
static struct net_device_ops overwrited_netdev_ops;
...
dev->netdev_ops = &overwrited_netdev_ops;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question