ipv4/igmp: fix build error if !CONFIG_IP_MULTICAST [Linux 5.2]

ipv4/igmp: fix build error if !CONFIG_IP_MULTICAST [Linux 5.2]

This Linux kernel change "ipv4/igmp: fix build error if !CONFIG_IP_MULTICAST" is included in the Linux 5.2 release. This change is authored by Eric Dumazet <edumazet [at] google.com> on Wed May 22 18:35:16 2019 -0700. The commit for this change in Linux stable tree is 903869b (patch).

ipv4/igmp: fix build error if !CONFIG_IP_MULTICAST

ip_sf_list_clear_all() needs to be defined even if !CONFIG_IP_MULTICAST

Fixes: 3580d04aa674 ("ipv4/igmp: fix another memory leak in igmpv3_del_delrec()")
Signed-off-by: Eric Dumazet <[email protected]>
Reported-by: kbuild test robot <[email protected]>
Signed-off-by: David S. Miller <[email protected]>

There are 22 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 net/ipv4/igmp.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 1a8d36dd..eb03153 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -188,6 +188,17 @@ static void ip_ma_put(struct ip_mc_list *im)
         pmc != NULL;                   \
         pmc = rtnl_dereference(pmc->next_rcu))

+static void ip_sf_list_clear_all(struct ip_sf_list *psf)
+{
+   struct ip_sf_list *next;
+
+   while (psf) {
+       next = psf->sf_next;
+       kfree(psf);
+       psf = next;
+   }
+}
+
 #ifdef CONFIG_IP_MULTICAST

 /*
@@ -633,17 +644,6 @@ static void igmpv3_clear_zeros(struct ip_sf_list **ppsf)
    }
 }

-static void ip_sf_list_clear_all(struct ip_sf_list *psf)
-{
-   struct ip_sf_list *next;
-
-   while (psf) {
-       next = psf->sf_next;
-       kfree(psf);
-       psf = next;
-   }
-}
-
 static void kfree_pmc(struct ip_mc_list *pmc)
 {
    ip_sf_list_clear_all(pmc->sources);

Leave a Reply

Your email address will not be published. Required fields are marked *