Re: [mpls-linux-general] [Request For Comments]- Peer Review - Modularize mpls_tunnel
Status: Beta
Brought to you by:
jleu
|
From: Ramon C. <cas...@in...> - 2003-11-20 13:51:43
|
Ups.... I meant this one :)
R.
8<-----------------8<------------8<--------------
/****
* mpls_tunnel_destroy - destroy (via ifreq) a tunnel
* 20031120 RCAS: destroy/ unregister_netdevice was missing. (right?)
* answer to myself: it was in mpls_ioctl...
***/
void mpls_tunnel_destroy(struct ifreq *ifr)
{
struct net_device *dev = NULL;
BUG_ON(!ifr);
dev = mpls_tunnel_get_by_name (ifr->ifr_name);
if (dev) {
/* give back the object. we just want the address*/
mpls_tunnel_put(dev);
rtnl_lock();
unregister_netdevice(dev);
rtnl_unlock();
}
}
8<-----------------8<------------8<--------------
8<-----------------8<------------8<--------------
/****
* mpls_tunnel_put - put (release) a reference to a tunnel.
* @dev: device
**/
void mpls_tunnel_put (struct net_device* dev)
{
if (dev)
dev_put(dev);
}
8<-----------------8<------------8<--------------
|