summaryrefslogtreecommitdiffstats
path: root/bgpd
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_aspath.c6
-rw-r--r--bgpd/bgp_clist.c14
-rw-r--r--bgpd/bgp_debug.c2
-rw-r--r--bgpd/bgp_dump.c2
-rw-r--r--bgpd/bgp_filter.c14
-rw-r--r--bgpd/bgp_network.c18
-rw-r--r--bgpd/bgp_nexthop.c6
-rw-r--r--bgpd/bgp_open.c2
-rw-r--r--bgpd/bgp_packet.c2
-rw-r--r--bgpd/bgp_route.c63
-rw-r--r--bgpd/bgp_route.h21
-rw-r--r--bgpd/bgp_snmp.c2
-rw-r--r--bgpd/bgp_table.c10
-rw-r--r--bgpd/bgp_vty.c14
-rw-r--r--bgpd/bgp_zebra.c4
-rw-r--r--bgpd/bgpd.c91
-rw-r--r--bgpd/bgpd.h66
17 files changed, 127 insertions, 210 deletions
diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c
index 006fc917..242bd8ee 100644
--- a/bgpd/bgp_aspath.c
+++ b/bgpd/bgp_aspath.c
@@ -322,11 +322,7 @@ assegment_normalise (struct assegment *head)
static struct aspath *
aspath_new (void)
{
- struct aspath *aspath;
-
- aspath = XMALLOC (MTYPE_AS_PATH, sizeof (struct aspath));
- memset (aspath, 0, sizeof (struct aspath));
- return aspath;
+ return XCALLOC (MTYPE_AS_PATH, sizeof (struct aspath));
}
/* Free AS path structure. */
diff --git a/bgpd/bgp_clist.c b/bgpd/bgp_clist.c
index f75fc55b..6bf3b64a 100644
--- a/bgpd/bgp_clist.c
+++ b/bgpd/bgp_clist.c
@@ -51,11 +51,7 @@ community_list_master_lookup (struct community_list_handler *ch, int master)
static struct community_entry *
community_entry_new ()
{
- struct community_entry *new;
-
- new = XMALLOC (MTYPE_COMMUNITY_LIST_ENTRY, sizeof (struct community_entry));
- memset (new, 0, sizeof (struct community_entry));
- return new;
+ return XCALLOC (MTYPE_COMMUNITY_LIST_ENTRY, sizeof (struct community_entry));
}
/* Free community list entry. */
@@ -92,11 +88,7 @@ community_entry_free (struct community_entry *entry)
static struct community_list *
community_list_new ()
{
- struct community_list *new;
-
- new = XMALLOC (MTYPE_COMMUNITY_LIST, sizeof (struct community_list));
- memset (new, 0, sizeof (struct community_list));
- return new;
+ return XCALLOC (MTYPE_COMMUNITY_LIST, sizeof (struct community_list));
}
/* Free community-list. */
@@ -836,6 +828,7 @@ community_list_init (void)
return ch;
}
+#if 0
/* Terminate community-list. */
static void
community_list_terminate (struct community_list_handler *ch)
@@ -857,3 +850,4 @@ community_list_terminate (struct community_list_handler *ch)
XFREE (MTYPE_COMMUNITY_LIST_HANDLER, ch);
}
+#endif
diff --git a/bgpd/bgp_debug.c b/bgpd/bgp_debug.c
index 757b9cf8..b7280d93 100644
--- a/bgpd/bgp_debug.c
+++ b/bgpd/bgp_debug.c
@@ -856,7 +856,7 @@ bgp_config_write_debug (struct vty *vty)
return write;
}
-struct cmd_node debug_node =
+static struct cmd_node debug_node =
{
DEBUG_NODE,
"",
diff --git a/bgpd/bgp_dump.c b/bgpd/bgp_dump.c
index e815ea3c..53dea805 100644
--- a/bgpd/bgp_dump.c
+++ b/bgpd/bgp_dump.c
@@ -773,7 +773,7 @@ DEFUN (no_dump_bgp_routes,
}
/* BGP node structure. */
-struct cmd_node bgp_dump_node =
+static struct cmd_node bgp_dump_node =
{
DUMP_NODE,
"",
diff --git a/bgpd/bgp_filter.c b/bgpd/bgp_filter.c
index ab7f0703..e4cf91af 100644
--- a/bgpd/bgp_filter.c
+++ b/bgpd/bgp_filter.c
@@ -99,11 +99,7 @@ static struct as_list_master as_list_master =
static struct as_filter *
as_filter_new ()
{
- struct as_filter *new;
-
- new = XMALLOC (MTYPE_AS_FILTER, sizeof (struct as_filter));
- memset (new, 0, sizeof (struct as_filter));
- return new;
+ return XCALLOC (MTYPE_AS_FILTER, sizeof (struct as_filter));
}
/* Free allocated AS filter. */
@@ -179,11 +175,7 @@ as_list_lookup (const char *name)
static struct as_list *
as_list_new ()
{
- struct as_list *new;
-
- new = XMALLOC (MTYPE_AS_LIST, sizeof (struct as_list));
- memset (new, 0, sizeof (struct as_list));
- return new;
+ return XCALLOC (MTYPE_AS_LIST, sizeof (struct as_list));
}
static void
@@ -679,7 +671,7 @@ config_write_as_list (struct vty *vty)
return write;
}
-struct cmd_node as_list_node =
+static struct cmd_node as_list_node =
{
AS_LIST_NODE,
"",
diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c
index 5dbd4872..87f7f7b6 100644
--- a/bgpd/bgp_network.c
+++ b/bgpd/bgp_network.c
@@ -92,12 +92,6 @@ bgp_md5_set (struct peer *peer)
struct listnode *node;
int fret = 0, ret;
int *socket;
-
- if ( bgpd_privs.change (ZPRIVS_RAISE) )
- {
- zlog_err ("%s: could not raise privs", __func__);
- return -1;
- }
/* Just set the password on the listen socket(s). Outbound connections
* are taken care of in bgp_connect() below.
@@ -108,9 +102,6 @@ bgp_md5_set (struct peer *peer)
if (ret < 0)
fret = ret;
}
- if (bgpd_privs.change (ZPRIVS_LOWER) )
- zlog_err ("%s: could not lower privs", __func__);
-
return fret;
}
@@ -412,6 +403,15 @@ bgp_socket (struct bgp *bgp, unsigned short port, char *address)
setsockopt_ipv4_tos (sock, IPTOS_PREC_INTERNETCONTROL);
#endif
+#ifdef IPV6_V6ONLY
+ /* Want only IPV6 on ipv6 socket (not mapped addresses) */
+ if (ainfo->ai_family == AF_INET6) {
+ int on = 1;
+ setsockopt (sock, IPPROTO_IPV6, IPV6_V6ONLY,
+ (void *) &on, sizeof (on));
+ }
+#endif
+
if (bgpd_privs.change (ZPRIVS_RAISE) )
zlog_err ("bgp_socket: could not raise privs");
diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c
index 22e48db0..d0d6aa18 100644
--- a/bgpd/bgp_nexthop.c
+++ b/bgpd/bgp_nexthop.c
@@ -98,11 +98,7 @@ bnc_nexthop_free (struct bgp_nexthop_cache *bnc)
static struct bgp_nexthop_cache *
bnc_new ()
{
- struct bgp_nexthop_cache *new;
-
- new = XMALLOC (MTYPE_BGP_NEXTHOP_CACHE, sizeof (struct bgp_nexthop_cache));
- memset (new, 0, sizeof (struct bgp_nexthop_cache));
- return new;
+ return XCALLOC (MTYPE_BGP_NEXTHOP_CACHE, sizeof (struct bgp_nexthop_cache));
}
static void
diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c
index 84d8191e..9ecfb16a 100644
--- a/bgpd/bgp_open.c
+++ b/bgpd/bgp_open.c
@@ -526,7 +526,7 @@ bgp_capability_parse (struct peer *peer, size_t length, u_char **error)
if (caphdr.length < cap_minsizes[caphdr.code])
{
zlog_info ("%s %s Capability length error: got %u,"
- " expected at least %u",
+ " expected at least %zu",
peer->host,
LOOKUP (capcode_str, caphdr.code),
caphdr.length, cap_minsizes[caphdr.code]);
diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
index 1422bad6..862f3413 100644
--- a/bgpd/bgp_packet.c
+++ b/bgpd/bgp_packet.c
@@ -920,6 +920,7 @@ bgp_notify_send (struct peer *peer, u_char code, u_char sub_code)
bgp_notify_send_with_data (peer, code, sub_code, NULL, 0);
}
+#if 0
static const char *
afi2str (afi_t afi)
{
@@ -943,6 +944,7 @@ safi2str (safi_t safi)
else
return "Unknown SAFI";
}
+#endif
/* Send route refresh message to the peer. */
void
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 50407e4e..ff4e0ab4 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -129,16 +129,11 @@ bgp_info_extra_get (struct bgp_info *ri)
static struct bgp_info *
bgp_info_new ()
{
- struct bgp_info *new;
-
- new = XMALLOC (MTYPE_BGP_ROUTE, sizeof (struct bgp_info));
- memset (new, 0, sizeof (struct bgp_info));
-
- return new;
+ return XCALLOC (MTYPE_BGP_ROUTE, sizeof (struct bgp_info));
}
/* Free bgp route information. */
-static void
+void
bgp_info_free (struct bgp_info *binfo)
{
if (binfo->attr)
@@ -151,39 +146,6 @@ bgp_info_free (struct bgp_info *binfo)
XFREE (MTYPE_BGP_ROUTE, binfo);
}
-struct bgp_info *
-bgp_info_lock (struct bgp_info *binfo)
-{
- binfo->lock++;
- return binfo;
-}
-
-struct bgp_info *
-bgp_info_unlock (struct bgp_info *binfo)
-{
- assert (binfo && binfo->lock > 0);
- binfo->lock--;
-
- if (binfo->lock == 0)
- {
-#if 0
- zlog_debug ("%s: unlocked and freeing", __func__);
- zlog_backtrace (LOG_DEBUG);
-#endif
- bgp_info_free (binfo);
- return NULL;
- }
-
-#if 0
- if (binfo->lock == 1)
- {
- zlog_debug ("%s: unlocked to 1", __func__);
- zlog_backtrace (LOG_DEBUG);
- }
-#endif
-
- return binfo;
-}
void
bgp_info_add (struct bgp_node *rn, struct bgp_info *ri)
@@ -2678,10 +2640,10 @@ bgp_clear_node_complete (struct work_queue *wq)
{
struct peer *peer = wq->spec.data;
- peer_unlock (peer); /* bgp_clear_node_complete */
-
/* Tickle FSM to start moving again */
BGP_EVENT_ADD (peer, Clearing_Completed);
+
+ peer_unlock (peer); /* bgp_clear_node_complete */
}
static void
@@ -3121,10 +3083,7 @@ bgp_nlri_sanity_check (struct peer *peer, int afi, u_char *pnt,
static struct bgp_static *
bgp_static_new ()
{
- struct bgp_static *new;
- new = XMALLOC (MTYPE_BGP_STATIC, sizeof (struct bgp_static));
- memset (new, 0, sizeof (struct bgp_static));
- return new;
+ return XCALLOC (MTYPE_BGP_STATIC, sizeof (struct bgp_static));
}
static void
@@ -4509,10 +4468,7 @@ struct bgp_aggregate
static struct bgp_aggregate *
bgp_aggregate_new ()
{
- struct bgp_aggregate *new;
- new = XMALLOC (MTYPE_BGP_AGGREGATE, sizeof (struct bgp_aggregate));
- memset (new, 0, sizeof (struct bgp_aggregate));
- return new;
+ return XCALLOC (MTYPE_BGP_AGGREGATE, sizeof (struct bgp_aggregate));
}
static void
@@ -10859,10 +10815,7 @@ struct bgp_distance
static struct bgp_distance *
bgp_distance_new ()
{
- struct bgp_distance *new;
- new = XMALLOC (MTYPE_BGP_DISTANCE, sizeof (struct bgp_distance));
- memset (new, 0, sizeof (struct bgp_distance));
- return new;
+ return XCALLOC (MTYPE_BGP_DISTANCE, sizeof (struct bgp_distance));
}
static void
@@ -10957,6 +10910,7 @@ bgp_distance_unset (struct vty *vty, const char *distance_str,
return CMD_SUCCESS;
}
+#if 0
static void
bgp_distance_reset ()
{
@@ -10973,6 +10927,7 @@ bgp_distance_reset ()
bgp_unlock_node (rn);
}
}
+#endif
/* Apply BGP information to distance method. */
u_char
diff --git a/bgpd/bgp_route.h b/bgpd/bgp_route.h
index e5987972..3e65bb10 100644
--- a/bgpd/bgp_route.h
+++ b/bgpd/bgp_route.h
@@ -174,8 +174,25 @@ extern void bgp_clear_route_all (struct peer *);
extern void bgp_clear_adj_in (struct peer *, afi_t, safi_t);
extern void bgp_clear_stale_route (struct peer *, afi_t, safi_t);
-extern struct bgp_info *bgp_info_lock (struct bgp_info *);
-extern struct bgp_info *bgp_info_unlock (struct bgp_info *);
+extern void bgp_info_free (struct bgp_info *);
+
+static inline struct bgp_info *
+bgp_info_lock (struct bgp_info *binfo)
+{
+ binfo->lock++;
+ return binfo;
+}
+
+static inline void
+bgp_info_unlock (struct bgp_info *binfo)
+{
+ assert (binfo && binfo->lock > 0);
+ binfo->lock--;
+
+ if (binfo->lock == 0)
+ bgp_info_free (binfo);
+}
+
extern void bgp_info_add (struct bgp_node *rn, struct bgp_info *ri);
extern void bgp_info_delete (struct bgp_node *rn, struct bgp_info *ri);
extern struct bgp_info_extra *bgp_info_extra_get (struct bgp_info *);
diff --git a/bgpd/bgp_snmp.c b/bgpd/bgp_snmp.c
index 576e3e09..09199017 100644
--- a/bgpd/bgp_snmp.c
+++ b/bgpd/bgp_snmp.c
@@ -383,7 +383,7 @@ write_bgpPeerTable (int action, u_char *var_val,
struct in_addr addr;
struct peer *peer;
long intval;
- int bigsize = SNMP_MAX_LEN;
+ size_t bigsize = SNMP_MAX_LEN;
if (var_val_type != ASN_INTEGER)
{
diff --git a/bgpd/bgp_table.c b/bgpd/bgp_table.c
index c2120252..15630a24 100644
--- a/bgpd/bgp_table.c
+++ b/bgpd/bgp_table.c
@@ -36,8 +36,7 @@ bgp_table_init (afi_t afi, safi_t safi)
{
struct bgp_table *rt;
- rt = XMALLOC (MTYPE_BGP_TABLE, sizeof (struct bgp_table));
- memset (rt, 0, sizeof (struct bgp_table));
+ rt = XCALLOC (MTYPE_BGP_TABLE, sizeof (struct bgp_table));
rt->type = BGP_TABLE_MAIN;
rt->afi = afi;
@@ -56,11 +55,7 @@ bgp_table_finish (struct bgp_table **rt)
static struct bgp_node *
bgp_node_create ()
{
- struct bgp_node *rn;
-
- rn = (struct bgp_node *) XMALLOC (MTYPE_BGP_NODE, sizeof (struct bgp_node));
- memset (rn, 0, sizeof (struct bgp_node));
- return rn;
+ return XCALLOC (MTYPE_BGP_NODE, sizeof (struct bgp_node));
}
/* Allocate new route node with prefix set. */
@@ -369,6 +364,7 @@ bgp_node_delete (struct bgp_node *node)
assert (node->lock == 0);
assert (node->info == NULL);
+ assert (node->table->count > 0);
if (node->l_left && node->l_right)
return;
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 380dbdaf..2e9758a9 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -8775,42 +8775,42 @@ bgp_config_write_redistribute (struct vty *vty, struct bgp *bgp, afi_t afi,
}
/* BGP node structure. */
-struct cmd_node bgp_node =
+static struct cmd_node bgp_node =
{
BGP_NODE,
"%s(config-router)# ",
1,
};
-struct cmd_node bgp_ipv4_unicast_node =
+static struct cmd_node bgp_ipv4_unicast_node =
{
BGP_IPV4_NODE,
"%s(config-router-af)# ",
1,
};
-struct cmd_node bgp_ipv4_multicast_node =
+static struct cmd_node bgp_ipv4_multicast_node =
{
BGP_IPV4M_NODE,
"%s(config-router-af)# ",
1,
};
-struct cmd_node bgp_ipv6_unicast_node =
+static struct cmd_node bgp_ipv6_unicast_node =
{
BGP_IPV6_NODE,
"%s(config-router-af)# ",
1,
};
-struct cmd_node bgp_ipv6_multicast_node =
+static struct cmd_node bgp_ipv6_multicast_node =
{
BGP_IPV6M_NODE,
"%s(config-router-af)# ",
1,
};
-struct cmd_node bgp_vpnv4_node =
+static struct cmd_node bgp_vpnv4_node =
{
BGP_VPNV4_NODE,
"%s(config-router-af)# ",
@@ -10734,7 +10734,7 @@ community_list_config_write (struct vty *vty)
return write;
}
-struct cmd_node community_list_node =
+static struct cmd_node community_list_node =
{
COMMUNITY_LIST_NODE,
"",
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index 0b6ab45a..943b1777 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -639,7 +639,7 @@ bgp_nexthop_set (union sockunion *local, union sockunion *remote,
return ret;
}
-#ifdef HAVE_IPV6
+#if 0
static unsigned int
bgp_ifindex_by_nexthop (struct in6_addr *addr)
{
@@ -670,7 +670,7 @@ bgp_ifindex_by_nexthop (struct in6_addr *addr)
}
return 0;
}
-#endif /* HAVE_IPV6 */
+#endif
void
bgp_zebra_announce (struct prefix *p, struct bgp_info *info, struct bgp *bgp)
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index 8eb0d2e4..7f6ca168 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -114,46 +114,6 @@ bgp_option_check (int flag)
return CHECK_FLAG (bm->options, flag);
}
-/* BGP flag manipulation. */
-int
-bgp_flag_set (struct bgp *bgp, int flag)
-{
- SET_FLAG (bgp->flags, flag);
- return 0;
-}
-
-int
-bgp_flag_unset (struct bgp *bgp, int flag)
-{
- UNSET_FLAG (bgp->flags, flag);
- return 0;
-}
-
-int
-bgp_flag_check (struct bgp *bgp, int flag)
-{
- return CHECK_FLAG (bgp->flags, flag);
-}
-
-/* Internal function to set BGP structure configureation flag. */
-static void
-bgp_config_set (struct bgp *bgp, int config)
-{
- SET_FLAG (bgp->config, config);
-}
-
-static void
-bgp_config_unset (struct bgp *bgp, int config)
-{
- UNSET_FLAG (bgp->config, config);
-}
-
-static int
-bgp_config_check (struct bgp *bgp, int config)
-{
- return CHECK_FLAG (bgp->config, config);
-}
-
/* Set BGP router identifier. */
int
bgp_router_id_set (struct bgp *bgp, struct in_addr *id)
@@ -684,7 +644,7 @@ peer_sort (struct peer *peer)
}
}
-static inline void
+void
peer_free (struct peer *peer)
{
assert (peer->status == Deleted);
@@ -719,49 +679,6 @@ peer_free (struct peer *peer)
XFREE (MTYPE_BGP_PEER, peer);
}
-
-/* increase reference count on a struct peer */
-struct peer *
-peer_lock (struct peer *peer)
-{
- assert (peer && (peer->lock >= 0));
- assert (peer->status != Deleted);
-
- peer->lock++;
-
- return peer;
-}
-
-/* decrease reference count on a struct peer
- * struct peer is freed and NULL returned if last reference
- */
-struct peer *
-peer_unlock (struct peer *peer)
-{
- assert (peer && (peer->lock > 0));
-
- peer->lock--;
-
- if (peer->lock == 0)
- {
-#if 0
- zlog_debug ("unlocked and freeing");
- zlog_backtrace (LOG_DEBUG);
-#endif
- peer_free (peer);
- return NULL;
- }
-
-#if 0
- if (peer->lock == 1)
- {
- zlog_debug ("unlocked to 1");
- zlog_backtrace (LOG_DEBUG);
- }
-#endif
-
- return peer;
-}
/* Allocate new peer object, implicitely locked. */
static struct peer *
@@ -1190,7 +1107,7 @@ peer_delete (struct peer *peer)
if ((pn = listnode_lookup (peer->group->peer, peer)))
{
- peer = peer_unlock (peer); /* group->peer list reference */
+ peer_unlock (peer); /* group->peer list reference */
list_delete_node (peer->group->peer, pn);
}
peer->group = NULL;
@@ -2037,7 +1954,7 @@ bgp_get (struct bgp **bgp_val, as_t *as, const char *name)
}
/* Delete BGP instance. */
-int
+void
bgp_delete (struct bgp *bgp)
{
struct peer *peer;
@@ -2085,8 +2002,6 @@ bgp_delete (struct bgp *bgp)
XFREE (MTYPE_ROUTE_TABLE,bgp->rib[afi][safi]);
}
XFREE (MTYPE_BGP, bgp);
-
- return 0;
}
struct peer *
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h
index afe06635..f699dc35 100644
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
@@ -817,13 +817,32 @@ extern struct peer_group *peer_group_lookup (struct bgp *, const char *);
extern struct peer_group *peer_group_get (struct bgp *, const char *);
extern struct peer *peer_lookup_with_open (union sockunion *, as_t, struct in_addr *,
int *);
-extern struct peer *peer_lock (struct peer *);
-extern struct peer *peer_unlock (struct peer *);
+extern void peer_free (struct peer *peer);
extern int peer_sort (struct peer *peer);
extern int peer_active (struct peer *);
extern int peer_active_nego (struct peer *);
extern struct peer *peer_create_accept (struct bgp *);
extern char *peer_uptime (time_t, char *, size_t);
+
+static inline struct peer *
+peer_lock (struct peer *peer)
+{
+ assert (peer && (peer->lock >= 0));
+ assert (peer->status != Deleted);
+
+ peer->lock++;
+ return peer;
+}
+
+static inline void
+peer_unlock (struct peer *peer)
+{
+ assert (peer && (peer->lock > 0));
+
+ if (--peer->lock == 0)
+ peer_free (peer);
+}
+
extern int bgp_config_write (struct vty *);
extern void bgp_config_write_family_header (struct vty *, afi_t, safi_t, int *);
@@ -837,11 +856,46 @@ extern int bgp_option_unset (int);
extern int bgp_option_check (int);
extern int bgp_get (struct bgp **, as_t *, const char *);
-extern int bgp_delete (struct bgp *);
+extern void bgp_delete (struct bgp *);
+extern void bgp_free (struct bgp *);
+
+/* BGP flag manipulation. */
+static inline void
+bgp_flag_set (struct bgp *bgp, int flag)
+{
+ SET_FLAG (bgp->flags, flag);
+}
+
+static inline void
+bgp_flag_unset (struct bgp *bgp, int flag)
+{
+ UNSET_FLAG (bgp->flags, flag);
+}
+
+static inline int
+bgp_flag_check (const struct bgp *bgp, int flag)
+{
+ return CHECK_FLAG (bgp->flags, flag);
+}
+
+/* Internal function to set BGP structure configureation flag. */
+static inline void
+bgp_config_set (struct bgp *bgp, int config)
+{
+ SET_FLAG (bgp->config, config);
+}
+
+static inline void
+bgp_config_unset (struct bgp *bgp, int config)
+{
+ UNSET_FLAG (bgp->config, config);
+}
-extern int bgp_flag_set (struct bgp *, int);
-extern int bgp_flag_unset (struct bgp *, int);
-extern int bgp_flag_check (struct bgp *, int);
+static inline int
+bgp_config_check (const struct bgp *bgp, int config)
+{
+ return CHECK_FLAG (bgp->config, config);
+}
extern int bgp_router_id_set (struct bgp *, struct in_addr *);