summaryrefslogtreecommitdiff
path: root/bgpd/bgp_snmp.c
diff options
context:
space:
mode:
authorPat Ruddy <pat@voltanet.io>2020-11-03 17:05:24 +0000
committerPat Ruddy <pat@voltanet.io>2021-02-02 09:37:15 +0000
commitc1e99f63fdc1ebdf82e670f3b901a3e0622768e0 (patch)
tree6faeaec3edf7297ccb19106b9c6f5187fc06f6f0 /bgpd/bgp_snmp.c
parent8db8e86a91e37c7f67160f4afedb8dec59f0be05 (diff)
bgpd: update traps to RFC4273 Notifications
The old bgpTraps group was obsolteted by RFC4273 and the bgpNotifications groups was introduces. The new notifications mirror the bgpTraps except that an extra item peerRemoteAddr is sent in the notification. This upgrades the support to conform with RFC4273 Signed-off-by: Pat Ruddy <pat@voltanet.io>
Diffstat (limited to 'bgpd/bgp_snmp.c')
-rw-r--r--bgpd/bgp_snmp.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/bgpd/bgp_snmp.c b/bgpd/bgp_snmp.c
index 76f8b8712b..00d225bf65 100644
--- a/bgpd/bgp_snmp.c
+++ b/bgpd/bgp_snmp.c
@@ -850,8 +850,9 @@ static uint8_t *bgp4PathAttrTable(struct variable *v, oid name[],
}
/* BGP Traps. */
-static struct trap_object bgpTrapList[] = {{3, {3, 1, BGPPEERLASTERROR}},
- {3, {3, 1, BGPPEERSTATE}}};
+static struct trap_object bgpTrapList[] = {{3, {3, 1, BGPPEERREMOTEADDR} },
+ {3, {3, 1, BGPPEERLASTERROR} },
+ {3, {3, 1, BGPPEERSTATE} } };
static int bgpTrapEstablished(struct peer *peer)
{
@@ -869,10 +870,10 @@ static int bgpTrapEstablished(struct peer *peer)
oid_copy_addr(index, &addr, IN_ADDR_SIZE);
- smux_trap(bgp_variables, array_size(bgp_variables), bgp_trap_oid,
- array_size(bgp_trap_oid), bgp_oid,
- sizeof(bgp_oid) / sizeof(oid), index, IN_ADDR_SIZE,
- bgpTrapList, array_size(bgpTrapList), BGPESTABLISHED);
+ ret = smux_trap(bgp_variables, array_size(bgp_variables), bgp_trap_oid,
+ array_size(bgp_trap_oid), bgp_oid,
+ sizeof(bgp_oid) / sizeof(oid), index, IN_ADDR_SIZE,
+ bgpTrapList, array_size(bgpTrapList), BGPESTABLISHED);
return 0;
}