]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: drop printing IP_MULTICAST_LOOP sockopt
authorDavid Lamparter <equinox@opensourcerouting.org>
Sat, 12 Mar 2022 11:52:34 +0000 (12:52 +0100)
committerDavid Lamparter <equinox@opensourcerouting.org>
Sat, 12 Mar 2022 11:55:12 +0000 (12:55 +0100)
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>
pimd/pim_cmd.c
pimd/pim_sock.c
pimd/pim_sock.h

index 3b3d06e791116e081bf1206be65deae2f39b1404..2d68b99886d4b739caa95af9a70abf3624e724c8 100644 (file)
@@ -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");
index 05b0f92a4b65fce0fc5e353f8043ba87749344b1..8d3fbabd27b40ea3306bdd8a781e5ae6136853a1 100644 (file)
@@ -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)) {
index 08b0099321f7d5d38eaf9b9c379af5d66c0a5ed5..7081e38f818155fe38ba1581b3688f341e68c5e8 100644 (file)
@@ -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 */