]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: Create storage for a raw socket.
authorDonald Sharp <sharpd@cumulusnetwroks.com>
Sat, 30 Jul 2016 01:20:19 +0000 (21:20 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:04 +0000 (20:26 -0500)
Each interface needs the ability to send raw packets
at the RP.  Create the data structure to do so.
Further commits will create the socket as necessary
and send the packet.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_iface.c
pimd/pim_iface.h

index fae11b674a07ed65eebf28e1b1b5ea425595e1d6..1ffea6ab46c576e8fd4975d0d08837da15ec1a78 100644 (file)
@@ -87,6 +87,7 @@ struct pim_interface *pim_if_new(struct interface *ifp, int igmp, int pim)
 
   pim_ifp->options                           = 0;
   pim_ifp->mroute_vif_index                  = -1;
+  pim_ifp->pim_raw_fd                        = -1;
 
   pim_ifp->igmp_default_robustness_variable           = IGMP_DEFAULT_ROBUSTNESS_VARIABLE;
   pim_ifp->igmp_default_query_interval                = IGMP_GENERAL_QUERY_INTERVAL;
@@ -162,6 +163,12 @@ void pim_if_delete(struct interface *ifp)
   pim_ifp = ifp->info;
   zassert(pim_ifp);
 
+  if (pim_ifp->pim_raw_fd == -1)
+    {
+      close (pim_ifp->pim_raw_fd);
+      pim_ifp->pim_raw_fd = -1;
+    }
+
   if (pim_ifp->igmp_join_list) {
     pim_if_igmp_join_del_all(ifp);
   }
index 75b85c306a396ceb456debcb955c6db3271306f6..7f3d6961fae3e31dfc098ac2b0de16c59dc0495a 100644 (file)
@@ -73,6 +73,7 @@ struct pim_interface {
   struct list *igmp_join_list;                              /* list of struct igmp_join */
 
   int            pim_sock_fd;       /* PIM socket file descriptor */
+  int            pim_raw_fd;        /* RP forwarding */
   struct thread *t_pim_sock_read;   /* thread for reading PIM socket */
   int64_t        pim_sock_creation; /* timestamp of PIM socket creation */