mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	kill bond_ioctl()
Same story as with dev_ifsioc(), except that the last cases with non-trivial conversions had been taken out in 2013... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
		
							parent
							
								
									bf4405737f
								
							
						
					
					
						commit
						f92d4fc953
					
				
					 1 changed files with 4 additions and 32 deletions
				
			
		
							
								
								
									
										36
									
								
								net/socket.c
									
									
									
									
									
								
							
							
						
						
									
										36
									
								
								net/socket.c
									
									
									
									
									
								
							| 
						 | 
					@ -2852,33 +2852,6 @@ static int compat_siocwandev(struct net *net, struct compat_ifreq __user *uifr32
 | 
				
			||||||
	return dev_ioctl(net, SIOCWANDEV, uifr);
 | 
						return dev_ioctl(net, SIOCWANDEV, uifr);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int bond_ioctl(struct net *net, unsigned int cmd,
 | 
					 | 
				
			||||||
			 struct compat_ifreq __user *ifr32)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	struct ifreq kifr;
 | 
					 | 
				
			||||||
	mm_segment_t old_fs;
 | 
					 | 
				
			||||||
	int err;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	switch (cmd) {
 | 
					 | 
				
			||||||
	case SIOCBONDENSLAVE:
 | 
					 | 
				
			||||||
	case SIOCBONDRELEASE:
 | 
					 | 
				
			||||||
	case SIOCBONDSETHWADDR:
 | 
					 | 
				
			||||||
	case SIOCBONDCHANGEACTIVE:
 | 
					 | 
				
			||||||
		if (copy_from_user(&kifr, ifr32, sizeof(struct compat_ifreq)))
 | 
					 | 
				
			||||||
			return -EFAULT;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		old_fs = get_fs();
 | 
					 | 
				
			||||||
		set_fs(KERNEL_DS);
 | 
					 | 
				
			||||||
		err = dev_ioctl(net, cmd,
 | 
					 | 
				
			||||||
				(struct ifreq __user __force *) &kifr);
 | 
					 | 
				
			||||||
		set_fs(old_fs);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		return err;
 | 
					 | 
				
			||||||
	default:
 | 
					 | 
				
			||||||
		return -ENOIOCTLCMD;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/* Handle ioctls that use ifreq::ifr_data and just need struct ifreq converted */
 | 
					/* Handle ioctls that use ifreq::ifr_data and just need struct ifreq converted */
 | 
				
			||||||
static int compat_ifr_data_ioctl(struct net *net, unsigned int cmd,
 | 
					static int compat_ifr_data_ioctl(struct net *net, unsigned int cmd,
 | 
				
			||||||
				 struct compat_ifreq __user *u_ifreq32)
 | 
									 struct compat_ifreq __user *u_ifreq32)
 | 
				
			||||||
| 
						 | 
					@ -3072,11 +3045,6 @@ static int compat_sock_ioctl_trans(struct file *file, struct socket *sock,
 | 
				
			||||||
	case SIOCGIFMAP:
 | 
						case SIOCGIFMAP:
 | 
				
			||||||
	case SIOCSIFMAP:
 | 
						case SIOCSIFMAP:
 | 
				
			||||||
		return compat_sioc_ifmap(net, cmd, argp);
 | 
							return compat_sioc_ifmap(net, cmd, argp);
 | 
				
			||||||
	case SIOCBONDENSLAVE:
 | 
					 | 
				
			||||||
	case SIOCBONDRELEASE:
 | 
					 | 
				
			||||||
	case SIOCBONDSETHWADDR:
 | 
					 | 
				
			||||||
	case SIOCBONDCHANGEACTIVE:
 | 
					 | 
				
			||||||
		return bond_ioctl(net, cmd, argp);
 | 
					 | 
				
			||||||
	case SIOCADDRT:
 | 
						case SIOCADDRT:
 | 
				
			||||||
	case SIOCDELRT:
 | 
						case SIOCDELRT:
 | 
				
			||||||
		return routing_ioctl(net, sock, cmd, argp);
 | 
							return routing_ioctl(net, sock, cmd, argp);
 | 
				
			||||||
| 
						 | 
					@ -3140,6 +3108,10 @@ static int compat_sock_ioctl_trans(struct file *file, struct socket *sock,
 | 
				
			||||||
	case SIOCGARP:
 | 
						case SIOCGARP:
 | 
				
			||||||
	case SIOCDARP:
 | 
						case SIOCDARP:
 | 
				
			||||||
	case SIOCATMARK:
 | 
						case SIOCATMARK:
 | 
				
			||||||
 | 
						case SIOCBONDENSLAVE:
 | 
				
			||||||
 | 
						case SIOCBONDRELEASE:
 | 
				
			||||||
 | 
						case SIOCBONDSETHWADDR:
 | 
				
			||||||
 | 
						case SIOCBONDCHANGEACTIVE:
 | 
				
			||||||
		return sock_do_ioctl(net, sock, cmd, arg);
 | 
							return sock_do_ioctl(net, sock, cmd, arg);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue