diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2024-05-30 15:48:33 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2024-05-31 11:29:40 -0400 |
| commit | 5ef144ce6d03d2dc2d36cf7d0e6ef6ce8ba6d2dc (patch) | |
| tree | 9b1a2ef4f9cfb08330796686eb4c10657b44dd3d | |
| parent | cdc964c23335c96000389c6e81aab7d37ee65780 (diff) | |
pimd: Give a clearer warning when the kernel is not compiled right
When the kernel is not compiled with mroute vrf's enabled it will
fail the call to initialize the vrf. As such let's recognize this
specific error code and output a specific warning to the operator
to help them figure this problem out.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| -rw-r--r-- | pimd/pim_mroute.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c index c63e0f35d4..adc47e719d 100644 --- a/pimd/pim_mroute.c +++ b/pimd/pim_mroute.c @@ -56,10 +56,14 @@ int pim_mroute_set(struct pim_instance *pim, int enable) err = setsockopt(pim->mroute_socket, PIM_IPPROTO, MRT_TABLE, &data, data_len); if (err) { - zlog_warn( - "%s %s: failure: setsockopt(fd=%d,PIM_IPPROTO, MRT_TABLE=%d): errno=%d: %s", - __FILE__, __func__, pim->mroute_socket, - data, errno, safe_strerror(errno)); + if (err == ENOPROTOOPT) + zlog_err("%s Kernel is not compiled with CONFIG_IP_MROUTE_MULTIPLE_TABLES and vrf's will not work", + __func__); + else + zlog_warn("%s %s: failure: setsockopt(fd=%d,PIM_IPPROTO, MRT_TABLE=%d): errno=%d: %s", + __FILE__, __func__, + pim->mroute_socket, data, + errno, safe_strerror(errno)); return -1; } } |
