From: Vipin Kumar <[email protected]>
Signed-off-by: Vipin Kumar <[email protected]>
Reviewed-by: Dinesh Dutt <[email protected]>
Reviewed-by: Daniel Walton <[email protected]>
---
bgpd/bgp_aspath.c | 4 +++-
bgpd/bgp_aspath.h | 4 ++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c
index 8d77ce2..3c8436e 100644
--- a/bgpd/bgp_aspath.c
+++ b/bgpd/bgp_aspath.c
@@ -1159,7 +1159,9 @@ aspath_private_as_check (struct aspath *aspath)
for (i = 0; i < seg->length; i++)
{
if ( (seg->as[i] < BGP_PRIVATE_AS_MIN)
- || (seg->as[i] > BGP_PRIVATE_AS_MAX) )
+ || (seg->as[i] > BGP_PRIVATE_AS_MAX &&
+ seg->as[i] < BGP_PRIVATE_AS4_MIN)
+ || (seg->as[i] > BGP_PRIVATE_AS4_MAX))
return 0;
}
seg = seg->next;
diff --git a/bgpd/bgp_aspath.h b/bgpd/bgp_aspath.h
index 1311f8a..15b09f5 100644
--- a/bgpd/bgp_aspath.h
+++ b/bgpd/bgp_aspath.h
@@ -31,6 +31,10 @@ Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA
#define BGP_PRIVATE_AS_MIN 64512U
#define BGP_PRIVATE_AS_MAX 65535U
+/* Private 4 byte AS range defined in RFC6996. */
+#define BGP_PRIVATE_AS4_MIN 4200000000U
+#define BGP_PRIVATE_AS4_MAX 4294967294U
+
/* we leave BGP_AS_MAX as the 16bit AS MAX number. */
#define BGP_AS_MAX 65535U
#define BGP_AS4_MAX 4294967295U
--
1.9.1
_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev