mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-12 14:18:43 +00:00
fixup! tcp ao: key change works
This commit is contained in:
parent
8ba3396989
commit
82134476be
@ -2158,7 +2158,7 @@ int compare_aos(struct ao_key *a, struct ao_key *b)
|
||||
{
|
||||
if (a->local_id != b->local_id)
|
||||
return 1;
|
||||
if (a->remote_id != b->local_id)
|
||||
if (a->remote_id != b->remote_id)
|
||||
return 1;
|
||||
if (strcmp(a->cipher, b->cipher))
|
||||
return 1;
|
||||
|
@ -257,13 +257,13 @@ ao_first_item:
|
||||
|
||||
ao_item:
|
||||
REMOTE ID expr ';' {log("remote id %i", $3); BGP_CFG->ao_key->remote_id = $3; }
|
||||
| CIPHER text ';' { char *c = lp_alloc(BGP_CFG->ao_lp, strlen($2)+1);
|
||||
memcpy(c, $2, strlen($2)+1);
|
||||
| CIPHER text ';' { char *c = lp_alloc(BGP_CFG->ao_lp, strlen($2));
|
||||
memcpy(c, $2, strlen($2));
|
||||
BGP_CFG->ao_key->cipher = c;
|
||||
log("ciph[%s]", $2); }
|
||||
| MASTER KEY text ';' {
|
||||
char *k = lp_alloc(BGP_CFG->ao_lp, strlen($3)+1);
|
||||
memcpy(k, $3, strlen($3)+1);
|
||||
char *k = lp_alloc(BGP_CFG->ao_lp, strlen($3));
|
||||
memcpy(k, $3, strlen($3));
|
||||
BGP_CFG->ao_key->master_key = k;
|
||||
log("key[%s]", BGP_CFG->ao_key->master_key);}
|
||||
| DEPRECATED ';' { BGP_CFG->ao_key->required = -1; }
|
||||
|
@ -244,7 +244,7 @@ int get_current_key_id(int sock_fd)
|
||||
memset(&tmp, 0, sizeof(struct tcp_ao_info_opt_ext));
|
||||
socklen_t len = sizeof(tmp);
|
||||
|
||||
if (getsockopt(sock_fd, IPPROTO_TCP, TCP_AO_INFO, &tmp, len))
|
||||
if (getsockopt(sock_fd, IPPROTO_TCP, TCP_AO_INFO, &tmp, &len))
|
||||
{
|
||||
log("get current ao key failed %i", errno);
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user