summaryrefslogtreecommitdiff
path: root/proto/bgp
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-02-21 14:34:53 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2010-02-21 14:34:53 +0100
commite81b440f6878605edd19ed62441648ac71260881 (patch)
treebec78543f4a89096ac22e850dbb814a3f75d119a /proto/bgp
parent9e43ccf07b96597ef098955a07383d826938cd2d (diff)
Fix configure to enable warnings and fix most of them.
Diffstat (limited to 'proto/bgp')
-rw-r--r--proto/bgp/attrs.c10
-rw-r--r--proto/bgp/bgp.c12
-rw-r--r--proto/bgp/packets.c3
3 files changed, 12 insertions, 13 deletions
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c
index 96679870..6d0c0450 100644
--- a/proto/bgp/attrs.c
+++ b/proto/bgp/attrs.c
@@ -47,7 +47,7 @@ bgp_check_origin(struct bgp_proto *p UNUSED, byte *a, int len UNUSED)
}
static void
-bgp_format_origin(eattr *a, byte *buf, int buflen)
+bgp_format_origin(eattr *a, byte *buf, int buflen UNUSED)
{
static char *bgp_origin_names[] = { "IGP", "EGP", "Incomplete" };
@@ -257,14 +257,14 @@ static struct attr_desc bgp_attr_table[] = {
NULL, NULL },
{ "cluster_list", -1, BAF_OPTIONAL, EAF_TYPE_INT_SET, 0, /* BA_CLUSTER_LIST */
bgp_check_cluster_list, bgp_format_cluster_list },
- { NULL, }, /* BA_DPA */
- { NULL, }, /* BA_ADVERTISER */
- { NULL, }, /* BA_RCID_PATH */
+ { .name = NULL }, /* BA_DPA */
+ { .name = NULL }, /* BA_ADVERTISER */
+ { .name = NULL }, /* BA_RCID_PATH */
{ "mp_reach_nlri", -1, BAF_OPTIONAL, EAF_TYPE_OPAQUE, 1, /* BA_MP_REACH_NLRI */
bgp_check_reach_nlri, NULL },
{ "mp_unreach_nlri", -1, BAF_OPTIONAL, EAF_TYPE_OPAQUE, 1, /* BA_MP_UNREACH_NLRI */
bgp_check_unreach_nlri, NULL },
- { NULL, }, /* BA_EXTENDED_COMM */
+ { .name = NULL }, /* BA_EXTENDED_COMM */
{ "as4_path", -1, BAF_OPTIONAL | BAF_TRANSITIVE, EAF_TYPE_OPAQUE, 1, /* BA_AS4_PATH */
NULL, NULL },
{ "as4_aggregator", -1, BAF_OPTIONAL | BAF_TRANSITIVE, EAF_TYPE_OPAQUE, 1, /* BA_AS4_PATH */
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index be841bdf..4410c043 100644
--- a/proto/bgp/bgp.c
+++ b/proto/bgp/bgp.c
@@ -203,7 +203,7 @@ bgp_start_timer(timer *t, int value)
void
bgp_close_conn(struct bgp_conn *conn)
{
- struct bgp_proto *p = conn->bgp;
+ // struct bgp_proto *p = conn->bgp;
DBG("BGP: Closing connection\n");
conn->packets_to_send = 0;
@@ -237,7 +237,7 @@ bgp_update_startup_delay(struct bgp_proto *p)
DBG("BGP: Updating startup delay\n");
- if (p->last_proto_error && ((now - p->last_proto_error) >= cf->error_amnesia_time))
+ if (p->last_proto_error && ((now - p->last_proto_error) >= (int) cf->error_amnesia_time))
p->startup_delay = 0;
p->last_proto_error = now;
@@ -492,7 +492,7 @@ bgp_setup_conn(struct bgp_proto *p, struct bgp_conn *conn)
}
static void
-bgp_setup_sk(struct bgp_proto *p, struct bgp_conn *conn, sock *s)
+bgp_setup_sk(struct bgp_conn *conn, sock *s)
{
s->data = conn;
s->err_hook = bgp_sock_err;
@@ -555,7 +555,7 @@ bgp_connect(struct bgp_proto *p) /* Enter Connect state and start establishing c
s->tx_hook = bgp_connected;
BGP_TRACE(D_EVENTS, "Connecting to %I from local address %I", s->daddr, s->saddr);
bgp_setup_conn(p, conn);
- bgp_setup_sk(p, conn, s);
+ bgp_setup_sk(conn, s);
bgp_conn_set_state(conn, BS_CONNECT);
if (sk_open(s))
{
@@ -601,7 +601,7 @@ bgp_incoming_connection(sock *sk, int dummy UNUSED)
goto err;
bgp_setup_conn(p, &p->incoming_conn);
- bgp_setup_sk(p, &p->incoming_conn, sk);
+ bgp_setup_sk(&p->incoming_conn, sk);
sk_set_ttl(sk, p->cf->multihop ? : 1);
bgp_send_open(&p->incoming_conn);
return 0;
@@ -615,7 +615,7 @@ bgp_incoming_connection(sock *sk, int dummy UNUSED)
}
static void
-bgp_listen_sock_err(sock *sk, int err)
+bgp_listen_sock_err(sock *sk UNUSED, int err)
{
if (err == ECONNABORTED)
log(L_WARN "BGP: Incoming connection aborted");
diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c
index 329efb3c..3609c568 100644
--- a/proto/bgp/packets.c
+++ b/proto/bgp/packets.c
@@ -44,7 +44,6 @@ static byte *
mrt_put_bgp4_hdr(byte *buf, struct bgp_conn *conn, int as4)
{
struct bgp_proto *p = conn->bgp;
- ip_addr local_addr;
if (as4)
{
@@ -614,7 +613,7 @@ bgp_tx(sock *sk)
void
bgp_parse_capabilities(struct bgp_conn *conn, byte *opt, int len)
{
- struct bgp_proto *p = conn->bgp;
+ // struct bgp_proto *p = conn->bgp;
int cl;
while (len > 0)