{
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;
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; }
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;