mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 13:33:15 +00:00
Merge branch 'frr/pull/93'
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
commit
290c1eb150
@ -700,16 +700,16 @@ bgp_show_dampening_parameters (struct vty *vty, afi_t afi, safi_t safi)
|
|||||||
|
|
||||||
if (CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING))
|
if (CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING))
|
||||||
{
|
{
|
||||||
vty_out (vty, "Half-life time: %ld min%s",
|
vty_out (vty, "Half-life time: %lld min%s",
|
||||||
damp->half_life / 60, VTY_NEWLINE);
|
(long long)damp->half_life / 60, VTY_NEWLINE);
|
||||||
vty_out (vty, "Reuse penalty: %d%s",
|
vty_out (vty, "Reuse penalty: %d%s",
|
||||||
damp->reuse_limit, VTY_NEWLINE);
|
damp->reuse_limit, VTY_NEWLINE);
|
||||||
vty_out (vty, "Suppress penalty: %d%s",
|
vty_out (vty, "Suppress penalty: %d%s",
|
||||||
damp->suppress_value, VTY_NEWLINE);
|
damp->suppress_value, VTY_NEWLINE);
|
||||||
vty_out (vty, "Max suppress time: %ld min%s",
|
vty_out (vty, "Max suppress time: %lld min%s",
|
||||||
damp->max_suppress_time / 60, VTY_NEWLINE);
|
(long long)damp->max_suppress_time / 60, VTY_NEWLINE);
|
||||||
vty_out (vty, "Max supress penalty: %u%s",
|
vty_out (vty, "Max supress penalty: %u%s",
|
||||||
damp->ceiling, VTY_NEWLINE);
|
damp->ceiling, VTY_NEWLINE);
|
||||||
vty_out (vty, "%s", VTY_NEWLINE);
|
vty_out (vty, "%s", VTY_NEWLINE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -7431,7 +7431,8 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
|
|||||||
|
|
||||||
/* BGP Version. */
|
/* BGP Version. */
|
||||||
json_object_int_add(json_neigh, "bgpVersion", 4);
|
json_object_int_add(json_neigh, "bgpVersion", 4);
|
||||||
json_object_string_add(json_neigh, "remoteRouterId", inet_ntop (AF_INET, &p->remote_id, buf1, BUFSIZ));
|
json_object_string_add(json_neigh, "remoteRouterId",
|
||||||
|
inet_ntop (AF_INET, &p->remote_id, buf1, sizeof(buf1)));
|
||||||
|
|
||||||
/* Confederation */
|
/* Confederation */
|
||||||
if (CHECK_FLAG (bgp->config, BGP_CONFIG_CONFEDERATION) && bgp_confederation_peers_check (bgp, p->as))
|
if (CHECK_FLAG (bgp->config, BGP_CONFIG_CONFEDERATION) && bgp_confederation_peers_check (bgp, p->as))
|
||||||
@ -7498,7 +7499,8 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
|
|||||||
|
|
||||||
/* BGP Version. */
|
/* BGP Version. */
|
||||||
vty_out (vty, " BGP version 4");
|
vty_out (vty, " BGP version 4");
|
||||||
vty_out (vty, ", remote router ID %s%s", inet_ntop (AF_INET, &p->remote_id, buf1, BUFSIZ),
|
vty_out (vty, ", remote router ID %s%s",
|
||||||
|
inet_ntop (AF_INET, &p->remote_id, buf1, sizeof(buf1)),
|
||||||
VTY_NEWLINE);
|
VTY_NEWLINE);
|
||||||
|
|
||||||
/* Confederation */
|
/* Confederation */
|
||||||
@ -8300,9 +8302,12 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
|
|||||||
{
|
{
|
||||||
if (use_json)
|
if (use_json)
|
||||||
{
|
{
|
||||||
json_object_string_add(json_neigh, "nexthop", inet_ntop (AF_INET, &p->nexthop.v4, buf1, BUFSIZ));
|
json_object_string_add(json_neigh, "nexthop",
|
||||||
json_object_string_add(json_neigh, "nexthopGlobal", inet_ntop (AF_INET6, &p->nexthop.v6_global, buf1, BUFSIZ));
|
inet_ntop (AF_INET, &p->nexthop.v4, buf1, sizeof(buf1)));
|
||||||
json_object_string_add(json_neigh, "nexthopLocal", inet_ntop (AF_INET6, &p->nexthop.v6_local, buf1, BUFSIZ));
|
json_object_string_add(json_neigh, "nexthopGlobal",
|
||||||
|
inet_ntop (AF_INET6, &p->nexthop.v6_global, buf1, sizeof(buf1)));
|
||||||
|
json_object_string_add(json_neigh, "nexthopLocal",
|
||||||
|
inet_ntop (AF_INET6, &p->nexthop.v6_local, buf1, sizeof(buf1)));
|
||||||
if (p->shared_network)
|
if (p->shared_network)
|
||||||
json_object_string_add(json_neigh, "bgpConnection", "sharedNetwork");
|
json_object_string_add(json_neigh, "bgpConnection", "sharedNetwork");
|
||||||
else
|
else
|
||||||
@ -8311,17 +8316,17 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
vty_out (vty, "Nexthop: %s%s",
|
vty_out (vty, "Nexthop: %s%s",
|
||||||
inet_ntop (AF_INET, &p->nexthop.v4, buf1, BUFSIZ),
|
inet_ntop (AF_INET, &p->nexthop.v4, buf1, sizeof(buf1)),
|
||||||
VTY_NEWLINE);
|
VTY_NEWLINE);
|
||||||
vty_out (vty, "Nexthop global: %s%s",
|
vty_out (vty, "Nexthop global: %s%s",
|
||||||
inet_ntop (AF_INET6, &p->nexthop.v6_global, buf1, BUFSIZ),
|
inet_ntop (AF_INET6, &p->nexthop.v6_global, buf1, sizeof(buf1)),
|
||||||
VTY_NEWLINE);
|
VTY_NEWLINE);
|
||||||
vty_out (vty, "Nexthop local: %s%s",
|
vty_out (vty, "Nexthop local: %s%s",
|
||||||
inet_ntop (AF_INET6, &p->nexthop.v6_local, buf1, BUFSIZ),
|
inet_ntop (AF_INET6, &p->nexthop.v6_local, buf1, sizeof(buf1)),
|
||||||
VTY_NEWLINE);
|
VTY_NEWLINE);
|
||||||
vty_out (vty, "BGP connection: %s%s",
|
vty_out (vty, "BGP connection: %s%s",
|
||||||
p->shared_network ? "shared network" : "non shared network",
|
p->shared_network ? "shared network" : "non shared network",
|
||||||
VTY_NEWLINE);
|
VTY_NEWLINE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ rfapiDebugBacktrace (void)
|
|||||||
|
|
||||||
for (i = 0; i < size && i < RFAPI_DEBUG_BACKTRACE_NENTRIES; ++i)
|
for (i = 0; i < size && i < RFAPI_DEBUG_BACKTRACE_NENTRIES; ++i)
|
||||||
{
|
{
|
||||||
vnc_zlog_debug_verbose ("backtrace[%2lu]: %s", i, syms[i]);
|
vnc_zlog_debug_verbose ("backtrace[%2zu]: %s", i, syms[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
free (syms);
|
free (syms);
|
||||||
|
@ -223,6 +223,7 @@ clear(struct pid_list **list)
|
|||||||
*list = NULL;
|
*list = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef linux
|
||||||
static const char *
|
static const char *
|
||||||
next_dirname(const char *s)
|
next_dirname(const char *s)
|
||||||
{
|
{
|
||||||
@ -242,7 +243,6 @@ next_dirname(const char *s)
|
|||||||
return cur;
|
return cur;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef linux
|
|
||||||
static void
|
static void
|
||||||
add_namespace(const char *path)
|
add_namespace(const char *path)
|
||||||
{
|
{
|
||||||
|
@ -78,7 +78,10 @@ open_bpf_dev (struct isis_circuit *circuit)
|
|||||||
int i = 0, fd;
|
int i = 0, fd;
|
||||||
char bpfdev[128];
|
char bpfdev[128];
|
||||||
struct ifreq ifr;
|
struct ifreq ifr;
|
||||||
u_int blen, immediate, seesent;
|
u_int blen, immediate;
|
||||||
|
#ifdef BIOCSSEESENT
|
||||||
|
u_int seesent;
|
||||||
|
#endif
|
||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
struct bpf_program bpf_prog;
|
struct bpf_program bpf_prog;
|
||||||
|
|
||||||
|
50
lib/wheel.h
50
lib/wheel.h
@ -40,9 +40,49 @@ struct timer_wheel
|
|||||||
void (*slot_run) (void *);
|
void (*slot_run) (void *);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Creates a timer wheel
|
||||||
|
*
|
||||||
|
* master - Thread master structure for the process
|
||||||
|
* period - The Time in seconds that the timer wheel will
|
||||||
|
* take before it starts issuing commands again
|
||||||
|
* for items in each slot
|
||||||
|
* slots - The number of slots to have in this particular
|
||||||
|
* timer wheel
|
||||||
|
* slot_key - A hashing function of some sort that will allow
|
||||||
|
* the timer wheel to put items into individual slots
|
||||||
|
* slot_run - The function to run over each item in a particular slot
|
||||||
|
*
|
||||||
|
* Creates a timer wheel that will wake up 'slots' times over the entire
|
||||||
|
* wheel. Each time the timer wheel wakes up it will iterate through
|
||||||
|
* and run the slot_run function for each item stored in that particular
|
||||||
|
* slot.
|
||||||
|
*
|
||||||
|
* The timer code is 'intelligent' in that it notices if anything is
|
||||||
|
* in a particular slot and can schedule the next timer to skip
|
||||||
|
* the empty slot.
|
||||||
|
*
|
||||||
|
* The general purpose of a timer wheel is to reduce events in a system.
|
||||||
|
* A perfect example of usage for this is say hello packets that need
|
||||||
|
* to be sent out to all your neighbors. Suppose a large routing protocol
|
||||||
|
* has to send keepalive packets every Y seconds to each of it's peers.
|
||||||
|
* At scale we can have a very large number of peers, X.
|
||||||
|
* This means that we will have X timing events every Y seconds.
|
||||||
|
* If you replace these events with a timer wheel that has Z slots
|
||||||
|
* you will have at most Y/Z timer events if each slot has a work item
|
||||||
|
* in it.
|
||||||
|
*
|
||||||
|
* When X is large the number of events in a system can quickly escalate
|
||||||
|
* and cause significant amount of time handling thread events instead
|
||||||
|
* of running your code.
|
||||||
|
*/
|
||||||
struct timer_wheel *wheel_init (struct thread_master *master, int period, size_t slots,
|
struct timer_wheel *wheel_init (struct thread_master *master, int period, size_t slots,
|
||||||
unsigned int (*slot_key) (void *),
|
unsigned int (*slot_key) (void *),
|
||||||
void (*slot_run) (void *));
|
void (*slot_run) (void *));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Delete the specified timer wheel created
|
||||||
|
*/
|
||||||
void wheel_delete (struct timer_wheel *);
|
void wheel_delete (struct timer_wheel *);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -51,17 +91,25 @@ void wheel_delete (struct timer_wheel *);
|
|||||||
int wheel_stop (struct timer_wheel *wheel);
|
int wheel_stop (struct timer_wheel *wheel);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Start the wheel from running again
|
* Start the wheel running again
|
||||||
*/
|
*/
|
||||||
int wheel_start (struct timer_wheel *wheel);
|
int wheel_start (struct timer_wheel *wheel);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
* wheel - The Timer wheel being modified
|
||||||
|
* item - The generic data structure that will be handed
|
||||||
|
* to the slot_run function.
|
||||||
|
*
|
||||||
* Add item to a slot setup by the slot_key,
|
* Add item to a slot setup by the slot_key,
|
||||||
* possibly change next time pop.
|
* possibly change next time pop.
|
||||||
*/
|
*/
|
||||||
int wheel_add_item (struct timer_wheel *wheel, void *item);
|
int wheel_add_item (struct timer_wheel *wheel, void *item);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
* wheel - The Timer wheel being modified.
|
||||||
|
* item - The item to remove from one of the slots in
|
||||||
|
* the timer wheel.
|
||||||
|
*
|
||||||
* Remove a item to a slot setup by the slot_key,
|
* Remove a item to a slot setup by the slot_key,
|
||||||
* possibly change next time pop.
|
* possibly change next time pop.
|
||||||
*/
|
*/
|
||||||
|
@ -105,7 +105,7 @@ interface_list_ioctl (void)
|
|||||||
#ifdef OPEN_BSD
|
#ifdef OPEN_BSD
|
||||||
for (n = 0; n < ifconf.ifc_len; )
|
for (n = 0; n < ifconf.ifc_len; )
|
||||||
{
|
{
|
||||||
int size;
|
unsigned int size;
|
||||||
|
|
||||||
ifreq = (struct ifreq *)((caddr_t) ifconf.ifc_req + n);
|
ifreq = (struct ifreq *)((caddr_t) ifconf.ifc_req + n);
|
||||||
ifp = if_get_by_name_len(ifreq->ifr_name,
|
ifp = if_get_by_name_len(ifreq->ifr_name,
|
||||||
|
@ -927,7 +927,7 @@ rtm_read (struct rt_msghdr *rtm)
|
|||||||
int ret;
|
int ret;
|
||||||
if (! IS_ZEBRA_DEBUG_RIB)
|
if (! IS_ZEBRA_DEBUG_RIB)
|
||||||
return;
|
return;
|
||||||
ret = rib_lookup_ipv4_route (&p, &gate, VRF_DEFAULT);
|
ret = rib_lookup_ipv4_route ((struct prefix_ipv4 *)&p, &gate, VRF_DEFAULT);
|
||||||
prefix2str (&p, buf, sizeof(buf));
|
prefix2str (&p, buf, sizeof(buf));
|
||||||
switch (rtm->rtm_type)
|
switch (rtm->rtm_type)
|
||||||
{
|
{
|
||||||
@ -951,7 +951,7 @@ rtm_read (struct rt_msghdr *rtm)
|
|||||||
case ZEBRA_RIB_FOUND_EXACT: /* RIB RR == FIB RR */
|
case ZEBRA_RIB_FOUND_EXACT: /* RIB RR == FIB RR */
|
||||||
zlog_debug ("%s: %s %s: done Ok",
|
zlog_debug ("%s: %s %s: done Ok",
|
||||||
__func__, lookup (rtm_type_str, rtm->rtm_type), buf);
|
__func__, lookup (rtm_type_str, rtm->rtm_type), buf);
|
||||||
rib_lookup_and_dump (&p, VRF_DEFAULT);
|
rib_lookup_and_dump ((struct prefix_ipv4 *)&p, VRF_DEFAULT);
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -964,18 +964,18 @@ rtm_read (struct rt_msghdr *rtm)
|
|||||||
case ZEBRA_RIB_FOUND_EXACT:
|
case ZEBRA_RIB_FOUND_EXACT:
|
||||||
zlog_debug ("%s: %s %s: desync: RR is still in RIB, while already not in FIB",
|
zlog_debug ("%s: %s %s: desync: RR is still in RIB, while already not in FIB",
|
||||||
__func__, lookup (rtm_type_str, rtm->rtm_type), buf);
|
__func__, lookup (rtm_type_str, rtm->rtm_type), buf);
|
||||||
rib_lookup_and_dump (&p, VRF_DEFAULT);
|
rib_lookup_and_dump ((struct prefix_ipv4 *)&p, VRF_DEFAULT);
|
||||||
break;
|
break;
|
||||||
case ZEBRA_RIB_FOUND_CONNECTED:
|
case ZEBRA_RIB_FOUND_CONNECTED:
|
||||||
case ZEBRA_RIB_FOUND_NOGATE:
|
case ZEBRA_RIB_FOUND_NOGATE:
|
||||||
zlog_debug ("%s: %s %s: desync: RR is still in RIB, plus gate differs",
|
zlog_debug ("%s: %s %s: desync: RR is still in RIB, plus gate differs",
|
||||||
__func__, lookup (rtm_type_str, rtm->rtm_type), buf);
|
__func__, lookup (rtm_type_str, rtm->rtm_type), buf);
|
||||||
rib_lookup_and_dump (&p, VRF_DEFAULT);
|
rib_lookup_and_dump ((struct prefix_ipv4 *)&p, VRF_DEFAULT);
|
||||||
break;
|
break;
|
||||||
case ZEBRA_RIB_NOTFOUND: /* RIB RR == FIB RR */
|
case ZEBRA_RIB_NOTFOUND: /* RIB RR == FIB RR */
|
||||||
zlog_debug ("%s: %s %s: done Ok",
|
zlog_debug ("%s: %s %s: done Ok",
|
||||||
__func__, lookup (rtm_type_str, rtm->rtm_type), buf);
|
__func__, lookup (rtm_type_str, rtm->rtm_type), buf);
|
||||||
rib_lookup_and_dump (&p, VRF_DEFAULT);
|
rib_lookup_and_dump ((struct prefix_ipv4 *)&p, VRF_DEFAULT);
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -883,7 +883,9 @@ zfpm_encode_route (rib_dest_t *dest, struct rib *rib, char *in_buf,
|
|||||||
size_t in_buf_len, fpm_msg_type_e *msg_type)
|
size_t in_buf_len, fpm_msg_type_e *msg_type)
|
||||||
{
|
{
|
||||||
size_t len;
|
size_t len;
|
||||||
|
#ifdef HAVE_NETLINK
|
||||||
int cmd;
|
int cmd;
|
||||||
|
#endif
|
||||||
len = 0;
|
len = 0;
|
||||||
|
|
||||||
*msg_type = FPM_MSG_TYPE_NONE;
|
*msg_type = FPM_MSG_TYPE_NONE;
|
||||||
|
@ -2386,7 +2386,7 @@ zebra_find_client (u_char proto)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_NETLINK
|
||||||
/* Display default rtm_table for all clients. */
|
/* Display default rtm_table for all clients. */
|
||||||
DEFUN (show_table,
|
DEFUN (show_table,
|
||||||
show_table_cmd,
|
show_table_cmd,
|
||||||
@ -2419,6 +2419,7 @@ DEFUN (no_config_table,
|
|||||||
zebrad.rtm_table_default = 0;
|
zebrad.rtm_table_default = 0;
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
DEFUN (ip_forwarding,
|
DEFUN (ip_forwarding,
|
||||||
ip_forwarding_cmd,
|
ip_forwarding_cmd,
|
||||||
|
Loading…
Reference in New Issue
Block a user