mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-22 17:51:53 +00:00
Merge commit '3186ffe79714a48542d5ad61a94c81216b522fd0' into thread-next
This commit is contained in:
commit
02b2a4ecaa
@ -219,6 +219,18 @@ function t_int()
|
|||||||
bt_assert(123/45 = 2);
|
bt_assert(123/45 = 2);
|
||||||
bt_assert(0xfee1a | 0xbeef = 0xffeff);
|
bt_assert(0xfee1a | 0xbeef = 0xffeff);
|
||||||
bt_assert(0xfee1a & 0xbeef = 0xae0a);
|
bt_assert(0xfee1a & 0xbeef = 0xae0a);
|
||||||
|
|
||||||
|
case i {
|
||||||
|
4200000000: bt_assert(true);
|
||||||
|
else: bt_assert(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
case four {
|
||||||
|
4: bt_assert(true);
|
||||||
|
else: bt_assert(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bt_test_suite(t_int, "Testing integers");
|
bt_test_suite(t_int, "Testing integers");
|
||||||
|
@ -2431,7 +2431,7 @@ bgp_show_afis(int code, char *s, u32 *afis, uint count)
|
|||||||
cli_msg(code, b.start);
|
cli_msg(code, b.start);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
const char *
|
||||||
bgp_format_role_name(u8 role)
|
bgp_format_role_name(u8 role)
|
||||||
{
|
{
|
||||||
static const char *bgp_role_names[] = { "provider", "rs_server", "rs_client", "customer", "peer" };
|
static const char *bgp_role_names[] = { "provider", "rs_server", "rs_client", "customer", "peer" };
|
||||||
|
@ -554,9 +554,7 @@ void bgp_refresh_begin(struct bgp_channel *c);
|
|||||||
void bgp_refresh_end(struct bgp_channel *c);
|
void bgp_refresh_end(struct bgp_channel *c);
|
||||||
void bgp_store_error(struct bgp_proto *p, struct bgp_conn *c, u8 class, u32 code);
|
void bgp_store_error(struct bgp_proto *p, struct bgp_conn *c, u8 class, u32 code);
|
||||||
void bgp_stop(struct bgp_proto *p, int subcode, byte *data, uint len);
|
void bgp_stop(struct bgp_proto *p, int subcode, byte *data, uint len);
|
||||||
|
const char *bgp_format_role_name(u8 role);
|
||||||
struct rte_source *bgp_find_source(struct bgp_proto *p, u32 path_id);
|
|
||||||
struct rte_source *bgp_get_source(struct bgp_proto *p, u32 path_id);
|
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
rte_resolvable(const rte *rt)
|
rte_resolvable(const rte *rt)
|
||||||
|
@ -908,10 +908,10 @@ bgp_rx_open(struct bgp_conn *conn, byte *pkt, uint len)
|
|||||||
(local_role == BGP_ROLE_PROVIDER && neigh_role == BGP_ROLE_CUSTOMER) ||
|
(local_role == BGP_ROLE_PROVIDER && neigh_role == BGP_ROLE_CUSTOMER) ||
|
||||||
(local_role == BGP_ROLE_RS_CLIENT && neigh_role == BGP_ROLE_RS_SERVER) ||
|
(local_role == BGP_ROLE_RS_CLIENT && neigh_role == BGP_ROLE_RS_SERVER) ||
|
||||||
(local_role == BGP_ROLE_RS_SERVER && neigh_role == BGP_ROLE_RS_CLIENT)))
|
(local_role == BGP_ROLE_RS_SERVER && neigh_role == BGP_ROLE_RS_CLIENT)))
|
||||||
{ bgp_error(conn, 2, 11, NULL, 0); return; }
|
{ bgp_error(conn, 2, 11, &neigh_role, -1); return; }
|
||||||
|
|
||||||
if ((p->cf->require_roles) && (neigh_role == BGP_ROLE_UNDEFINED))
|
if ((p->cf->require_roles) && (neigh_role == BGP_ROLE_UNDEFINED))
|
||||||
{ bgp_error(conn, 2, 11, NULL, 0); return; }
|
{ bgp_error(conn, 2, 11, &neigh_role, -1); return; }
|
||||||
|
|
||||||
/* Check the other connection */
|
/* Check the other connection */
|
||||||
other = (conn == &p->outgoing_conn) ? &p->incoming_conn : &p->outgoing_conn;
|
other = (conn == &p->outgoing_conn) ? &p->incoming_conn : &p->outgoing_conn;
|
||||||
@ -3152,6 +3152,12 @@ bgp_log_error(struct bgp_proto *p, u8 class, char *msg, uint code, uint subcode,
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((code == 2) && (subcode == 11) && (len == 1))
|
||||||
|
{
|
||||||
|
t += bsprintf(t, " (%s)", bgp_format_role_name(get_u8(data)));
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
/* RFC 8203 - shutdown communication */
|
/* RFC 8203 - shutdown communication */
|
||||||
if (((code == 6) && ((subcode == 2) || (subcode == 4))))
|
if (((code == 6) && ((subcode == 2) || (subcode == 4))))
|
||||||
if (bgp_handle_message(p, data, len, &t))
|
if (bgp_handle_message(p, data, len, &t))
|
||||||
|
@ -43,10 +43,6 @@
|
|||||||
|
|
||||||
#include "pipe.h"
|
#include "pipe.h"
|
||||||
|
|
||||||
#ifdef CONFIG_BGP
|
|
||||||
#include "proto/bgp/bgp.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pipe_rt_notify(struct proto *P, struct channel *src_ch, const net_addr *n, rte *new, const rte *old)
|
pipe_rt_notify(struct proto *P, struct channel *src_ch, const net_addr *n, rte *new, const rte *old)
|
||||||
{
|
{
|
||||||
|
@ -22,6 +22,9 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_DISABLE_THP
|
#ifdef CONFIG_DISABLE_THP
|
||||||
#include <sys/prctl.h>
|
#include <sys/prctl.h>
|
||||||
|
#ifndef PR_SET_THP_DISABLE
|
||||||
|
#define PR_SET_THP_DISABLE 41
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
long page_size = 0;
|
long page_size = 0;
|
||||||
@ -78,7 +81,7 @@ alloc_sys_page(void)
|
|||||||
void *ptr = mmap(NULL, page_size * ALLOC_PAGES_AT_ONCE, PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
void *ptr = mmap(NULL, page_size * ALLOC_PAGES_AT_ONCE, PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
||||||
|
|
||||||
if (ptr == MAP_FAILED)
|
if (ptr == MAP_FAILED)
|
||||||
bug("mmap(%lu) failed: %m", page_size);
|
die("mmap(%ld) failed: %m", (s64) page_size);
|
||||||
|
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
@ -99,7 +102,7 @@ alloc_page(void)
|
|||||||
int err = posix_memalign(&ptr, page_size, page_size);
|
int err = posix_memalign(&ptr, page_size, page_size);
|
||||||
|
|
||||||
if (err || !ptr)
|
if (err || !ptr)
|
||||||
bug("posix_memalign(%lu) failed", (long unsigned int) page_size);
|
die("posix_memalign(%ld) failed", (s64) page_size);
|
||||||
|
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
@ -298,7 +301,7 @@ resource_sys_init(void)
|
|||||||
#ifdef CONFIG_DISABLE_THP
|
#ifdef CONFIG_DISABLE_THP
|
||||||
/* Disable transparent huge pages, they do not work properly with madvice(MADV_DONTNEED) */
|
/* Disable transparent huge pages, they do not work properly with madvice(MADV_DONTNEED) */
|
||||||
if (prctl(PR_SET_THP_DISABLE, (unsigned long) 1, (unsigned long) 0, (unsigned long) 0, (unsigned long) 0) < 0)
|
if (prctl(PR_SET_THP_DISABLE, (unsigned long) 1, (unsigned long) 0, (unsigned long) 0, (unsigned long) 0) < 0)
|
||||||
die("prctl(PR_SET_THP_DISABLE) failed: %m");
|
log(L_WARN "Cannot disable transparent huge pages: prctl(PR_SET_THP_DISABLE) failed: %m");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_MMAP
|
#ifdef HAVE_MMAP
|
||||||
|
Loading…
Reference in New Issue
Block a user