0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2025-01-02 23:21:54 +00:00

SNMP: AgentX master agent can have IPv6 addr

This commit is contained in:
Vojtech Vilimek 2024-07-26 12:28:33 +02:00
parent 4b739be07c
commit ffda7d1b2a
3 changed files with 7 additions and 7 deletions

View File

@ -45,7 +45,7 @@ snmp_proto_item:
if (SNMP_CFG->trans_type != SNMP_TRANS_DEFAULT) if (SNMP_CFG->trans_type != SNMP_TRANS_DEFAULT)
cf_error("Duplicit option remote address"); cf_error("Duplicit option remote address");
} }
| REMOTE ADDRESS IP4 { | REMOTE ADDRESS ipa {
if (SNMP_CFG->trans_type != SNMP_TRANS_DEFAULT) if (SNMP_CFG->trans_type != SNMP_TRANS_DEFAULT)
cf_error("Duplicit option remote address"); cf_error("Duplicit option remote address");
@ -105,7 +105,7 @@ snmp_proto_start: proto_start SNMP
SNMP_CFG->bonds = 0; SNMP_CFG->bonds = 0;
SNMP_CFG->local_ip = IP4_NONE; SNMP_CFG->local_ip = IP4_NONE;
SNMP_CFG->remote_ip = IP4_NONE; SNMP_CFG->remote_ip = IPA_NONE;
SNMP_CFG->remote_path = agentx_master_addr; SNMP_CFG->remote_path = agentx_master_addr;
SNMP_CFG->trans_type = SNMP_TRANS_DEFAULT; SNMP_CFG->trans_type = SNMP_TRANS_DEFAULT;
SNMP_CFG->bgp_local_id = IP4_NONE; SNMP_CFG->bgp_local_id = IP4_NONE;

View File

@ -235,8 +235,8 @@ snmp_set_state(struct snmp_proto *p, enum snmp_proto_state state)
* lock->iface * lock->iface
* lock->vrf * lock->vrf
*/ */
lock->addr = ipa_from_ip4(cf->remote_ip); lock->addr = p->remote_ip;
lock->port = cf->remote_port; lock->port = p->remote_port;
lock->type = OBJLOCK_TCP; lock->type = OBJLOCK_TCP;
lock->hook = snmp_start_locked; lock->hook = snmp_start_locked;
lock->data = p; lock->data = p;
@ -256,7 +256,7 @@ snmp_set_state(struct snmp_proto *p, enum snmp_proto_state state)
{ {
s->type = SK_TCP_ACTIVE; s->type = SK_TCP_ACTIVE;
s->saddr = ipa_from_ip4(p->local_ip); s->saddr = ipa_from_ip4(p->local_ip);
s->daddr = ipa_from_ip4(p->remote_ip); s->daddr = p->remote_ip;
s->dport = p->remote_port; s->dport = p->remote_port;
s->rbsize = SNMP_RX_BUFFER_SIZE; s->rbsize = SNMP_RX_BUFFER_SIZE;
s->tbsize = SNMP_TX_BUFFER_SIZE; s->tbsize = SNMP_TX_BUFFER_SIZE;

View File

@ -59,7 +59,7 @@ struct snmp_config {
enum snmp_transport_type trans_type; enum snmp_transport_type trans_type;
ip4_addr local_ip; ip4_addr local_ip;
u16 local_port; u16 local_port;
ip4_addr remote_ip; /* master agentx IP address for TCP transport */ ip_addr remote_ip; /* master agentx IP address for TCP transport */
u16 remote_port; u16 remote_port;
const char *remote_path; /* master agentx UNIX socket name */ const char *remote_path; /* master agentx UNIX socket name */
@ -104,7 +104,7 @@ struct snmp_proto {
enum snmp_proto_state state; enum snmp_proto_state state;
ip4_addr local_ip; ip4_addr local_ip;
ip4_addr remote_ip; ip_addr remote_ip;
u16 local_port; u16 local_port;
u16 remote_port; u16 remote_port;