X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fax25%2Fax25_route.c;h=706e729f6859cd51fa84bb7b551f9a179f2c8d2c;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=7c977ebcc9a0a51289b4d254d1b5c383ae8e34c1;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/net/ax25/ax25_route.c b/net/ax25/ax25_route.c index 7c977ebcc..706e729f6 100644 --- a/net/ax25/ax25_route.c +++ b/net/ax25/ax25_route.c @@ -37,26 +37,10 @@ #include static ax25_route *ax25_route_list; -static rwlock_t ax25_route_lock = RW_LOCK_UNLOCKED; +static DEFINE_RWLOCK(ax25_route_lock); static ax25_route *ax25_get_route(ax25_address *, struct net_device *); -/* - * small macro to drop non-digipeated digipeaters and reverse path - */ -static inline void ax25_route_invert(ax25_digi *in, ax25_digi *out) -{ - int k; - - for (k = 0; k < in->ndigi; k++) - if (!in->repeated[k]) - break; - - in->ndigi = k; - - ax25_digi_invert(in, out); -} - void ax25_rt_device_down(struct net_device *dev) { ax25_route *s, *t, *ax25_rt; @@ -122,6 +106,7 @@ static int ax25_rt_add(struct ax25_routes_struct *route) ax25_rt->digipeat->calls[i] = route->digi_addr[i]; } } + write_unlock(&ax25_route_lock); return 0; } ax25_rt = ax25_rt->next; @@ -253,7 +238,7 @@ out: return err; } -int ax25_rt_ioctl(unsigned int cmd, void *arg) +int ax25_rt_ioctl(unsigned int cmd, void __user *arg) { struct ax25_route_opt_struct rt_option; struct ax25_routes_struct route;