summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2022-03-12 12:52:34 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2022-03-12 12:55:12 +0100
commitc532e50351691077263be0aca9a19755b8bed7b0 (patch)
tree65330cd94f84a571032038771f091261dd26e40f
parentMerge pull request #10662 from chiragshah6/evpn_dev1 (diff)
downloadfrr-c532e50351691077263be0aca9a19755b8bed7b0.tar.xz
frr-c532e50351691077263be0aca9a19755b8bed7b0.zip
pimd: drop printing IP_MULTICAST_LOOP sockopt
This isn't a system or interface setting, it's a socket behavior. It is both irrelevant and confusing to the user since it doesn't affect any system behavior (but it sounds like it does). Whether it is enabled or not is solely relevant to how the code is designed to work. So, remove it from output. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
-rw-r--r--pimd/pim_cmd.c21
-rw-r--r--pimd/pim_sock.c17
-rw-r--r--pimd/pim_sock.h2
3 files changed, 3 insertions, 37 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index 3b3d06e79..2d68b9988 100644
--- a/pimd/pim_cmd.c
+++ b/pimd/pim_cmd.c
@@ -455,8 +455,7 @@ static void pim_show_membership(struct pim_instance *pim, struct vty *vty,
json_object_free(json);
}
-static void pim_print_ifp_flags(struct vty *vty, struct interface *ifp,
- int mloop)
+static void pim_print_ifp_flags(struct vty *vty, struct interface *ifp)
{
vty_out(vty, "Flags\n");
vty_out(vty, "-----\n");
@@ -469,7 +468,6 @@ static void pim_print_ifp_flags(struct vty *vty, struct interface *ifp,
vty_out(vty, "Interface Index : %d\n", ifp->ifindex);
vty_out(vty, "Multicast : %s\n",
if_is_multicast(ifp) ? "yes" : "no");
- vty_out(vty, "Multicast Loop : %d\n", mloop);
vty_out(vty, "Promiscuous : %s\n",
(ifp->flags & IFF_PROMISC) ? "yes" : "no");
vty_out(vty, "\n");
@@ -576,7 +574,6 @@ static void igmp_show_interfaces_single(struct pim_instance *pim,
char other_hhmmss[10];
int found_ifname = 0;
int sqi;
- int mloop = 0;
long gmi_msec; /* Group Membership Interval */
long lmqt_msec;
long ohpi_msec;
@@ -639,11 +636,6 @@ static void igmp_show_interfaces_single(struct pim_instance *pim,
qri_msec =
pim_ifp->gm_query_max_response_time_dsec * 100;
- if (pim_ifp->pim_sock_fd >= 0)
- mloop = pim_socket_mcastloop_get(
- pim_ifp->pim_sock_fd);
- else
- mloop = 0;
lmqc = pim_ifp->gm_last_member_query_count;
if (uj) {
@@ -776,7 +768,7 @@ static void igmp_show_interfaces_single(struct pim_instance *pim,
vty_out(vty, "\n");
vty_out(vty, "\n");
- pim_print_ifp_flags(vty, ifp, mloop);
+ pim_print_ifp_flags(vty, ifp);
}
}
}
@@ -903,7 +895,6 @@ static void pim_show_interfaces_single(struct pim_instance *pim,
char src_str[INET_ADDRSTRLEN];
char stat_uptime[10];
char uptime[10];
- int mloop = 0;
int found_ifname = 0;
int print_header;
json_object *json = NULL;
@@ -945,10 +936,6 @@ static void pim_show_interfaces_single(struct pim_instance *pim,
pim_ifp->pim_hello_period);
pim_time_uptime(stat_uptime, sizeof(stat_uptime),
now - pim_ifp->pim_ifstat_start);
- if (pim_ifp->pim_sock_fd >= 0)
- mloop = pim_socket_mcastloop_get(pim_ifp->pim_sock_fd);
- else
- mloop = 0;
if (uj) {
char pbuf[PREFIX2STR_BUFFER];
@@ -1096,8 +1083,6 @@ static void pim_show_interfaces_single(struct pim_instance *pim,
pim_ifp->pim_ifstat_hello_sendfail);
json_object_int_add(json_row, "helloGenerationId",
pim_ifp->pim_generation_id);
- json_object_int_add(json_row, "flagMulticastLoop",
- mloop);
json_object_int_add(
json_row, "effectivePropagationDelay",
@@ -1250,7 +1235,7 @@ static void pim_show_interfaces_single(struct pim_instance *pim,
vty_out(vty, "\n");
vty_out(vty, "\n");
- pim_print_ifp_flags(vty, ifp, mloop);
+ pim_print_ifp_flags(vty, ifp);
vty_out(vty, "Join Prune Interval\n");
vty_out(vty, "-------------------\n");
diff --git a/pimd/pim_sock.c b/pimd/pim_sock.c
index 05b0f92a4..8d3fbabd2 100644
--- a/pimd/pim_sock.c
+++ b/pimd/pim_sock.c
@@ -407,23 +407,6 @@ int pim_socket_recvfromto(int fd, uint8_t *buf, size_t len,
return err; /* len */
}
-int pim_socket_mcastloop_get(int fd)
-{
- int loop;
- socklen_t loop_len = sizeof(loop);
-
- if (getsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP, &loop, &loop_len)) {
- int e = errno;
- zlog_warn(
- "Could not get Multicast Loopback Option on socket fd=%d: errno=%d: %s",
- fd, errno, safe_strerror(errno));
- errno = e;
- return PIM_SOCK_ERR_LOOP;
- }
-
- return loop;
-}
-
int pim_socket_getsockname(int fd, struct sockaddr *name, socklen_t *namelen)
{
if (getsockname(fd, name, namelen)) {
diff --git a/pimd/pim_sock.h b/pimd/pim_sock.h
index 08b009932..7081e38f8 100644
--- a/pimd/pim_sock.h
+++ b/pimd/pim_sock.h
@@ -47,8 +47,6 @@ int pim_socket_recvfromto(int fd, uint8_t *buf, size_t len,
struct sockaddr_in *to, socklen_t *tolen,
ifindex_t *ifindex);
-int pim_socket_mcastloop_get(int fd);
-
int pim_socket_getsockname(int fd, struct sockaddr *name, socklen_t *namelen);
#endif /* PIM_SOCK_H */