]> git.puffer.fish Git - mirror/frr.git/commitdiff
2004-12-16 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
authorajs <ajs>
Thu, 16 Dec 2004 16:18:13 +0000 (16:18 +0000)
committerajs <ajs>
Thu, 16 Dec 2004 16:18:13 +0000 (16:18 +0000)
* ripng_nexthop.c: Replace NEXTHOP_OUT macro with NEXTHOP_OUT_PTR,
  since it's not really OK to take the address of a ternary expression.
  (_ripng_rte_cmp,ripng_rte_send) Use new NEXTHOP_OUT_PTR macro
  instead of NEXTHOP_OUT.

ripngd/ChangeLog
ripngd/ripng_nexthop.c

index 97a89239764d6c4146987059b55692f87489d71f..7f85cc474d4fced0425031e11ffeb9a9a60c4ce1 100644 (file)
@@ -1,3 +1,10 @@
+2004-12-16 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
+
+       * ripng_nexthop.c: Replace NEXTHOP_OUT macro with NEXTHOP_OUT_PTR,
+         since it's not really OK to take the address of a ternary expression.
+         (_ripng_rte_cmp,ripng_rte_send) Use new NEXTHOP_OUT_PTR macro
+         instead of NEXTHOP_OUT.
+
 2004-12-08 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
 
        * *.c: Change level of debug messages to LOG_DEBUG.
index e946dc9127f5fd55e77b86c1212285981190d0d9..1c1829d49fc6dc229e76449f843dafbf1196643e 100644 (file)
@@ -54,11 +54,11 @@ void _ripng_rte_del(struct ripng_rte_data *A);
 int _ripng_rte_cmp(struct ripng_rte_data *A, struct ripng_rte_data *B);
 
 #define METRIC_OUT(a) \
-    (a->rinfo ?  a->rinfo->metric_out : a->aggregate->metric_out)
-#define NEXTHOP_OUT(a) \
-    (a->rinfo ?  a->rinfo->nexthop_out : a->aggregate->nexthop_out)
+    ((a)->rinfo ?  (a)->rinfo->metric_out : (a)->aggregate->metric_out)
+#define NEXTHOP_OUT_PTR(a) \
+    ((a)->rinfo ?  &((a)->rinfo->nexthop_out) : &((a)->aggregate->nexthop_out))
 #define TAG_OUT(a) \
-    (a->rinfo ?  a->rinfo->tag_out : a->aggregate->tag_out)
+    ((a)->rinfo ?  (a)->rinfo->tag_out : (a)->aggregate->tag_out)
 
 struct list *
 ripng_rte_new(void) {
@@ -89,7 +89,7 @@ _ripng_rte_del(struct ripng_rte_data *A) {
  */
 int
 _ripng_rte_cmp(struct ripng_rte_data *A, struct ripng_rte_data *B) {
-  return addr6_cmp(&NEXTHOP_OUT(A), &NEXTHOP_OUT(B));
+  return addr6_cmp(NEXTHOP_OUT_PTR(A), NEXTHOP_OUT_PTR(B));
 }
 
 /* Add routing table entry */
@@ -157,7 +157,7 @@ ripng_rte_send(struct list *ripng_rte_list, struct interface *ifp,
   LIST_LOOP(ripng_rte_list, data, nn) {
 
     /* (2.1) Next hop support */
-    if (!IPV6_ADDR_SAME(&last_nexthop, &NEXTHOP_OUT(data))) {
+    if (!IPV6_ADDR_SAME(&last_nexthop, NEXTHOP_OUT_PTR(data))) {
 
       /* A nexthop entry should be at least followed by 1 RTE */
       if (num == (rtemax-1)) {
@@ -176,10 +176,10 @@ ripng_rte_send(struct list *ripng_rte_list, struct interface *ifp,
       /* If the received next hop address is not a link-local address,
        * it should be treated as 0:0:0:0:0:0:0:0.
        */
-      if (!IN6_IS_ADDR_LINKLOCAL(&NEXTHOP_OUT(data)))
+      if (!IN6_IS_ADDR_LINKLOCAL(NEXTHOP_OUT_PTR(data)))
         last_nexthop = myself_nexthop;
       else
-       last_nexthop = NEXTHOP_OUT(data);
+       last_nexthop = *NEXTHOP_OUT_PTR(data);
 
       num = ripng_write_rte(num, s, NULL, &last_nexthop, 0, RIPNG_METRIC_NEXTHOP);
     } else {