]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fix configure to enable warnings and fix most of them.
authorOndrej Zajicek <santiago@crfreenet.org>
Sun, 21 Feb 2010 13:34:53 +0000 (14:34 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Sun, 21 Feb 2010 13:34:53 +0000 (14:34 +0100)
31 files changed:
client/client.c
conf/gen_keywords.m4
configure.in
lib/event.c
lib/ip.h
lib/ipv4.h
lib/socket.h
nest/a-path.c
nest/cli.c
nest/locks.c
nest/proto.c
nest/rt-table.c
proto/bgp/attrs.c
proto/bgp/bgp.c
proto/bgp/packets.c
proto/ospf/hello.c
proto/ospf/lsalib.c
proto/ospf/lsalib.h
proto/ospf/lsupd.c
proto/ospf/neighbor.c
proto/ospf/ospf.c
proto/ospf/ospf.h
proto/ospf/packet.c
proto/ospf/rt.c
proto/ospf/topology.c
proto/pipe/pipe.c
proto/rip/rip.c
sysdep/linux/sysio.h
sysdep/unix/io.c
sysdep/unix/log.c
sysdep/unix/unix.h

index 8f514f6206d25a53174a3bc1a8d0abebc5377c99..9acabf21e54fefc8d8c0271b327f26d0355d82c6 100644 (file)
@@ -311,10 +311,12 @@ update_state(void)
     }
 
   if (nstate == STATE_PROMPT)
-    if (input_initialized)
-      input_reveal();
-    else
-      input_init();
+    {
+      if (input_initialized)
+       input_reveal();
+      else
+       input_init();
+    }
 
   if (nstate != STATE_PROMPT)
     input_hide();
@@ -372,6 +374,8 @@ server_connect(void)
     die("fcntl: %m");
 }
 
+#define PRINTF(LEN, PARGS...) do { if (!skip_input) len = printf(PARGS); } while(0)
+
 static void
 server_got_reply(char *x)
 {
@@ -379,15 +383,15 @@ server_got_reply(char *x)
   int len = 0;
 
   if (*x == '+')                       /* Async reply */
-    skip_input || (len = printf(">>> %s\n", x+1));
+    PRINTF(len, ">>> %s\n", x+1);
   else if (x[0] == ' ')                        /* Continuation */
-    skip_input || (len = printf("%s%s\n", verbose ? "     " : "", x+1));
+    PRINTF(len, "%s%s\n", verbose ? "     " : "", x+1);
   else if (strlen(x) > 4 &&
           sscanf(x, "%d", &code) == 1 && code >= 0 && code < 10000 &&
           (x[4] == ' ' || x[4] == '-'))
     {
       if (code)
-       skip_input || (len = printf("%s\n", verbose ? x : x+5));
+       PRINTF(len, "%s\n", verbose ? x : x+5);
       if (x[4] == ' ')
       {
        nstate = STATE_PROMPT;
@@ -396,7 +400,7 @@ server_got_reply(char *x)
       }
     }
   else
-    skip_input || (len = printf("??? <%s>\n", x));
+    PRINTF(len, "??? <%s>\n", x);
 
   if (skip_input)
     return;
index 34a0011f0e894bd54370381460b47567d28ae1d3..cf3fb58ecb37bb6137a0e89d869294172e40ecbd 100644 (file)
@@ -23,7 +23,7 @@ m4_define(CF_DECLS, `m4_divert(-1)')
 m4_define(CF_DEFINES, `m4_divert(-1)')
 
 # Keywords are translated to C initializers
-m4_define(CF_handle_kw, `m4_divert(1){ "m4_translit($1,[[A-Z]],[[a-z]])", $1 },
+m4_define(CF_handle_kw, `m4_divert(1){ "m4_translit($1,[[A-Z]],[[a-z]])", $1, NULL },
 m4_divert(-1)')
 m4_define(CF_keywd, `m4_ifdef([[CF_tok_$1]],,[[m4_define([[CF_tok_$1]],1)CF_handle_kw($1)]])')
 m4_define(CF_KEYWORDS, `m4_define([[CF_toks]],[[]])CF_iterate([[CF_keywd]], [[$@]])m4_ifelse(CF_toks,,,%token[[]]CF_toks
@@ -34,7 +34,7 @@ m4_define(CF_CLI, `CF_KEYWORDS(m4_translit($1, [[ ]], [[,]]))
 ')
 
 # Enums are translated to C initializers: use CF_ENUM(typename, prefix, values)
-m4_define(CF_enum, `m4_divert(1){ "CF_enum_prefix[[]]$1", -((CF_enum_type<<16) | CF_enum_prefix[[]]$1) },
+m4_define(CF_enum, `m4_divert(1){ "CF_enum_prefix[[]]$1", -((CF_enum_type<<16) | CF_enum_prefix[[]]$1), NULL },
 m4_divert(-1)')
 m4_define(CF_ENUM, `m4_define([[CF_enum_type]],$1)m4_define([[CF_enum_prefix]],$2)CF_iterate([[CF_enum]], [[m4_shift(m4_shift($@))]])DNL')
 
@@ -42,7 +42,7 @@ m4_define(CF_ENUM, `m4_define([[CF_enum_type]],$1)m4_define([[CF_enum_prefix]],$
 m4_m4wrap(`
 m4_divert(0)
 static struct keyword keyword_list[] = {
-m4_undivert(1){ NULL, -1 } };
+m4_undivert(1){ NULL, -1, NULL } };
 ')
 
 # As we are processing C source, we must access all M4 primitives via
index ec2417b2ed7281c1db712dbeefe235089ea0f663..c931c183bd604a0b7006a8012d25755827df3810 100644 (file)
@@ -8,7 +8,6 @@ AC_CONFIG_AUX_DIR(tools)
 
 AC_ARG_ENABLE(debug,[  --enable-debug          enable internal debugging routines (default: disabled)],,enable_debug=no)
 AC_ARG_ENABLE(memcheck,[  --enable-memcheck       check memory allocations when debugging (default: enabled)],,enable_memcheck=yes)
-AC_ARG_ENABLE(warnings,[  --enable-warnings       enable extra warnings (default: disabled)],,enable_warnings=no)
 AC_ARG_ENABLE(client,[  --enable-client         enable building of BIRD client (default: enabled)],,enable_client=yes)
 AC_ARG_ENABLE(ipv6,[  --enable-ipv6           enable building of IPv6 version (default: disabled)],,enable_ipv6=no)
 AC_ARG_WITH(sysconfig,[  --with-sysconfig=FILE   use specified BIRD system configuration file])
@@ -56,24 +55,17 @@ AC_SEARCH_LIBS(clock_gettime,[c rt posix4])
 
 AC_CANONICAL_HOST
 
-AC_PROG_CC
-if test -z "$GCC" ; then
-       AC_MSG_ERROR([This program requires the GNU C Compiler.])
-       fi
 AC_MSG_CHECKING([what CFLAGS should we use])
 if test "$ac_test_CFLAGS" != set ; then
-       if test "$enable_warnings" = yes ; then
-               WARNS=" -Wmissing-prototypes -Wundef"
-       else
-               WARNS=" -Wno-unused"
-       fi
-       CFLAGS="$CFLAGS -Wall -W -Wstrict-prototypes -Wno-pointer-sign -Wno-parentheses$WARNS"
-fi
-if test "$with_sysinclude" != no -a -n "$with_sysinclude"; then
-       CPPFLAGS="$CPPFLAGS -I$with_sysinclude"
+       CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -Wno-pointer-sign -Wno-parentheses"
 fi
 AC_MSG_RESULT($CFLAGS)
 
+AC_PROG_CC
+if test -z "$GCC" ; then
+       AC_MSG_ERROR([This program requires the GNU C Compiler.])
+fi
+
 AC_PROG_CPP
 AC_PROG_INSTALL
 AC_PROG_RANLIB
index d556cd05a13f3feed6ac7ed598243191d2eae2bf..ce5e81c89633694eb80277332da35216fa705848 100644 (file)
@@ -49,7 +49,8 @@ static struct resclass ev_class = {
   "Event",
   sizeof(event),
   (void (*)(resource *)) ev_postpone,
-  ev_dump
+  ev_dump,
+  NULL
 };
 
 /**
index 1cc74e8128915e62a1293df91efe46c1386b0ebb..5dc9191b05a502674caa31630e23a814ce9893e9 100644 (file)
--- a/lib/ip.h
+++ b/lib/ip.h
@@ -46,7 +46,7 @@ char *ip_scope_text(unsigned);
 
 struct prefix {
   ip_addr addr;
-  int len;
+  unsigned int len;
 };
 
 #define ip_is_prefix(a,l) (!ipa_nonzero(ipa_and(a, ipa_not(ipa_mkmask(l)))))
index 52bed16ff6b9fae61cfdd9e81412e475471cdd38..74f1e88fe17e21cf662a2d3f35698e2ee830fe3a 100644 (file)
@@ -72,7 +72,7 @@ int ipv4_classify(u32);
 u32 ipv4_class_mask(u32);
 byte *ipv4_skip_header(byte *, int *);
 
-static inline int ipv4_has_link_scope(u32 a)
+static inline int ipv4_has_link_scope(u32 a UNUSED)
 {
   return 0;
 }
index 82b5de0c1c7def44b5ed11a8aaeae2140374ee09..a28579999a42bdd658ac4addfb40fb1a66e919c0 100644 (file)
@@ -66,6 +66,8 @@ int sk_leave_group(sock *s, ip_addr maddr);
 int sk_set_ipv6_checksum(sock *s, int offset);
 #endif
 
+int sk_set_broadcast(sock *s, int enable);
+
 static inline int
 sk_send_buffer_empty(sock *sk)
 {
index 396d463269583e07ac841122803e4364c4c36457..058b43442fd1aa5db183fb4c6c439c75ef018d3b 100644 (file)
@@ -385,7 +385,7 @@ as_path_match(struct adata *path, struct f_path_mask *mask)
   struct pm_pos pos[2048 + 1];
   int plen = parse_path(path, pos);
   int l, h, i, nh, nl;
-  u32 val;
+  u32 val = 0;
 
   /* l and h are bound of interval of positions where
      are marked states */
@@ -417,7 +417,7 @@ as_path_match(struct adata *path, struct f_path_mask *mask)
          goto step;
        case PM_QUESTION:
        step:
-         nh = -1;
+         nh = nl = -1;
          for (i = h; i >= l; i--)
            if (pos[i].mark)
              {
index ace97beb70a18ff87e09ed75e3b5c3f6b42979e3..4d2b8fd06e6dbc735ed997ba835ce7d433a60a47 100644 (file)
@@ -357,8 +357,8 @@ cli_echo(unsigned int class, byte *msg)
        free = (c->ring_end - c->ring_buf) - (c->ring_write - c->ring_read + 1);
       else
        free = c->ring_read - c->ring_write - 1;
-      if (len > free ||
-         free < c->log_threshold && class < (unsigned) L_INFO[0])
+      if ((len > free) ||
+         (free < c->log_threshold && class < (unsigned) L_INFO[0]))
        {
          c->ring_overflow++;
          continue;
index 1cdbbc9928a00f82f87ad48595d5b2bea6754a12..7044d6a9849129a7a6b10e0bc224ae07790734fd 100644 (file)
@@ -97,7 +97,8 @@ static struct resclass olock_class = {
   "ObjLock",
   sizeof(struct object_lock),
   olock_free,
-  olock_dump
+  olock_dump,
+  NULL
 };
 
 /**
index e9cf3dfa4f3c92abfb84ed9378bbe92a60c8d859..488370552c125f645c71279bd54dc44fa9bdba32 100644 (file)
@@ -51,7 +51,7 @@ proto_enqueue(list *l, struct proto *p)
 static void
 proto_relink(struct proto *p)
 {
-  list *l;
+  list *l = NULL;
 
   if (p->debug & D_STATES)
     {
index 72a1cb0e230b8bb8b55ad2ec61fa7f9d6ad79e0c..41ecf64610ccf1d95974ca141c440157a9581200 100644 (file)
@@ -158,7 +158,7 @@ rte_trace_out(unsigned int flag, struct proto *p, rte *e, char *msg)
 }
 
 static inline void
-do_rte_announce(struct announce_hook *a, int type, net *net, rte *new, rte *old, ea_list *tmpa, int class, int refeed)
+do_rte_announce(struct announce_hook *a, int type UNUSED, net *net, rte *new, rte *old, ea_list *tmpa, int class, int refeed)
 {
   struct proto *p = a->proto;
   struct filter *filter = p->out_filter;
@@ -196,8 +196,8 @@ do_rte_announce(struct announce_hook *a, int type, net *net, rte *new, rte *old,
        }
       else if (ok)
        rte_trace_out(D_FILTERS, p, new, "forced accept by protocol");
-      else if (filter == FILTER_REJECT ||
-              filter && f_run(filter, &new, &tmpa, rte_update_pool, FF_FORCE_TMPATTR) > F_ACCEPT)
+      else if ((filter == FILTER_REJECT) ||
+              (filter && f_run(filter, &new, &tmpa, rte_update_pool, FF_FORCE_TMPATTR) > F_ACCEPT))
        {
          stats->exp_updates_filtered++;
          drop_reason = "filtered out";
@@ -329,7 +329,7 @@ do_rte_announce(struct announce_hook *a, int type, net *net, rte *new, rte *old,
  * the protocol gets called.
  */
 static void
-rte_announce(rtable *tab, int type, net *net, rte *new, rte *old, ea_list *tmpa)
+rte_announce(rtable *tab, unsigned type, net *net, rte *new, rte *old, ea_list *tmpa)
 {
   struct announce_hook *a;
   int class = ipa_classify(net->n.prefix);
@@ -1203,8 +1203,8 @@ rt_show_net(struct cli *c, net *n, struct rt_show_data *d)
                 'configure soft' command may change the export filter
                 and do not update routes */
 
-             if (p1->out_filter == FILTER_REJECT ||
-                 p1->out_filter && f_run(p1->out_filter, &e, &tmpa, rte_update_pool, FF_FORCE_TMPATTR) > F_ACCEPT)
+             if ((p1->out_filter == FILTER_REJECT) ||
+                 (p1->out_filter && f_run(p1->out_filter, &e, &tmpa, rte_update_pool, FF_FORCE_TMPATTR) > F_ACCEPT))
                ok = 0;
            }
        }
index 966798702592dde558223a4a5e9b003fa4420f50..6d0c0450a6b0cb687ea610e6c4ec2ae3ed4138c2 100644 (file)
@@ -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 */
index be841bdf9cd739105728cbf0b0395ead5721386a..4410c043d350f1d6fefacb516e5f5a27c1696420 100644 (file)
@@ -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");
index 329efb3ce76cadc3d3b326edeee43fbbec66a9ed..3609c5681c01b7bdea3c66d664100e604fd63b07 100644 (file)
@@ -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)
index 738748d8592d3a74df73b896f1ef2140f8b6a100..2f3a8a81b1e5e3e980012eb3b05dcbbc3bc6342e 100644 (file)
@@ -48,8 +48,8 @@ ospf_hello_receive(struct ospf_packet *ps_i, struct ospf_iface *ifa,
   struct proto_ospf *po = ifa->oa->po;
   struct proto *p = &po->proto;
   char *beg = "Bad OSPF HELLO packet from ", *rec = " received: ";
-  unsigned int size, i, twoway, oldpriority, eligible, peers;
-  u32 olddr, oldbdr, oldiface_id, tmp;
+  unsigned int size, i, twoway, eligible, peers;
+  u32 tmp;
   u32 *pnrid;
 
   size = ntohs(ps_i->length);
@@ -188,11 +188,11 @@ ospf_hello_receive(struct ospf_packet *ps_i, struct ospf_iface *ifa,
   if (!twoway)
     ospf_neigh_sm(n, INM_1WAYREC);
 
-  olddr = n->dr;
-  oldbdr = n->bdr;
-  oldpriority = n->priority;
+  u32 olddr = n->dr;
+  u32 oldbdr = n->bdr;
+  u32 oldpriority = n->priority;
 #ifdef OSPFv3
-  oldiface_id = n->iface_id;
+  u32 oldiface_id = n->iface_id;
 #endif
 
   n->dr = ntohl(ps->dr);
index ab633984d75b0a873a7f13e7e39e8a8dfc76fc3d..35f02dcd4ad8ff6c3be90a2ee55da967aca618ce 100644 (file)
@@ -122,22 +122,22 @@ ntohlsah(struct ospf_lsa_header *n, struct ospf_lsa_header *h)
 }
 
 void
-htonlsab(void *h, void *n, u16 type, u16 len)
+htonlsab(void *h, void *n, u16 len)
 {
   u32 *hid = h;
   u32 *nid = n;
-  int i;
+  unsigned i;
 
   for (i = 0; i < (len / sizeof(u32)); i++)
     nid[i] = htonl(hid[i]);
 }
 
 void
-ntohlsab(void *n, void *h, u16 type, u16 len)
+ntohlsab(void *n, void *h, u16 len)
 {
   u32 *nid = n;
   u32 *hid = h;
-  int i;
+  unsigned i;
 
   for (i = 0; i < (len / sizeof(u32)); i++)
     hid[i] = ntohl(nid[i]);
@@ -185,11 +185,10 @@ void
 lsasum_calculate(struct ospf_lsa_header *h, void *body)
 {
   u16 length = h->length;
-  u16 type = h->type;
 
   //  log(L_WARN "Checksum %R %R %d start (len %d)", h->id, h->rt, h->type, length);
   htonlsah(h, h);
-  htonlsab(body, body, type, length - sizeof(struct ospf_lsa_header));
+  htonlsab(body, body, length - sizeof(struct ospf_lsa_header));
 
   /*
   char buf[1024];
@@ -203,7 +202,7 @@ lsasum_calculate(struct ospf_lsa_header *h, void *body)
   //  log(L_WARN "Checksum result %4x", h->checksum);
 
   ntohlsah(h, h);
-  ntohlsab(body, body, type, length - sizeof(struct ospf_lsa_header));
+  ntohlsab(body, body, length - sizeof(struct ospf_lsa_header));
 }
 
 /*
@@ -325,7 +324,7 @@ lsa_validate_rt(struct ospf_lsa_header *lsa, struct ospf_lsa_rt *body)
 }
 
 static int
-lsa_validate_net(struct ospf_lsa_header *lsa, struct ospf_lsa_net *body)
+lsa_validate_net(struct ospf_lsa_header *lsa, struct ospf_lsa_net *body UNUSED)
 {
   if (lsa->length < (HDRLEN + sizeof(struct ospf_lsa_net)))
     return 0;
index ed929beb28b8450181082784868241eb5db889a8..a799de31ea875bdec73c57eaadaf7ab7e82f9165 100644 (file)
@@ -12,8 +12,8 @@
 
 void htonlsah(struct ospf_lsa_header *h, struct ospf_lsa_header *n);
 void ntohlsah(struct ospf_lsa_header *n, struct ospf_lsa_header *h);
-void htonlsab(void *h, void *n, u16 type, u16 len);
-void ntohlsab(void *n, void *h, u16 type, u16 len);
+void htonlsab(void *h, void *n, u16 len);
+void ntohlsab(void *n, void *h, u16 len);
 void lsasum_calculate(struct ospf_lsa_header *header, void *body);
 u16 lsasum_check(struct ospf_lsa_header *h, void *body);
 #define CMP_NEWER 1
index 9bed374e0318d1513f3c2f5fee496371fe2b9e9c..628dca96eec20d90cdf72a8781b3621a65d9afce 100644 (file)
@@ -290,8 +290,7 @@ ospf_lsupd_flood(struct proto_ospf *po,
        htonlsah(hh, lh);
        help = (u8 *) (lh + 1);
        en = ospf_hash_find_header(po->gr, domain, hh);
-       htonlsab(en->lsa_body, help, hh->type, hh->length
-                - sizeof(struct ospf_lsa_header));
+       htonlsab(en->lsa_body, help, hh->length - sizeof(struct ospf_lsa_header));
       }
 
       len = sizeof(struct ospf_lsupd_packet) + ntohs(lh->length);
@@ -386,8 +385,7 @@ ospf_lsupd_send_list(struct ospf_neighbor *n, list * l)
     }
     htonlsah(&(en->lsa), pktpos);
     pktpos = pktpos + sizeof(struct ospf_lsa_header);
-    htonlsab(en->lsa_body, pktpos, en->lsa.type, en->lsa.length
-            - sizeof(struct ospf_lsa_header));
+    htonlsab(en->lsa_body, pktpos, en->lsa.length - sizeof(struct ospf_lsa_header));
     pktpos = pktpos + en->lsa.length - sizeof(struct ospf_lsa_header);
     len += en->lsa.length;
     lsano++;
@@ -630,8 +628,7 @@ ospf_lsupd_receive(struct ospf_packet *ps_i, struct ospf_iface *ifa,
 
       /* pg 144 (5d) */
       void *body = mb_alloc(p->pool, lsatmp.length - sizeof(struct ospf_lsa_header));
-      ntohlsab(lsa + 1, body, lsatmp.type,
-              lsatmp.length - sizeof(struct ospf_lsa_header));
+      ntohlsab(lsa + 1, body, lsatmp.length - sizeof(struct ospf_lsa_header));
 
       /* We will do validation check after flooding and
         acknowledging given LSA to minimize problems
index 0411d48e5fef4733702b9bfc3398a608eb9b55df..13abc56992013c1d066a9343c0a16b867b21b8c3 100644 (file)
@@ -440,7 +440,6 @@ void
 bdr_election(struct ospf_iface *ifa)
 {
   struct proto_ospf *po = ifa->oa->po;
-  struct proto *p = &po->proto;
   u32 myid = po->router_id;
   struct ospf_neighbor *neigh, *ndr, *nbdr, me;
   int doadj;
@@ -632,7 +631,7 @@ static void
 rxmt_timer_hook(timer * timer)
 {
   struct ospf_neighbor *n = (struct ospf_neighbor *) timer->data;
-  struct proto *p = &n->ifa->oa->po->proto;
+  // struct proto *p = &n->ifa->oa->po->proto;
   struct top_hash_entry *en;
 
   DBG("%s: RXMT timer fired on interface %s for neigh: %I.\n",
index 26a05d959d895bb12c2ecc1d4085306d66ebf5c6..edca5959b7c28105f0ecb4e75bf805ea85c16a45 100644 (file)
@@ -224,9 +224,11 @@ ospf_dump(struct proto *p)
     }
   }
 
+  /*
   OSPF_TRACE(D_EVENTS, "LSA graph dump start:");
   ospf_top_dump(po->gr, p);
   OSPF_TRACE(D_EVENTS, "LSA graph dump finished");
+  */
   neigh_dump_all();
 }
 
@@ -500,7 +502,7 @@ ospf_rt_notify(struct proto *p, rtable *tbl UNUSED, net * n, rte * new, rte * ol
 }
 
 static void
-ospf_ifa_notify(struct proto *p, unsigned flags, struct ifa *a)
+ospf_ifa_notify(struct proto *p, unsigned flags UNUSED, struct ifa *a)
 {
   struct proto_ospf *po = (struct proto_ospf *) p;
   struct ospf_iface *ifa;
@@ -915,7 +917,7 @@ ospf_reconfigure(struct proto *p, struct proto_config *c)
 void
 ospf_sh_neigh(struct proto *p, char *iff)
 {
-  struct ospf_iface *ifa = NULL, *f;
+  struct ospf_iface *ifa = NULL;
   struct ospf_neighbor *n;
   struct proto_ospf *po = (struct proto_ospf *) p;
 
@@ -1006,7 +1008,7 @@ void
 ospf_sh_iface(struct proto *p, char *iff)
 {
   struct proto_ospf *po = (struct proto_ospf *) p;
-  struct ospf_iface *ifa = NULL, *f;
+  struct ospf_iface *ifa = NULL;
 
   if (p->proto_state != PS_UP)
   {
@@ -1193,7 +1195,6 @@ show_lsa_network(struct top_hash_entry *he)
 static inline void
 show_lsa_sum_net(struct top_hash_entry *he)
 {
-  struct ospf_lsa_header *lsa = &(he->lsa);
   ip_addr ip;
   int pxlen;
 
@@ -1217,7 +1218,7 @@ show_lsa_sum_rt(struct top_hash_entry *he)
   u32 dst_rid, options;
 
 #ifdef OSPFv2
-  struct ospf_lsa_sum *ls = he->lsa_body;
+  //  struct ospf_lsa_sum *ls = he->lsa_body;
   dst_rid = he->lsa.id;
   options = 0;
 #else /* OSPFv3 */
@@ -1235,7 +1236,6 @@ show_lsa_external(struct top_hash_entry *he)
 {
   struct ospf_lsa_header *lsa = &(he->lsa);
   struct ospf_lsa_ext *ext = he->lsa_body;
-  struct ospf_lsa_ext_tos *et = (struct ospf_lsa_ext_tos *) (ext + 1);
   char str_via[STD_ADDRESS_P_LENGTH + 8] = "";
   char str_tag[16] = "";
   ip_addr ip, rt_fwaddr;
@@ -1493,8 +1493,6 @@ ospf_sh_lsadb(struct proto *p)
     
     if ((dscope != last_dscope) || (hea[i]->domain != last_domain))
     {
-      struct iface *ifa;
-
       cli_msg(-1017, "");
       switch (dscope)
       {
@@ -1506,7 +1504,7 @@ ospf_sh_lsadb(struct proto *p)
          break;
 #ifdef OSPFv3
        case LSA_SCOPE_LINK:
-         ifa = if_find_by_index(hea[i]->domain);
+         struct iface *ifa = if_find_by_index(hea[i]->domain);
          cli_msg(-1017, "Link %s", (ifa != NULL) ? ifa->name : "?");
          break;
 #endif
index 17dc15215c48e2ede010e1b8db3bda1487a9a0d0..78b66ec9a33637307debcf1ac968369a2ed6bf68 100644 (file)
@@ -704,7 +704,7 @@ struct ospf_area
   struct top_hash_entry *pxr_lsa; /* Originated prefix LSA */
   list cand;                   /* List of candidates for RT calc. */
   struct fib net_fib;          /* Networks to advertise or not */
-  int stub;
+  unsigned stub;
   int trcap;                   /* Transit capability? */
   u32 options;                 /* Optional features */
   struct proto_ospf *po;
@@ -781,13 +781,14 @@ void schedule_net_lsa(struct ospf_iface *ifa);
 #ifdef OSPFv3
 void schedule_link_lsa(struct ospf_iface *ifa);
 #else
-static inline void schedule_link_lsa(struct ospf_iface *ifa) {}
+static inline void schedule_link_lsa(struct ospf_iface *ifa UNUSED) {}
 #endif
 
 void ospf_sh_neigh(struct proto *p, char *iff);
 void ospf_sh(struct proto *p);
 void ospf_sh_iface(struct proto *p, char *iff);
 void ospf_sh_state(struct proto *p, int verbose);
+void ospf_sh_lsadb(struct proto *p);
 
 
 #define EA_OSPF_METRIC1        EA_CODE(EAP_OSPF, 0)
index ce9739e0ccde89f5e67e8b3beb0211ab2f73af24..ea5f7a8615d423c0eeaac6118357a95cf6da9972 100644 (file)
@@ -14,7 +14,6 @@ void
 ospf_pkt_fill_hdr(struct ospf_iface *ifa, void *buf, u8 h_type)
 {
   struct proto_ospf *po = ifa->oa->po;
-  struct proto *p = &po->proto;
   struct ospf_packet *pkt;
 
   pkt = (struct ospf_packet *) buf;
index c3ed19f891c768f6a60163cf9f894c64ae009800..84e472526f4d5cb1846af2a3b656aa8d4d6f2784 100644 (file)
@@ -226,7 +226,7 @@ process_prefixes(struct ospf_area *oa)
 static void
 ospf_rt_spfa_rtlinks(struct ospf_area *oa, struct top_hash_entry *act, struct top_hash_entry *en)
 {
-  struct proto *p = &oa->po->proto;
+  // struct proto *p = &oa->po->proto;
   struct proto_ospf *po = oa->po;
   orta nf;
   u32 i;
@@ -519,7 +519,7 @@ link_back(struct ospf_area *oa, struct top_hash_entry *en, struct top_hash_entry
 static void
 ospf_rt_sum_tr(struct ospf_area *oa)
 {
-  struct proto *p = &oa->po->proto;
+  // struct proto *p = &oa->po->proto;
   struct proto_ospf *po = oa->po;
   struct ospf_area *bb = po->backbone;
   ip_addr ip, abrip;
@@ -1077,8 +1077,8 @@ static int
 calc_next_hop(struct ospf_area *oa, struct top_hash_entry *en,
              struct top_hash_entry *par)
 {
+  // struct proto *p = &oa->po->proto;
   struct ospf_neighbor *neigh;
-  struct proto *p = &oa->po->proto;
   struct proto_ospf *po = oa->po;
   struct ospf_iface *ifa;
 
index 870c0bc21841c53b838d20e188e6959226c9ce3c..54701192f2fca724d3c9a270cb4738e5511526d1 100644 (file)
@@ -744,7 +744,7 @@ originate_sum_net_lsa(struct ospf_area *oa, struct fib_node *fn, int metric)
 }
 
 void
-originate_sum_rt_lsa(struct ospf_area *oa, struct fib_node *fn, int metric, u32 options)
+originate_sum_rt_lsa(struct ospf_area *oa, struct fib_node *fn, int metric, u32 options UNUSED)
 {
   struct proto_ospf *po = oa->po;
   struct proto *p = &po->proto;
@@ -899,7 +899,6 @@ originate_ext_lsa_body(net *n, rte *e, u16 *length, struct proto_ospf *po,
   u32 tag = ea_get_int(attrs, EA_OSPF_TAG, 0);
   int gw = 0;
   int size = sizeof(struct ospf_lsa_ext);
-  u32 *buf;
 
   if ((e->attrs->dest == RTD_ROUTER) &&
       !ipa_equal(e->attrs->gw, IPA_NONE) &&
@@ -927,7 +926,7 @@ originate_ext_lsa_body(net *n, rte *e, u16 *length, struct proto_ospf *po,
   ext->fwaddr = gw ? e->attrs->gw : IPA_NONE;
   ext->tag = tag;
 #else /* OSPFv3 */
-  buf = ext->rest;
+  u32 *buf = ext->rest;
   buf = put_ipv6_prefix(buf, n->n.prefix, n->n.pxlen, 0, 0);
 
   if (gw)
@@ -1017,7 +1016,6 @@ flush_ext_lsa(net *n, struct proto_ospf *po)
 {
   struct proto *p = &po->proto;
   struct fib_node *fn = &n->n;
-  struct ospf_area *oa;
   struct top_hash_entry *en;
 
   OSPF_TRACE(D_EVENTS, "Flushing AS-external-LSA for %I/%d",
@@ -1651,10 +1649,11 @@ ospf_hash_delete(struct top_graph *f, struct top_hash_entry *e)
   bug("ospf_hash_delete() called for invalid node");
 }
 
+/*
 static void
 ospf_dump_lsa(struct top_hash_entry *he, struct proto *p)
 {
-  /*
+
   struct ospf_lsa_rt *rt = NULL;
   struct ospf_lsa_rt_link *rr = NULL;
   struct ospf_lsa_net *ln = NULL;
@@ -1688,7 +1687,6 @@ ospf_dump_lsa(struct top_hash_entry *he, struct proto *p)
     default:
       break;
     }
-  */
 }
 
 void
@@ -1704,6 +1702,7 @@ ospf_top_dump(struct top_graph *f, struct proto *p)
       ospf_dump_lsa(e, p);
   }
 }
+*/
 
 /* This is very inefficient, please don't call it often */
 
index 943d3a0ea5977c727e18dd97fb6f3fb6e060a69f..7fdf2733fb4061d272604407a587a54ecf496002 100644 (file)
@@ -168,7 +168,7 @@ pipe_get_status(struct proto *P, byte *buf)
 static int
 pipe_reconfigure(struct proto *P, struct proto_config *new)
 {
-  struct pipe_proto *p = (struct pipe_proto *) P;
+  // struct pipe_proto *p = (struct pipe_proto *) P;
   struct pipe_config *o = (struct pipe_config *) P->cf;
   struct pipe_config *n = (struct pipe_config *) new;
 
index d69d643208ed92735042c592d8ecda06a4fd3c6b..3b95a3edce53536823b4acc3982fbb7b3fedb9c2 100644 (file)
@@ -752,6 +752,7 @@ new_iface(struct proto *p, struct iface *new, unsigned long flags, struct iface_
     return NULL;
   }
   /* On dummy, we just return non-working socket, so that user gets error every time anyone requests table */
+  return rif;
 }
 
 static void
@@ -956,7 +957,7 @@ rip_rte_insert(net *net UNUSED, rte *rte)
 static void
 rip_rte_remove(net *net UNUSED, rte *rte)
 {
-  struct proto *p = rte->attrs->proto;
+  // struct proto *p = rte->attrs->proto;
   CHK_MAGIC;
   DBG( "rip_rte_remove: %p\n", rte );
   rem_node( &rte->u.rip.garbage );
index 70d35ccf53828dfc0364089be51af92cd0a0de53..7fe3566bc7aa894fb34eaa44b664d1b2423ae448 100644 (file)
@@ -87,7 +87,7 @@ struct ip_mreqn
 #define fill_mreq_ifa fill_mreq
 #define fill_mreq_grp fill_mreq
 
-static inline fill_mreq(struct ip_mreqn *m, struct iface *ifa, ip_addr maddr)
+static inline void fill_mreq(struct ip_mreqn *m, struct iface *ifa, ip_addr maddr)
 {
   bzero(m, sizeof(*m));
   m->imr_ifindex = ifa->index;
index 90b5b14484e800d74c8ac0a56bc38d4a3d68ffae..915baf449915a4c0b4dd7d9f82b157ace03d6aab 100644 (file)
@@ -70,7 +70,8 @@ static struct resclass rf_class = {
   "FILE",
   sizeof(struct rfile),
   rf_free,
-  rf_dump
+  rf_dump,
+  NULL
 };
 
 void *
@@ -195,7 +196,8 @@ static struct resclass tm_class = {
   "Timer",
   sizeof(timer),
   tm_free,
-  tm_dump
+  tm_dump,
+  NULL
 };
 
 /**
@@ -564,7 +566,8 @@ static struct resclass sk_class = {
   "Socket",
   sizeof(sock),
   sk_free,
-  sk_dump
+  sk_dump,
+  NULL
 };
 
 /**
@@ -640,7 +643,7 @@ fill_in_sockaddr(sockaddr *sa, ip_addr a, unsigned port)
 }
 
 static inline void
-fill_in_sockifa(sockaddr *sa, struct iface *ifa)
+fill_in_sockifa(sockaddr *sa UNUSED, struct iface *ifa UNUSED)
 {
 }
 
@@ -1492,7 +1495,6 @@ io_loop(void)
            {
              sock *s = current_sock;
              int e;
-             int steps;
 
              if ((s->type < SK_MAGIC) && FD_ISSET(s->fd, &rd) && s->rx_hook)
                {
index f227549c03cb15d34f5023ded7cc3acc6c586fab..3d3b43374338591de42c7baf463a63090168e6bf 100644 (file)
@@ -19,6 +19,7 @@
 #include <stdlib.h>
 #include <stdarg.h>
 #include <time.h>
+#include <unistd.h>
 
 #include "nest/bird.h"
 #include "nest/cli.h"
index 83f61af909d2d491e9bf662778a8221977c85563..1a461ee1d34086de83e40abfe76dfe5a655d4781 100644 (file)
@@ -17,6 +17,7 @@ void async_config(void);
 void async_dump(void);
 void async_shutdown(void);
 void cmd_reconfig(char *name, int type);
+void cmd_shutdown(void);
 
 /* io.c */