Redirect `ip mrule show` errors to ip_mrule.error
authorMichael Prokop <mika@grml.org>
Tue, 27 Mar 2018 13:29:10 +0000 (15:29 +0200)
committerMichael Prokop <mika@grml.org>
Tue, 27 Mar 2018 13:29:10 +0000 (15:29 +0200)
`ip mrule show` depends on CONFIG_IP_MROUTE_MULTIPLE_TABLES
for IPv4 and CONFIG_IPV6_MROUTE_MULTIPLE_TABLES for IPv6,
if either is missing then it fails:

  % ip -6 mrule show
  32767:  from all lookup main
  % ip -4 mrule show
  RTNETLINK answers: Address family not supported by protocol
  Dump terminated
  % ip mrule show
  RTNETLINK answers: Address family not supported by protocol
  Dump terminated

  % grep MROUTE /boot/config-$(uname -r)
  CONFIG_IP_MROUTE=y
  # CONFIG_IP_MROUTE_MULTIPLE_TABLES is not set
  CONFIG_IPV6_MROUTE=y
  CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
  % uname -r
  4.13.13-6-pve

Noticed on a customer system running Proxmox kernel,
reported towards upstream: https://bugzilla.proxmox.com/show_bug.cgi?id=1711

grml-hwinfo

index 72f79c0..fc5c8b4 100755 (executable)
@@ -229,7 +229,7 @@ cd "${OUTDIR}" || exit 1
   exectest ip && ip link show      > ip_link
   exectest ip && ip maddr show     > ip_maddr
   exectest ip && ip mroute show    > ip_mroute
-  exectest ip && ip mrule show     > ip_mrule
+  exectest ip && ip mrule show     > ip_mrule 2>ip_mrule.error
   exectest ip && ip neigh show     > ip_neigh
   exectest ip && ip netns list     > ip_netns
   exectest ip && ip ntable show    > ip_ntable