ospfd: respect max-metric over configured cost for summary LSAs

ISSUE

When max-metric router-lsa administrative is invoked on an ABR created with...
area <area> range <addr/mask>
the summary LSAs are sent out with 65535 (max-metric) added to the normal cost.

When max-metric router-lsa administrative is invoked on an ABR created with...
area <area> range <addr/mask> cost <cost>
the summary LSAs are sent out with <cost> (the max-metric is ignored).  This
second behavior effectively incapacitates the max-metric function.

PATCH

This patch evaluates the state of the router and if it's isolated as a stub
router (rfc3137) via `max-metric router-lsa`, we unconditionally uses the
value of 0xff0000 when advertising summary LSAs.

Signed-off-by: JR Rivers <jrrivers@cumulusnetworks.com>
Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Reviewed-by: Ayan Banerjee <ayan@cumulusnetworks.com>
Reviewed-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/ospfd/ospfd.h b/ospfd/ospfd.h
index 7a56d16..bf825d1 100644
--- a/ospfd/ospfd.h
+++ b/ospfd/ospfd.h
@@ -196,6 +196,8 @@
   unsigned int stub_router_shutdown_time;	/* seconds */
 #define OSPF_STUB_ROUTER_UNCONFIGURED	  0
 
+#define OSPF_STUB_MAX_METRIC_SUMMARY_COST	0x00ff0000
+
   /* SPF parameters */
   unsigned int spf_delay;		/* SPF delay time. */
   unsigned int spf_holdtime;		/* SPF hold time. */