On 9/25/20 5:11 PM, Qingtao Cao wrote: > From: Qingtao Cao <[email protected]> > > Add /proc/sys/net/ipv[4|6]/conf/<device>/def_rt_metric sysfs attribute > file for each network interface so that userspace programs can specify > different default route metrics for each interface, which will also be > applied by the kernel when new routes are automatically created for > relevant interfaces, when userspace programs may have not specified > metrics via relevant netlink messages for example. > > Signed-off-by: Qingtao Cao <[email protected]> > Signed-off-by: David Leonard <[email protected]> > --- > Documentation/networking/ip-sysctl.rst | 8 +++++ > include/linux/inetdevice.h | 4 +++ > include/linux/ipv6.h | 3 ++ > include/net/ip6_route.h | 15 ++++++++ > include/uapi/linux/ip.h | 1 + > include/uapi/linux/ipv6.h | 1 + > net/ipv4/Kconfig | 13 +++++++ > net/ipv4/devinet.c | 3 ++ > net/ipv4/fib_frontend.c | 27 ++++++++++++++ > net/ipv6/addrconf.c | 30 ++++++++++++++-- > net/ipv6/route.c | 50 ++++++++++++++++++++++++-- > 11 files changed, 150 insertions(+), 5 deletions(-)
uh, no. The metric can be specified for prefix routes via IFA_RT_PRIORITY. There is no reason for bloating the code and adding another sys knob for this. Fix your network manager to set the priority when the address is created.
