summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2016-07-12 21:13:24 +0000
committerQuentin Young <qlyoung@cumulusnetworks.com>2016-07-12 21:13:24 +0000
commit63fa10b5958ff47e2571eefeb360a5e8db48ac22 (patch)
tree9c2910c58582af12bb11c5846f0437679071d4b4
parent60cd0356857757bd096cfb0607903ff090990ba9 (diff)
bgpd: Disallow ebgp-multihop on swpX peers
Disallow setting ebgp-multihop on peers directly connected via an interface. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
-rw-r--r--bgpd/bgp_vty.c6
-rw-r--r--bgpd/bgpd.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 5dff63e8c2..b1a3116be3 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -304,6 +304,9 @@ bgp_vty_return (struct vty *vty, int ret)
case BGP_ERR_INVALID_FOR_DYNAMIC_PEER:
str = "Operation not allowed on a dynamic neighbor";
break;
+ case BGP_ERR_INVALID_FOR_DIRECT_PEER:
+ str = "Operation not allowed on a directly connected neighbor";
+ break;
}
if (str)
{
@@ -4434,6 +4437,9 @@ peer_ebgp_multihop_set_vty (struct vty *vty, const char *ip_str,
if (! peer)
return CMD_WARNING;
+ if (peer->conf_if)
+ return bgp_vty_return (vty, BGP_ERR_INVALID_FOR_DIRECT_PEER);
+
if (! ttl_str)
ttl = MAXTTL;
else
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h
index 0c6aa6b21a..2acdaed331 100644
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
@@ -1120,6 +1120,7 @@ enum bgp_clear_type
#define BGP_ERR_DYNAMIC_NEIGHBORS_RANGE_NOT_FOUND -31
#define BGP_ERR_INVALID_FOR_DYNAMIC_PEER -32
#define BGP_ERR_MAX -33
+#define BGP_ERR_INVALID_FOR_DIRECT_PEER -34
/*
* Enumeration of different policy kinds a peer can be configured with.