1239 case SIOCSIFBRDADDR:
1240 case SIOCGIFNETMASK:
1241 case SIOCSIFNETMASK:
1242 case SIOCGIFMETRIC:
1243 case SIOCSIFMETRIC:
1244 return -EINVAL;
1245
1246 case SIOCADDRT:
1247 case SIOCDELRT:
1248 case SIOCNRDECOBS:
1249 if (!capable(CAP_NET_ADMIN)) return -EPERM;
1250 return nr_rt_ioctl(cmd, argp);
1251
1252 default:
1253 return -ENOIOCTLCMD;
1254 }
1255
1256 return 0;
1257}
1258
1259#ifdef CONFIG_PROC_FS
1260
1261static void *nr_info_start(struct seq_file *seq, loff_t *pos)
1262{
1263 struct sock *s;
1264 struct hlist_node *node;
1265 int i = 1;
1266
1267 spin_lock_bh(&nr_list_lock);
1268 if (*pos == 0)
1269 return SEQ_START_TOKEN;
1270
1271 sk_for_each(s, node, &nr_list) {
1272 if (i == *pos)
1273 return s;
1274 ++i;
1275 }
1276 return NULL;
1277}
1278
1279static void *nr_info_next(struct seq_file *seq, void *v, loff_t *pos)