]> git.puffer.fish Git - mirror/frr.git/commitdiff
ripngd: compiler warnings cleanup
authorStephen Hemminger <shemminger@vyatta.com>
Thu, 10 Dec 2009 12:52:33 +0000 (15:52 +0300)
committerDenis Ovsienko <infrastation@yandex.ru>
Thu, 10 Dec 2009 12:52:33 +0000 (15:52 +0300)
* ripngd/ripng_interface.c
  * ripng_check_max_mtu(): unused, sayonara
  * ripng_interface_down(): cast flag arguments to logging function
  * ripng_interface_add(): idem
  * ripng_interface_delete(): idem
* ripngd/ripngd.c
  * ripng_recv_packet(): avoid aliasing warning dereferencing pointer

ripngd/ripng_interface.c
ripngd/ripngd.c

index c23d32a20aae8ef813e017917c2bb154a966af10..6718fff216d82999cee1a67382f1cac93f90033c 100644 (file)
@@ -157,22 +157,6 @@ ripng_if_ipv6_lladdress_check (struct interface *ifp)
   return count;
 }
 
-/* Check max mtu size. */
-static unsigned int
-ripng_check_max_mtu (void)
-{
-  struct listnode *node;
-  struct interface *ifp;
-  unsigned int mtu;
-
-  mtu = 0;
-  for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
-    if (mtu < ifp->mtu6)
-      mtu = ifp->mtu6;
-
-  return mtu;
-}
-
 static int
 ripng_if_down (struct interface *ifp)
 {
@@ -277,8 +261,9 @@ ripng_interface_down (int command, struct zclient *zclient,
   ripng_if_down (ifp);
 
   if (IS_RIPNG_DEBUG_ZEBRA)
-    zlog_debug ("interface down %s index %d flags %lld metric %d mtu %d",
-              ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu6);
+    zlog_debug ("interface down %s index %d flags %#llx metric %d mtu %d",
+               ifp->name, ifp->ifindex,
+               (unsigned long long) ifp->flags, ifp->metric, ifp->mtu6);
 
   return 0;
 }
@@ -292,8 +277,9 @@ ripng_interface_add (int command, struct zclient *zclient, zebra_size_t length)
   ifp = zebra_interface_add_read (zclient->ibuf);
 
   if (IS_RIPNG_DEBUG_ZEBRA)
-    zlog_debug ("RIPng interface add %s index %d flags %lld metric %d mtu %d",
-              ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu6);
+    zlog_debug ("RIPng interface add %s index %d flags %#llx metric %d mtu %d",
+               ifp->name, ifp->ifindex, (unsigned long long) ifp->flags,
+               ifp->metric, ifp->mtu6);
 
   /* Check is this interface is RIP enabled or not.*/
   ripng_enable_apply (ifp);
@@ -325,8 +311,9 @@ ripng_interface_delete (int command, struct zclient *zclient,
     ripng_if_down(ifp);
   }
 
-  zlog_info("interface delete %s index %d flags %lld metric %d mtu %d",
-            ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu6);
+  zlog_info("interface delete %s index %d flags %#llx metric %d mtu %d",
+            ifp->name, ifp->ifindex, (unsigned long long) ifp->flags,
+           ifp->metric, ifp->mtu6);
 
   /* To support pseudo interface do not free interface structure.  */
   /* if_delete(ifp); */
index 9deac032d5e236dfb8182843a0373228b5b09a80..6e32d83c5d0a7df138a89977d67383effb21dff8 100644 (file)
@@ -272,7 +272,10 @@ ripng_recv_packet (int sock, u_char *buf, int bufsize,
       /* Incoming packet's multicast hop limit. */
       if (cmsgptr->cmsg_level == IPPROTO_IPV6 &&
          cmsgptr->cmsg_type == IPV6_HOPLIMIT)
-       *hoplimit = *((int *) CMSG_DATA (cmsgptr));
+       {
+         int *phoplimit = (int *) CMSG_DATA (cmsgptr);
+         *hoplimit = *phoplimit;
+       }
     }
 
   /* Hoplimit check shold be done when destination address is