mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 21:57:36 +00:00
babeld: address some other compilation warnings.
This commit is contained in:
parent
3dbda0ceeb
commit
c7c53fa88c
@ -61,7 +61,7 @@ static int interface_reset(struct interface *ifp);
|
|||||||
static int babel_if_new_hook (struct interface *ifp);
|
static int babel_if_new_hook (struct interface *ifp);
|
||||||
static int babel_if_delete_hook (struct interface *ifp);
|
static int babel_if_delete_hook (struct interface *ifp);
|
||||||
static int interface_config_write (struct vty *vty);
|
static int interface_config_write (struct vty *vty);
|
||||||
static babel_interface_nfo * babel_interface_allocate ();
|
static babel_interface_nfo * babel_interface_allocate (void);
|
||||||
static void babel_interface_free (babel_interface_nfo *bi);
|
static void babel_interface_free (babel_interface_nfo *bi);
|
||||||
|
|
||||||
|
|
||||||
@ -738,7 +738,7 @@ interface_config_write (struct vty *vty)
|
|||||||
/* functions to allocate or free memory for a babel_interface_nfo, filling
|
/* functions to allocate or free memory for a babel_interface_nfo, filling
|
||||||
needed fields */
|
needed fields */
|
||||||
static babel_interface_nfo *
|
static babel_interface_nfo *
|
||||||
babel_interface_allocate ()
|
babel_interface_allocate (void)
|
||||||
{
|
{
|
||||||
babel_interface_nfo *babel_ifp;
|
babel_interface_nfo *babel_ifp;
|
||||||
babel_ifp = XMALLOC(MTYPE_BABEL_IF, sizeof(babel_interface_nfo));
|
babel_ifp = XMALLOC(MTYPE_BABEL_IF, sizeof(babel_interface_nfo));
|
||||||
|
@ -217,13 +217,13 @@ reset_txcost(struct neighbour *neigh)
|
|||||||
|
|
||||||
delay = timeval_minus_msec(&babel_now, &neigh->ihu_time);
|
delay = timeval_minus_msec(&babel_now, &neigh->ihu_time);
|
||||||
|
|
||||||
if(neigh->ihu_interval > 0 && delay < neigh->ihu_interval * 10 * 3)
|
if(neigh->ihu_interval > 0 && delay < neigh->ihu_interval * 10U * 3U)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* If we're losing a lot of packets, we probably lost an IHU too */
|
/* If we're losing a lot of packets, we probably lost an IHU too */
|
||||||
if(delay >= 180000 || (neigh->reach & 0xFFF0) == 0 ||
|
if(delay >= 180000 || (neigh->reach & 0xFFF0) == 0 ||
|
||||||
(neigh->ihu_interval > 0 &&
|
(neigh->ihu_interval > 0 &&
|
||||||
delay >= neigh->ihu_interval * 10 * 10)) {
|
delay >= neigh->ihu_interval * 10U * 10U)) {
|
||||||
neigh->txcost = INFINITY;
|
neigh->txcost = INFINITY;
|
||||||
neigh->ihu_time = babel_now;
|
neigh->ihu_time = babel_now;
|
||||||
return 1;
|
return 1;
|
||||||
@ -266,9 +266,9 @@ check_neighbours()
|
|||||||
update_neighbour_metric(neigh, changed);
|
update_neighbour_metric(neigh, changed);
|
||||||
|
|
||||||
if(neigh->hello_interval > 0)
|
if(neigh->hello_interval > 0)
|
||||||
msecs = MIN(msecs, neigh->hello_interval * 10);
|
msecs = MIN(msecs, neigh->hello_interval * 10U);
|
||||||
if(neigh->ihu_interval > 0)
|
if(neigh->ihu_interval > 0)
|
||||||
msecs = MIN(msecs, neigh->ihu_interval * 10);
|
msecs = MIN(msecs, neigh->ihu_interval * 10U);
|
||||||
neigh = neigh->next;
|
neigh = neigh->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ struct babel_route {
|
|||||||
short installed;
|
short installed;
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline int
|
static inline unsigned short
|
||||||
route_metric(const struct babel_route *route)
|
route_metric(const struct babel_route *route)
|
||||||
{
|
{
|
||||||
return route->metric;
|
return route->metric;
|
||||||
|
@ -42,10 +42,10 @@ THE SOFTWARE.
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
#if defined(i386) || defined(__mc68020__) || defined(__x86_64__)
|
#if defined(i386) || defined(__mc68020__) || defined(__x86_64__)
|
||||||
#define DO_NTOHS(_d, _s) do { _d = ntohs(*(unsigned short*)(_s)); } while(0)
|
#define DO_NTOHS(_d, _s) do{ _d = ntohs(*(const unsigned short*)(_s)); }while(0)
|
||||||
#define DO_NTOHL(_d, _s) do { _d = ntohl(*(unsigned*)(_s)); } while(0)
|
#define DO_NTOHL(_d, _s) do{ _d = ntohl(*(const unsigned*)(_s)); } while(0)
|
||||||
#define DO_HTONS(_d, _s) do { *(unsigned short*)(_d) = htons(_s); } while(0)
|
#define DO_HTONS(_d, _s) do{ *(unsigned short*)(_d) = htons(_s); } while(0)
|
||||||
#define DO_HTONL(_d, _s) do { *(unsigned*)(_d) = htonl(_s); } while(0)
|
#define DO_HTONL(_d, _s) do{ *(unsigned*)(_d) = htonl(_s); } while(0)
|
||||||
/* Some versions of gcc seem to be buggy, and ignore the packed attribute.
|
/* Some versions of gcc seem to be buggy, and ignore the packed attribute.
|
||||||
Disable this code until the issue is clarified. */
|
Disable this code until the issue is clarified. */
|
||||||
/* #elif defined __GNUC__*/
|
/* #elif defined __GNUC__*/
|
||||||
|
Loading…
Reference in New Issue
Block a user