As mentioned earlier, when adding interfaces to the bridge, user space calls ioctl (br_socket_fd, SIOCBRADDIF, & ifr) to note that dev->do_ioctl has been done in void br_dev_setup(struct net_device *dev) assignment, namely: dev- & gt; performed when do_ioctl = br_dev_ioctl ioctl access, the process proceeds to br_dev_ioctl: (net /brige /br_ioctl.c) int br_dev_ioctl (struct net_device * dev, struct ifreq * rq, int cmd) {struct net_bridge * br = netdev_priv (dev); switch (cmd) {case SIOCDEVPRIVATE: return old_dev_ioctl (dev, rq, cmd); //add an interface case SIOCBRADDIF: //remove an interface case SIOCBRDELIF: return add_del_if (br, rq- & gt ; ifr_ifindex, cmd == SIOCBRADDIF);} pr_debug (" Bridge does not support ioctl 0x% x \\ n ", cmd); return -EOPNOTSUPP;} signs we use in user space is SIOCBRADDIF. So the process goes to add_del_if() static int add_del_if(struct net_bridge *br, int ifindex, int isadd)
{struct net_device *dev;int ret;if (!capable(CAP_NET_ADMIN))return -EPERM;dev = Dev_get_by_index(ifindex);if (dev == NULL)return -EINVAL;if (isadd)ret = br_add_if(br, dev);elseret = br_del_if(br, dev);dev_put(dev);return ret;}because cmd = = SIOCBRADDIF is true, so call br_add_if():int br_add_if(struct net_bridge *br, struct net_device *dev) (net/brige/br_if.c)){struct net_bridge_port *p;int err = 0;//loopback. Or non-network interface if (dev->flags & IFF_LOOPBACK
The Linux command line is useful, efficient, and fun, but sometimes dangerous, especially if you are
The icons in the upper left corner of Windows 7 Explorer are Favorites, Desktops, and various Librar
Description of Requirement compile and install MySQL, PHP , and Apache to work a. The process o
We know that both functions provide the ability to enter one line at a time. However, gets is a depr
Ten Linux operating system security management skills experience summary
The Linux CPU number judgment command
A recovery method for accidentally deleting files under Linux
Linux operating system timing task system
Analysis of the lower part of the Linux 2.6 interrupt
Arm linux boot process into the kernel
Samsung Camera Interface driver(FIMC)
Neighbor subsystem of linux protocol stack (garbage collection seven)
How to modify the default program of Windows10 system
If the XP input method is gone, what should I do?
How to set up win10 fast start win10 fast switch machine setup tutorial
115 network disk how to download 115 network disk can not download the solution
Windows7 "Happy Baking House" cartoon theme download
Teach you how to analyze the WLAN netsh command in Windows 7
Press F1 to boot into the system to cancel the method
How to set the computer to shut down the time
Manage Active Directory Database (Compression/Mobile) for Windows Server 2008 R2
How to turn off the mobile drive autoplay in the Win7 system