Creating Bridge Devices and Bridge Ports
There is no hard limit to the number of bridge devices
an administrator can create. Each bridge device can have up to BR_MAX_PORTS (1,024) ports.
Bridge devices are created and removed, respectively, with br_add_bridge and br_del_bridge.
Ports are added to a bridge device with br_add_if
and are removed with br_del_if.
All four routines run with the Netlink routing lock held. The lock is acquired with
rtnl_lock and is released with rtnl_unlock. br_add_bridge
and br_del_bridge take care of locking on their own.
For br_add_if and br_del_if, the dev_ioctl function takes care
of it (see in Chapter 17).
All four br_ routines are defined in net/bridge/br_if.c. In Chapter 17, you can learn how they are invoked in response to configuration
commands in user space.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access