]> git.proxmox.com Git - mirror_frr.git/commitdiff
* rt_netlink.c: Remove unused netlink-addr socket declaration.
authorhasso <hasso>
Sun, 12 Jun 2005 11:28:18 +0000 (11:28 +0000)
committerhasso <hasso>
Sun, 12 Jun 2005 11:28:18 +0000 (11:28 +0000)
* rt_netlink.c (netlink_parse_info): Fix debug messages - nlmsg_pid is
  unsigned and one zlog call had swapped arguments.
* rt_netlink.c (netlink_route_multipath): Fix compile with disabled
  IPv6 support.

[backport candidate] - with stuff commited to rt_netlink.c before to
fix logging in netlink_route_multipath().

zebra/ChangeLog
zebra/rt_netlink.c

index dbeac4d5e168bcd17d29cbf77d42d33619b51ec4..843f12eb8b05c588ca6e55dd7b27fef84a126b13 100644 (file)
@@ -1,3 +1,11 @@
+2005-06-12 Hasso Tepper <hasso at quagga.net>
+
+       * rt_netlink.c: Remove netlink-addr socket declaration, it's not used.
+       * rt_netlink.c (netlink_parse_info): Fix debug messages - nlmsg_pid is
+         unsigned and one zlog call had swapped arguments.
+       * rt_netlink.c (netlink_route_multipath): Fix compile with disabled
+         IPv6 support.
+
 2005-05-31 Paul Jakma <paul.jakma@sun.com>
 
        * zserv.c: (zsend_route_multipath) Fix bug if route is sent
index 22908730c54c0dca13cf60b707e90bc04d32a80a..3f22a6cc03e33ac7dda439becf2940fdcf08096e 100644 (file)
@@ -49,8 +49,7 @@ struct nlsock
   struct sockaddr_nl snl;
   const char *name;
 } netlink      = { -1, 0, {0}, "netlink-listen"},     /* kernel messages */
-  netlink_cmd  = { -1, 0, {0}, "netlink-cmd"},        /* command channel */
-  netlink_addr = { -1, 0, {0}, "netlink-addr"};       /* address channel */
+  netlink_cmd  = { -1, 0, {0}, "netlink-cmd"};        /* command channel */
 
 struct message nlmsg_str[] = {
   {RTM_NEWROUTE, "RTM_NEWROUTE"},
@@ -391,7 +390,7 @@ netlink_parse_info (int (*filter) (struct sockaddr_nl *, struct nlmsghdr *),
                 {
                   if (IS_ZEBRA_DEBUG_KERNEL)
                     {
-                      zlog_debug ("%s: %s ACK: type=%s(%u), seq=%u, pid=%d",
+                      zlog_debug ("%s: %s ACK: type=%s(%u), seq=%u, pid=%u",
                                  __FUNCTION__, nl->name,
                                  lookup (nlmsg_str, err->msg.nlmsg_type),
                                  err->msg.nlmsg_type, err->msg.nlmsg_seq,
@@ -425,7 +424,7 @@ netlink_parse_info (int (*filter) (struct sockaddr_nl *, struct nlmsghdr *),
                   loglvl = LOG_DEBUG;
 
                 zlog (NULL, loglvl, "%s error: %s, type=%s(%u), "
-                      "seq=%u, pid=%d",
+                      "seq=%u, pid=%u",
                       nl->name, safe_strerror (-errnum),
                       lookup (nlmsg_str, msg_type),
                       msg_type, err->msg.nlmsg_seq, err->msg.nlmsg_pid);
@@ -439,7 +438,7 @@ netlink_parse_info (int (*filter) (struct sockaddr_nl *, struct nlmsghdr *),
 
           /* OK we got netlink message. */
           if (IS_ZEBRA_DEBUG_KERNEL)
-            zlog_debug ("netlink_parse_info: %s type %s(%u), seq=%u, pid=%d",
+            zlog_debug ("netlink_parse_info: %s type %s(%u), seq=%u, pid=%u",
                        nl->name,
                        lookup (nlmsg_str, h->nlmsg_type), h->nlmsg_type,
                        h->nlmsg_seq, h->nlmsg_pid);
@@ -449,7 +448,7 @@ netlink_parse_info (int (*filter) (struct sockaddr_nl *, struct nlmsghdr *),
             {
               if (IS_ZEBRA_DEBUG_KERNEL)
                 zlog_debug ("netlink_parse_info: %s packet comes from %s",
-                           nl->name, netlink_cmd.name);
+                            netlink_cmd.name, nl->name);
               continue;
             }
 
@@ -1470,9 +1469,14 @@ netlink_route_multipath (int cmd, struct prefix *p, struct rib *rib,
                       zlog_debug
                         ("netlink_route_multipath() (recursive, 1 hop): "
                          "%s %s/%d, type %s", lookup (nlmsg_str, cmd),
+#ifdef HAVE_IPV6
                         (family == AF_INET) ? inet_ntoa (p->u.prefix4) :
-                        inet6_ntoa (p->u.prefix6), p->prefixlen,
-                         nexthop_types_desc[nexthop->rtype]);
+                        inet6_ntoa (p->u.prefix6),
+#else
+                        inet_ntoa (p->u.prefix4),
+#endif /* HAVE_IPV6 */
+                        
+                        p->prefixlen, nexthop_types_desc[nexthop->rtype]);
                     }
 
                   if (nexthop->rtype == NEXTHOP_TYPE_IPV4
@@ -1524,9 +1528,13 @@ netlink_route_multipath (int cmd, struct prefix *p, struct rib *rib,
                       zlog_debug
                         ("netlink_route_multipath() (single hop): "
                          "%s %s/%d, type %s", lookup (nlmsg_str, cmd),
+#ifdef HAVE_IPV6
                         (family == AF_INET) ? inet_ntoa (p->u.prefix4) :
-                        inet6_ntoa (p->u.prefix6), p->prefixlen,
-                        nexthop_types_desc[nexthop->type]);
+                        inet6_ntoa (p->u.prefix6),
+#else
+                        inet_ntoa (p->u.prefix4),
+#endif /* HAVE_IPV6 */
+                        p->prefixlen, nexthop_types_desc[nexthop->type]);
                     }
 
                   if (nexthop->type == NEXTHOP_TYPE_IPV4
@@ -1611,8 +1619,13 @@ netlink_route_multipath (int cmd, struct prefix *p, struct rib *rib,
                     {
                       zlog_debug ("netlink_route_multipath() "
                          "(recursive, multihop): %s %s/%d type %s",
-                         lookup (nlmsg_str, cmd), (family == AF_INET) ? 
-                        inet_ntoa (p->u.prefix4) : inet6_ntoa (p->u.prefix6),
+                        lookup (nlmsg_str, cmd),
+#ifdef HAVE_IPV6
+                        (family == AF_INET) ? inet_ntoa (p->u.prefix4) :
+                        inet6_ntoa (p->u.prefix6),
+#else
+                        inet_ntoa (p->u.prefix4),
+#endif /* HAVE_IPV6 */
                          p->prefixlen, nexthop_types_desc[nexthop->rtype]);
                     }
                   if (nexthop->rtype == NEXTHOP_TYPE_IPV4
@@ -1668,9 +1681,13 @@ netlink_route_multipath (int cmd, struct prefix *p, struct rib *rib,
                     {
                       zlog_debug ("netlink_route_multipath() (multihop): "
                          "%s %s/%d, type %s", lookup (nlmsg_str, cmd),
+#ifdef HAVE_IPV6
                         (family == AF_INET) ? inet_ntoa (p->u.prefix4) :
-                        inet6_ntoa (p->u.prefix6), p->prefixlen,
-                         nexthop_types_desc[nexthop->type]);
+                        inet6_ntoa (p->u.prefix6),
+#else
+                        inet_ntoa (p->u.prefix4),
+#endif /* HAVE_IPV6 */
+                        p->prefixlen, nexthop_types_desc[nexthop->type]);
                     }
                   if (nexthop->type == NEXTHOP_TYPE_IPV4
                       || nexthop->type == NEXTHOP_TYPE_IPV4_IFINDEX)