Browse Source

[pim] Log physical interface up/down
[pim] Replace strerror with safe_strerror
[pim] Fix PIM socket removal from non-PIM interfaces
[pim] show ip igmp querier: left-align Querier string
[pim] Version up to 0.157
[pim] Recipe to re-sync with Quagga repository
[pim] Build vtysh in development script

Everton Marques 10 years ago
parent
commit
e96f0af267
14 changed files with 85 additions and 62 deletions
  1. 21 21
      pimd/pim_cmd.c
  2. 1 1
      pimd/pim_iface.c
  3. 5 5
      pimd/pim_igmp.c
  4. 1 1
      pimd/pim_igmpv3.c
  5. 10 10
      pimd/pim_mroute.c
  6. 9 3
      pimd/pim_pim.c
  7. 14 14
      pimd/pim_sock.c
  8. 1 1
      pimd/pim_str.c
  9. 2 2
      pimd/pim_time.c
  10. 1 1
      pimd/pim_version.h
  11. 7 1
      pimd/pim_zebra.c
  12. 1 1
      pimd/pimd.c
  13. 1 1
      pimd/quagga-configure.sh
  14. 11 0
      pimd/savannah-git-clone.sh

+ 21 - 21
pimd/pim_cmd.c

@@ -1084,7 +1084,7 @@ static void igmp_show_querier(struct vty *vty)
       pim_time_timer_to_hhmmss(query_hhmmss, sizeof(query_hhmmss), igmp->t_igmp_query_timer);
       pim_time_timer_to_hhmmss(other_hhmmss, sizeof(other_hhmmss), igmp->t_other_querier_timer);
 
-      vty_out(vty, "%-9s %-15s %7s %10d %11s %11s%s",
+      vty_out(vty, "%-9s %-15s %-7s %10d %11s %11s%s",
 	      ifp->name,
 	      inet_ntoa(igmp->ifaddr),
 	      igmp->t_igmp_query_timer ? "THIS" : "OTHER",
@@ -1871,7 +1871,7 @@ static void show_multicast_interfaces(struct vty *vty)
 	      ifp->name,
 	      pim_ifp->mroute_vif_index,
 	      e,
-	      strerror(e),
+	      safe_strerror(e),
 	      VTY_NEWLINE);	      
       continue;
     }
@@ -2047,7 +2047,7 @@ static void show_mroute_count(struct vty *vty)
 	      source_str,
 	      group_str,
 	      e,
-	      strerror(e),
+	      safe_strerror(e),
 	      VTY_NEWLINE);	      
       continue;
     }
@@ -2093,7 +2093,7 @@ DEFUN (show_ip_route,
   result = inet_pton(AF_INET, addr_str, &addr);
   if (result <= 0) {
     vty_out(vty, "Bad unicast address %s: errno=%d: %s%s",
-	    addr_str, errno, strerror(errno), VTY_NEWLINE);
+	    addr_str, errno, safe_strerror(errno), VTY_NEWLINE);
     return CMD_WARNING;
   }
 
@@ -2265,7 +2265,7 @@ DEFUN (interface_ip_igmp_join,
   result = inet_pton(AF_INET, group_str, &group_addr);
   if (result <= 0) {
     vty_out(vty, "Bad group address %s: errno=%d: %s%s",
-	    group_str, errno, strerror(errno), VTY_NEWLINE);
+	    group_str, errno, safe_strerror(errno), VTY_NEWLINE);
     return CMD_WARNING;
   }
 
@@ -2274,7 +2274,7 @@ DEFUN (interface_ip_igmp_join,
   result = inet_pton(AF_INET, source_str, &source_addr);
   if (result <= 0) {
     vty_out(vty, "Bad source address %s: errno=%d: %s%s",
-	    source_str, errno, strerror(errno), VTY_NEWLINE);
+	    source_str, errno, safe_strerror(errno), VTY_NEWLINE);
     return CMD_WARNING;
   }
 
@@ -2312,7 +2312,7 @@ DEFUN (interface_no_ip_igmp_join,
   result = inet_pton(AF_INET, group_str, &group_addr);
   if (result <= 0) {
     vty_out(vty, "Bad group address %s: errno=%d: %s%s",
-	    group_str, errno, strerror(errno), VTY_NEWLINE);
+	    group_str, errno, safe_strerror(errno), VTY_NEWLINE);
     return CMD_WARNING;
   }
 
@@ -2321,7 +2321,7 @@ DEFUN (interface_no_ip_igmp_join,
   result = inet_pton(AF_INET, source_str, &source_addr);
   if (result <= 0) {
     vty_out(vty, "Bad source address %s: errno=%d: %s%s",
-	    source_str, errno, strerror(errno), VTY_NEWLINE);
+	    source_str, errno, safe_strerror(errno), VTY_NEWLINE);
     return CMD_WARNING;
   }
 
@@ -3168,7 +3168,7 @@ DEFUN (test_igmp_receive_report,
   result = inet_pton(AF_INET, grp_str, &grp_addr);
   if (result <= 0) {
     vty_out(vty, "Bad group address %s: errno=%d: %s%s",
-	    grp_str, errno, strerror(errno), VTY_NEWLINE);
+	    grp_str, errno, safe_strerror(errno), VTY_NEWLINE);
     return CMD_WARNING;
   }
 
@@ -3204,7 +3204,7 @@ DEFUN (test_igmp_receive_report,
     result = inet_pton(AF_INET, src_str, src_addr);
     if (result <= 0) {
       vty_out(vty, "Bad source address %s: errno=%d: %s%s",
-	      src_str, errno, strerror(errno), VTY_NEWLINE);
+	      src_str, errno, safe_strerror(errno), VTY_NEWLINE);
       return CMD_WARNING;
     }
   }
@@ -3281,7 +3281,7 @@ DEFUN (test_pim_receive_hello,
   result = inet_pton(AF_INET, neigh_str, &neigh_addr);
   if (result <= 0) {
     vty_out(vty, "Bad neighbor address %s: errno=%d: %s%s",
-	    neigh_str, errno, strerror(errno), VTY_NEWLINE);
+	    neigh_str, errno, safe_strerror(errno), VTY_NEWLINE);
     return CMD_WARNING;
   }
 
@@ -3314,7 +3314,7 @@ DEFUN (test_pim_receive_hello,
     result = inet_pton(AF_INET, sec_str, &sec_addr);
     if (result <= 0) {
       vty_out(vty, "Bad neighbor secondary address %s: errno=%d: %s%s",
-	      sec_str, errno, strerror(errno), VTY_NEWLINE);
+	      sec_str, errno, safe_strerror(errno), VTY_NEWLINE);
       return CMD_WARNING;
     }
 
@@ -3407,7 +3407,7 @@ DEFUN (test_pim_receive_assert,
   result = inet_pton(AF_INET, neigh_str, &neigh_addr);
   if (result <= 0) {
     vty_out(vty, "Bad neighbor address %s: errno=%d: %s%s",
-	    neigh_str, errno, strerror(errno), VTY_NEWLINE);
+	    neigh_str, errno, safe_strerror(errno), VTY_NEWLINE);
     return CMD_WARNING;
   }
 
@@ -3416,7 +3416,7 @@ DEFUN (test_pim_receive_assert,
   result = inet_pton(AF_INET, group_str, &group_addr);
   if (result <= 0) {
     vty_out(vty, "Bad group address %s: errno=%d: %s%s",
-	    group_str, errno, strerror(errno), VTY_NEWLINE);
+	    group_str, errno, safe_strerror(errno), VTY_NEWLINE);
     return CMD_WARNING;
   }
 
@@ -3425,7 +3425,7 @@ DEFUN (test_pim_receive_assert,
   result = inet_pton(AF_INET, source_str, &source_addr);
   if (result <= 0) {
     vty_out(vty, "Bad source address %s: errno=%d: %s%s",
-	    source_str, errno, strerror(errno), VTY_NEWLINE);
+	    source_str, errno, safe_strerror(errno), VTY_NEWLINE);
     return CMD_WARNING;
   }
 
@@ -3523,7 +3523,7 @@ static int recv_joinprune(struct vty *vty,
   result = inet_pton(AF_INET, neigh_dst_str, &neigh_dst_addr);
   if (result <= 0) {
     vty_out(vty, "Bad neighbor destination address %s: errno=%d: %s%s",
-	    neigh_dst_str, errno, strerror(errno), VTY_NEWLINE);
+	    neigh_dst_str, errno, safe_strerror(errno), VTY_NEWLINE);
     return CMD_WARNING;
   }
 
@@ -3532,7 +3532,7 @@ static int recv_joinprune(struct vty *vty,
   result = inet_pton(AF_INET, neigh_src_str, &neigh_src_addr);
   if (result <= 0) {
     vty_out(vty, "Bad neighbor source address %s: errno=%d: %s%s",
-	    neigh_src_str, errno, strerror(errno), VTY_NEWLINE);
+	    neigh_src_str, errno, safe_strerror(errno), VTY_NEWLINE);
     return CMD_WARNING;
   }
 
@@ -3541,7 +3541,7 @@ static int recv_joinprune(struct vty *vty,
   result = inet_pton(AF_INET, group_str, &group_addr);
   if (result <= 0) {
     vty_out(vty, "Bad group address %s: errno=%d: %s%s",
-	    group_str, errno, strerror(errno), VTY_NEWLINE);
+	    group_str, errno, safe_strerror(errno), VTY_NEWLINE);
     return CMD_WARNING;
   }
 
@@ -3550,7 +3550,7 @@ static int recv_joinprune(struct vty *vty,
   result = inet_pton(AF_INET, source_str, &source_addr);
   if (result <= 0) {
     vty_out(vty, "Bad source address %s: errno=%d: %s%s",
-	    source_str, errno, strerror(errno), VTY_NEWLINE);
+	    source_str, errno, safe_strerror(errno), VTY_NEWLINE);
     return CMD_WARNING;
   }
 
@@ -3740,7 +3740,7 @@ DEFUN (test_pim_receive_upcall,
   result = inet_pton(AF_INET, group_str, &msg.im_dst);
   if (result <= 0) {
     vty_out(vty, "Bad group address %s: errno=%d: %s%s",
-	    group_str, errno, strerror(errno), VTY_NEWLINE);
+	    group_str, errno, safe_strerror(errno), VTY_NEWLINE);
     return CMD_WARNING;
   }
 
@@ -3749,7 +3749,7 @@ DEFUN (test_pim_receive_upcall,
   result = inet_pton(AF_INET, source_str, &msg.im_src);
   if (result <= 0) {
     vty_out(vty, "Bad source address %s: errno=%d: %s%s",
-	    source_str, errno, strerror(errno), VTY_NEWLINE);
+	    source_str, errno, safe_strerror(errno), VTY_NEWLINE);
     return CMD_WARNING;
   }
 

+ 1 - 1
pimd/pim_iface.c

@@ -1020,7 +1020,7 @@ int pim_if_igmp_join_del(struct interface *ifp,
     pim_inet4_dump("<src?>", source_addr, source_str, sizeof(source_str));
     zlog_warn("%s: failure closing sock_fd=%d for IGMP group %s source %s on interface %s: errno=%d: %s",
 	      __PRETTY_FUNCTION__,
-	      ij->sock_fd, group_str, source_str, ifp->name, e, strerror(e));
+	      ij->sock_fd, group_str, source_str, ifp->name, e, safe_strerror(e));
     /* warning only */
   }
   listnode_delete(pim_ifp->igmp_join_list, ij);

+ 5 - 5
pimd/pim_igmp.c

@@ -65,7 +65,7 @@ static int igmp_sock_open(struct in_addr ifaddr, int ifindex, uint32_t pim_optio
     else {
       zlog_warn("%s %s: IGMP socket fd=%d interface %s: could not solve %s to group address: errno=%d: %s",
 		__FILE__, __PRETTY_FUNCTION__, fd, inet_ntoa(ifaddr),
-		PIM_ALL_ROUTERS, errno, strerror(errno));
+		PIM_ALL_ROUTERS, errno, safe_strerror(errno));
     }
   }
 
@@ -80,7 +80,7 @@ static int igmp_sock_open(struct in_addr ifaddr, int ifindex, uint32_t pim_optio
   else {
     zlog_warn("%s %s: IGMP socket fd=%d interface %s: could not solve %s to group address: errno=%d: %s",
 	      __FILE__, __PRETTY_FUNCTION__, fd, inet_ntoa(ifaddr),
-	      PIM_ALL_SYSTEMS, errno, strerror(errno));
+	      PIM_ALL_SYSTEMS, errno, safe_strerror(errno));
   }
 
   if (inet_aton(PIM_ALL_IGMP_ROUTERS, &group)) {
@@ -91,7 +91,7 @@ static int igmp_sock_open(struct in_addr ifaddr, int ifindex, uint32_t pim_optio
   else {
       zlog_warn("%s %s: IGMP socket fd=%d interface %s: could not solve %s to group address: errno=%d: %s",
 		__FILE__, __PRETTY_FUNCTION__, fd, inet_ntoa(ifaddr),
-		PIM_ALL_IGMP_ROUTERS, errno, strerror(errno));
+		PIM_ALL_IGMP_ROUTERS, errno, safe_strerror(errno));
   }    
 
   if (!join) {
@@ -949,7 +949,7 @@ static int pim_igmp_read(struct thread *t)
 			      &ifindex);
   if (len < 0) {
     zlog_warn("Failure receiving IP IGMP packet on fd=%d: errno=%d: %s",
-	      fd, errno, strerror(errno));
+	      fd, errno, safe_strerror(errno));
     goto done;
   }
 
@@ -1023,7 +1023,7 @@ static void sock_close(struct igmp_sock *igmp)
   if (close(igmp->fd)) {
     zlog_err("Failure closing IGMP socket %s fd=%d on interface %s: errno=%d: %s",
 	     inet_ntoa(igmp->ifaddr), igmp->fd, igmp->interface->name,
-	     errno, strerror(errno));
+	     errno, safe_strerror(errno));
   }
   
   if (PIM_DEBUG_IGMP_TRACE) {

+ 1 - 1
pimd/pim_igmpv3.c

@@ -1679,7 +1679,7 @@ void pim_igmp_send_membership_query(struct igmp_group *group,
       zlog_warn("%s: sendto() failure to %s on %s: group=%s msg_size=%d: errno=%d: %s",
 		__PRETTY_FUNCTION__,
 		dst_str, ifname, group_str, msg_size,
-		e, strerror(e));
+		e, safe_strerror(e));
     }
     else {
       zlog_warn("%s: sendto() partial to %s on %s: group=%s msg_size=%d: sent=%d",

+ 10 - 10
pimd/pim_mroute.c

@@ -47,7 +47,7 @@ static int pim_mroute_set(int fd, int enable)
     int e = errno;
     zlog_warn("%s %s: failure: setsockopt(fd=%d,IPPROTO_IP,%s=%d): errno=%d: %s",
 	      __FILE__, __PRETTY_FUNCTION__,
-	      fd, enable ? "MRT_INIT" : "MRT_DONE", opt, e, strerror(e));
+	      fd, enable ? "MRT_INIT" : "MRT_DONE", opt, e, safe_strerror(e));
     errno = e;
     return -1;
   }
@@ -209,7 +209,7 @@ static int mroute_read_msg(int fd)
   rd = read(fd, buf, sizeof(buf));
   if (rd < 0) {
     zlog_warn("%s: failure reading fd=%d: errno=%d: %s",
-	      __PRETTY_FUNCTION__, fd, errno, strerror(errno));
+	      __PRETTY_FUNCTION__, fd, errno, safe_strerror(errno));
     return -2;
   }
 
@@ -275,13 +275,13 @@ int pim_mroute_socket_enable()
 
   if (fd < 0) {
     zlog_warn("Could not create mroute socket: errno=%d: %s",
-	      errno, strerror(errno));
+	      errno, safe_strerror(errno));
     return -2;
   }
 
   if (pim_mroute_set(fd, 1)) {
     zlog_warn("Could not enable mroute on socket fd=%d: errno=%d: %s",
-	      fd, errno, strerror(errno));
+	      fd, errno, safe_strerror(errno));
     close(fd);
     return -3;
   }
@@ -302,13 +302,13 @@ int pim_mroute_socket_disable()
 
   if (pim_mroute_set(qpim_mroute_socket_fd, 0)) {
     zlog_warn("Could not disable mroute on socket fd=%d: errno=%d: %s",
-	      qpim_mroute_socket_fd, errno, strerror(errno));
+	      qpim_mroute_socket_fd, errno, safe_strerror(errno));
     return -2;
   }
 
   if (close(qpim_mroute_socket_fd)) {
     zlog_warn("Failure closing mroute socket: fd=%d errno=%d: %s",
-	      qpim_mroute_socket_fd, errno, strerror(errno));
+	      qpim_mroute_socket_fd, errno, safe_strerror(errno));
     return -3;
   }
 
@@ -359,7 +359,7 @@ int pim_mroute_add_vif(int vif_index, struct in_addr ifaddr)
     zlog_warn("%s %s: failure: setsockopt(fd=%d,IPPROTO_IP,MRT_ADD_VIF,vif_index=%d,ifaddr=%s): errno=%d: %s",
 	      __FILE__, __PRETTY_FUNCTION__,
 	      qpim_mroute_socket_fd, vif_index, ifaddr_str,
-	      e, strerror(e));
+	      e, safe_strerror(e));
     errno = e;
     return -2;
   }
@@ -387,7 +387,7 @@ int pim_mroute_del_vif(int vif_index)
     zlog_warn("%s %s: failure: setsockopt(fd=%d,IPPROTO_IP,MRT_DEL_VIF,vif_index=%d): errno=%d: %s",
 	      __FILE__, __PRETTY_FUNCTION__,
 	      qpim_mroute_socket_fd, vif_index,
-	      e, strerror(e));
+	      e, safe_strerror(e));
     errno = e;
     return -2;
   }
@@ -412,7 +412,7 @@ int pim_mroute_add(struct mfcctl *mc)
     zlog_warn("%s %s: failure: setsockopt(fd=%d,IPPROTO_IP,MRT_ADD_MFC): errno=%d: %s",
 	      __FILE__, __PRETTY_FUNCTION__,
 	      qpim_mroute_socket_fd,
-	      e, strerror(e));
+	      e, safe_strerror(e));
     errno = e;
     return -2;
   }
@@ -436,7 +436,7 @@ int pim_mroute_del(struct mfcctl *mc)
     zlog_warn("%s %s: failure: setsockopt(fd=%d,IPPROTO_IP,MRT_DEL_MFC): errno=%d: %s",
 	      __FILE__, __PRETTY_FUNCTION__,
 	      qpim_mroute_socket_fd,
-	      e, strerror(e));
+	      e, safe_strerror(e));
     errno = e;
     return -2;
   }

+ 9 - 3
pimd/pim_pim.c

@@ -74,7 +74,7 @@ static void sock_close(struct interface *ifp)
   if (close(pim_ifp->pim_sock_fd)) {
     zlog_warn("Failure closing PIM socket fd=%d on interface %s: errno=%d: %s",
 	      pim_ifp->pim_sock_fd, ifp->name,
-	      errno, strerror(errno));
+	      errno, safe_strerror(errno));
   }
   
   pim_ifp->pim_sock_fd = -1;
@@ -91,6 +91,12 @@ void pim_sock_delete(struct interface *ifp, const char *delete_message)
   zlog_info("PIM INTERFACE DOWN: on interface %s: %s",
 	    ifp->name, delete_message);
 
+  if (!ifp->info) {
+    zlog_err("%s: %s: but PIM not enabled on interface %s (!)",
+	     __PRETTY_FUNCTION__, delete_message, ifp->name);
+    return;
+  }
+
   /*
     RFC 4601: 4.3.1.  Sending Hello Messages
     
@@ -266,7 +272,7 @@ static int pim_sock_read(struct thread *t)
 			      &ifindex);
   if (len < 0) {
     zlog_warn("Failure receiving IP PIM packet on fd=%d: errno=%d: %s",
-	      fd, errno, strerror(errno));
+	      fd, errno, safe_strerror(errno));
     goto done;
   }
 
@@ -459,7 +465,7 @@ int pim_msg_send(int fd,
       zlog_warn("%s: sendto() failure to %s on %s: fd=%d msg_size=%d: errno=%d: %s",
 		__PRETTY_FUNCTION__,
 		dst_str, ifname, fd, pim_msg_size,
-		e, strerror(e));
+		e, safe_strerror(e));
     }
     else {
       zlog_warn("%s: sendto() partial to %s on %s: fd=%d msg_size=%d: sent=%d",

+ 14 - 14
pimd/pim_sock.c

@@ -68,7 +68,7 @@ int pim_socket_raw(int protocol)
 
   if (fd < 0) {
     zlog_warn("Could not create raw socket: errno=%d: %s",
-	      errno, strerror(errno));
+	      errno, safe_strerror(errno));
     return PIM_SOCK_ERR_SOCKET;
   }
   
@@ -82,7 +82,7 @@ int pim_socket_mcast(int protocol, struct in_addr ifaddr, int loop)
   fd = pim_socket_raw(protocol);
   if (fd < 0) {
     zlog_warn("Could not create multicast socket: errno=%d: %s",
-	      errno, strerror(errno));
+	      errno, safe_strerror(errno));
     return PIM_SOCK_ERR_SOCKET;
   }
 
@@ -93,14 +93,14 @@ int pim_socket_mcast(int protocol, struct in_addr ifaddr, int loop)
     int opt = 1;
     if (setsockopt(fd, SOL_IP, IP_PKTINFO, &opt, sizeof(opt))) {
       zlog_warn("Could not set IP_PKTINFO on socket fd=%d: errno=%d: %s",
-		fd, errno, strerror(errno));
+		fd, errno, safe_strerror(errno));
     }
 #elif defined(HAVE_IP_RECVDSTADDR)
     /* BSD IP_RECVDSTADDR */
     int opt = 1;
     if (setsockopt(fd, IPPROTO_IP, IP_RECVDSTADDR, &opt, sizeof(opt))) {
       zlog_warn("Could not set IP_RECVDSTADDR on socket fd=%d: errno=%d: %s",
-		fd, errno, strerror(errno));
+		fd, errno, safe_strerror(errno));
     }
 #else
     zlog_err("%s %s: Missing IP_PKTINFO and IP_RECVDSTADDR: unable to get dst addr from recvmsg()",
@@ -120,7 +120,7 @@ int pim_socket_mcast(int protocol, struct in_addr ifaddr, int loop)
     ra[3] = 0;
     if (setsockopt(fd, IPPROTO_IP, IP_OPTIONS, ra, 4)) {
       zlog_warn("Could not set Router Alert Option on socket fd=%d: errno=%d: %s",
-		fd, errno, strerror(errno));
+		fd, errno, safe_strerror(errno));
       close(fd);
       return PIM_SOCK_ERR_RA;
     }
@@ -131,7 +131,7 @@ int pim_socket_mcast(int protocol, struct in_addr ifaddr, int loop)
     if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR,
 		   (void *) &reuse, sizeof(reuse))) {
       zlog_warn("Could not set Reuse Address Option on socket fd=%d: errno=%d: %s",
-		fd, errno, strerror(errno));
+		fd, errno, safe_strerror(errno));
       close(fd);
       return PIM_SOCK_ERR_REUSE;
     }
@@ -143,7 +143,7 @@ int pim_socket_mcast(int protocol, struct in_addr ifaddr, int loop)
     if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_TTL,
 		   (void *) &ttl, sizeof(ttl))) {
       zlog_warn("Could not set multicast TTL=%d on socket fd=%d: errno=%d: %s",
-		MTTL, fd, errno, strerror(errno));
+		MTTL, fd, errno, safe_strerror(errno));
       close(fd);
       return PIM_SOCK_ERR_TTL;
     }
@@ -153,7 +153,7 @@ int pim_socket_mcast(int protocol, struct in_addr ifaddr, int loop)
 		 (void *) &loop, sizeof(loop))) {
     zlog_warn("Could not %s Multicast Loopback Option on socket fd=%d: errno=%d: %s",
 	      loop ? "enable" : "disable",
-	      fd, errno, strerror(errno));
+	      fd, errno, safe_strerror(errno));
     close(fd);
     return PIM_SOCK_ERR_LOOP;
   }
@@ -161,7 +161,7 @@ int pim_socket_mcast(int protocol, struct in_addr ifaddr, int loop)
   if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF,
 		 (void *) &ifaddr, sizeof(ifaddr))) {
     zlog_warn("Could not set Outgoing Interface Option on socket fd=%d: errno=%d: %s",
-	      fd, errno, strerror(errno));
+	      fd, errno, safe_strerror(errno));
     close(fd);
     return PIM_SOCK_ERR_IFACE;
   }
@@ -172,14 +172,14 @@ int pim_socket_mcast(int protocol, struct in_addr ifaddr, int loop)
     flags = fcntl(fd, F_GETFL, 0);
     if (flags < 0) {
       zlog_warn("Could not get fcntl(F_GETFL,O_NONBLOCK) on socket fd=%d: errno=%d: %s",
-		fd, errno, strerror(errno));
+		fd, errno, safe_strerror(errno));
       close(fd);
       return PIM_SOCK_ERR_NONBLOCK_GETFL;
     }
 
     if (fcntl(fd, F_SETFL, flags | O_NONBLOCK)) {
       zlog_warn("Could not set fcntl(F_SETFL,O_NONBLOCK) on socket fd=%d: errno=%d: %s",
-		fd, errno, strerror(errno));
+		fd, errno, safe_strerror(errno));
       close(fd);
       return PIM_SOCK_ERR_NONBLOCK_SETFL;
     }
@@ -218,7 +218,7 @@ int pim_socket_join(int fd, struct in_addr group,
       sprintf(ifaddr_str, "<ifaddr?>");
 
     zlog_err("Failure socket joining fd=%d group %s on interface address %s: errno=%d: %s",
-	     fd, group_str, ifaddr_str, errno, strerror(errno));
+	     fd, group_str, ifaddr_str, errno, safe_strerror(errno));
     return ret;
   }
 
@@ -268,7 +268,7 @@ int pim_socket_join_source(int fd, int ifindex,
     zlog_warn("%s: setsockopt(fd=%d) failure for IGMP group %s source %s ifindex %d on interface %s: errno=%d: %s",
 	      __PRETTY_FUNCTION__,
 	      fd, group_str, source_str, ifindex, ifname,
-	      e, strerror(e));
+	      e, safe_strerror(e));
     return -1;
   }
 
@@ -352,7 +352,7 @@ int pim_socket_mcastloop_get(int fd)
 		 &loop, &loop_len)) {
     int e = errno;
     zlog_warn("Could not get Multicast Loopback Option on socket fd=%d: errno=%d: %s",
-	      fd, errno, strerror(errno));
+	      fd, errno, safe_strerror(errno));
     errno = e;
     return PIM_SOCK_ERR_LOOP;
   }

+ 1 - 1
pimd/pim_str.c

@@ -37,7 +37,7 @@ void pim_inet4_dump(const char *onfail, struct in_addr addr, char *buf, int buf_
   if (!inet_ntop(AF_INET, &addr, buf, buf_size)) {
     int e = errno;
     zlog_warn("pim_inet4_dump: inet_ntop(AF_INET,buf_size=%d): errno=%d: %s",
-	      buf_size, e, strerror(e));
+	      buf_size, e, safe_strerror(e));
     if (onfail)
       snprintf(buf, buf_size, "%s", onfail);
   }

+ 2 - 2
pimd/pim_time.c

@@ -49,7 +49,7 @@ int64_t pim_time_monotonic_sec()
   if (pim_gettime(CLOCK_MONOTONIC, &now_tv)) {
     zlog_err("%s: gettime(CLOCK_MONOTONIC) failure: errno=%d: %s",
 	     __PRETTY_FUNCTION__,
-	     errno, strerror(errno));
+	     errno, safe_strerror(errno));
     return -1;
   }
 
@@ -68,7 +68,7 @@ int64_t pim_time_monotonic_dsec()
   if (pim_gettime(CLOCK_MONOTONIC, &now_tv)) {
     zlog_err("%s: gettime(CLOCK_MONOTONIC) failure: errno=%d: %s",
 	     __PRETTY_FUNCTION__,
-	     errno, strerror(errno));
+	     errno, safe_strerror(errno));
     return -1;
   }
 

+ 1 - 1
pimd/pim_version.h

@@ -23,7 +23,7 @@
 #ifndef PIM_VERSION_H
 #define PIM_VERSION_H
 
-#define PIMD_VERSION_STR "0.155"
+#define PIMD_VERSION_STR "0.157"
 
 const char * const PIMD_VERSION;
 

+ 7 - 1
pimd/pim_zebra.c

@@ -127,6 +127,8 @@ static int pim_zebra_if_state_up(int command, struct zclient *zclient,
   if (!ifp)
     return 0;
 
+  zlog_info("INTERFACE UP: %s", ifp->name);
+
   if (PIM_DEBUG_ZEBRA) {
     zlog_debug("%s: %s index %d flags %ld metric %d mtu %d operative %d",
 	       __PRETTY_FUNCTION__,
@@ -157,6 +159,8 @@ static int pim_zebra_if_state_down(int command, struct zclient *zclient,
   if (!ifp)
     return 0;
 
+  zlog_info("INTERFACE DOWN: %s", ifp->name);
+
   if (PIM_DEBUG_ZEBRA) {
     zlog_debug("%s: %s index %d flags %ld metric %d mtu %d operative %d",
 	       __PRETTY_FUNCTION__,
@@ -175,7 +179,9 @@ static int pim_zebra_if_state_down(int command, struct zclient *zclient,
       pim_sock_delete() closes the socket, stops read and timer threads,
       and kills all neighbors.
     */
-    pim_sock_delete(ifp, "link down");
+    if (ifp->info) {
+      pim_sock_delete(ifp, "link down");
+    }
   }
 
   return 0;

+ 1 - 1
pimd/pimd.c

@@ -72,7 +72,7 @@ void pim_init()
   if (!inet_aton(PIM_ALL_PIM_ROUTERS, &qpim_all_pim_routers_addr)) {
     zlog_err("%s %s: could not solve %s to group address: errno=%d: %s",
 	     __FILE__, __PRETTY_FUNCTION__,
-	     PIM_ALL_PIM_ROUTERS, errno, strerror(errno));
+	     PIM_ALL_PIM_ROUTERS, errno, safe_strerror(errno));
     zassert(0);
     return;
   }

+ 1 - 1
pimd/quagga-configure.sh

@@ -7,4 +7,4 @@
 #
 # $QuaggaId: $Format:%an, %ai, %h$ $
 
-./configure --disable-bgpd --disable-ripd --disable-ripngd --disable-ospfd --disable-ospf6d --disable-watchquagga --disable-bgp-announce --disable-ospfapi --disable-ospfclient --disable-rtadv --disable-irdp --enable-pimd --enable-tcp-zebra --enable-ipv6
+./configure --disable-bgpd --disable-ripd --disable-ripngd --disable-ospfd --disable-ospf6d --disable-watchquagga --disable-bgp-announce --disable-ospfapi --disable-ospfclient --disable-rtadv --disable-irdp --enable-pimd --enable-tcp-zebra --enable-ipv6 --enable-vtysh

+ 11 - 0
pimd/savannah-git-clone.sh

@@ -11,6 +11,17 @@
 # Commit changes:                git commit -a
 # Send changes:                  git push --all
 #
+# Recipe to re-sync with Quagga repository:
+#  git clone ssh://evertonm@git.sv.gnu.org/srv/git/qpimd.git quagga
+#  cd quagga
+#  git checkout master
+#  git pull git://code.quagga.net/quagga.git master
+#  git checkout -b pim origin/pim
+#  git rebase master pim
+#  # Test, then push back into Savannah repository:
+#  git push origin :pim ;# delete remote branch pim
+#  git push --all
+#
 # $QuaggaId: $Format:%an, %ai, %h$ $
 
 git clone ssh://evertonm@git.sv.gnu.org/srv/git/qpimd.git quagga