Bug 1845608

Summary: Missing support of MDB_RTR_TYPE_TEMP(3) in 'bridge.multicast-router'
Product: Red Hat Enterprise Linux 8 Reporter: Gris Ge <fge>
Component: NetworkManagerAssignee: Thomas Haller <thaller>
Status: CLOSED NOTABUG QA Contact: Desktop QE <desktop-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: ---CC: acardace, atragler, bgalvani, lrintel, rkhan, sukulkar, thaller, till
Target Milestone: rc   
Target Release: 8.3   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-06-30 14:37:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1738136    

Description Gris Ge 2020-06-09 16:02:42 UTC
Description of problem:

In kernel, the linux bridge muilticast route type has `MDB_RTR_TYPE_TEMP(3)`.

```
/* multicast router types */
enum {
	MDB_RTR_TYPE_DISABLED,
	MDB_RTR_TYPE_TEMP_QUERY,
	MDB_RTR_TYPE_PERM,
	MDB_RTR_TYPE_TEMP
};

```

which is not supported by NetworkManager.

Version-Release number of selected component (if applicable):

NetworkManager-1.25.2-25985.d1e8eb791c.el8.x86_64

How reproducible:
100%

Steps to Reproduce:
1. nmcli c add type bridge ifname br0 bridge.multicast-router 3
2.
3.

Actual results:

Error: failed to modify bridge.multicast-router: '3' not among [auto, disabled, enabled].

Expected results:

No failure.

Additional info:

Please also allowing `bridge.multicast-router` been set via integer.

Comment 1 Thomas Haller 2020-06-10 15:23:59 UTC
option "3" is not supported for the bridge device itself:


# ip link delete br0 2>/dev/null;
# ip link add br0 type bridge mcast_router 3;
# cat /sys/devices/virtual/net/br0/bridge/multicast_router
RTNETLINK answers: Invalid argument

likewise:
# ip link delete br0 2>/dev/null;
# ip link add br0 type bridge mcast_router 2;
# cat /sys/devices/virtual/net/br0/bridge/multicast_router
2
# echo 3 > /sys/devices/virtual/net/br0/bridge/multicast_router
bash: echo: write error: Invalid argument


see br_multicast_set_router() in kernel.


Option MDB_RTR_TYPE_TEMP is only supported for slaves. Like `man ip-link` says:

   mcast_router MULTICAST_ROUTER - configure this port for having multicast routers attached. A port with a multicast router will receive all multicast traffic. MULTICAST_ROUTER may be 
   either 0 to disable multicast routers on this port, 1 to let the system detect the presence of of routers (this is the default), 2 to permanently enable multicast traffic forwarding on 
   this port or 3 to enable multicast routers temporarily on this port, not depending on incoming queries.

Comment 2 Gris Ge 2020-06-19 02:34:57 UTC
Hi Thomas,

Thanks for the info. Yes, the kernel indicate the 3 option is only for bridge port.

Since the sysfs is using integer for this option, can we expect NM support integer as well?
It worry me that kenrel constant names are completely different from auto/disabled/enabled

You want me to create new bug for this integer support or we can use this one?

Comment 3 Thomas Haller 2020-06-29 10:43:01 UTC
(In reply to Gris Ge from comment #2)
> Hi Thomas,
> 
> Thanks for the info. Yes, the kernel indicate the 3 option is only for
> bridge port.
> 
> Since the sysfs is using integer for this option, can we expect NM support
> integer as well?
> It worry me that kenrel constant names are completely different from
> auto/disabled/enabled
> 
> You want me to create new bug for this integer support or we can use this
> one?

yes, that is unfortunate. But the API was added in 1.24.0, and the existing API cannot be changed. The only possible thing would be to deprecate the option and add an alternative, but that makes the API overall most confusing, not less.

Comment 5 Thomas Haller 2020-06-30 14:37:20 UTC
OK, so we cannot change the API to use numbers instead of the names ("auto", "disabled", "enabled").

I improved the documentation slightly (on master: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/commit/b9aa7ef81c2de70a3673b38ae0f36c5ad4e666ab )


Other than that, I think there is nothing to do for this bug. Closing as NOTABUG.

Please reopen, if you think anything is missing. Thanks.