Commit 72c75799 authored by Julien Muchembled's avatar Julien Muchembled

Merge upstream master

parents b3b6cf9b f8bce04c
......@@ -1145,6 +1145,7 @@ parse_config_line(int c, gnc_t gnc, void *closure,
c = parse_filter(c, gnc, closure, &filter);
if(c < -1)
goto fail;
add_filter(filter, &install_filters);
} else if(strcmp(token, "interface") == 0) {
struct interface_conf *if_conf;
c = parse_ifconf(c, gnc, closure, &if_conf);
......
......@@ -1342,13 +1342,16 @@ parse_addr_rta(struct ifaddrmsg *addr, int len, struct in6_addr *res)
struct rtattr *rta;
len -= NLMSG_ALIGN(sizeof(*addr));
rta = IFA_RTA(addr);
int has_local = 0; /* A _LOCAL TLV may be bound with a _ADDRESS' which
represents the peer's address. In this case, ignore _ADDRESS. */
int is_local = 0;
while(RTA_OK(rta, len)) {
switch(rta->rta_type) {
case IFA_LOCAL:
has_local = 1;
/* On some point-to-point technologies, there's both _LOCAL
and _ADDRESS, and _ADDRESS is apparently the peer address
while _LOCAL is the one we want. */
is_local = 1;
/* fallthrough */
case IFA_ADDRESS:
switch(addr->ifa_family) {
case AF_INET:
......@@ -1365,7 +1368,7 @@ parse_addr_rta(struct ifaddrmsg *addr, int len, struct in6_addr *res)
return -1;
break;
}
if(has_local)
if(is_local)
return 0;
break;
default:
......
......@@ -139,6 +139,8 @@ parse_update_subtlv(struct interface *ifp, int metric, int ae,
}
}
*src_plen = 0;
while(i < alen) {
type = a[i];
if(type == SUBTLV_PAD1) {
......@@ -161,6 +163,10 @@ parse_update_subtlv(struct interface *ifp, int metric, int ae,
int rc;
if(len < 1)
goto fail;
if(a[i + 2] == 0) /* source prefix cannot be default */
goto fail;
if(*src_plen != 0) /* source prefix can only be specified once */
goto fail;
*src_plen = a[i + 2];
rc = network_prefix(ae, *src_plen, 0, a + i + 3, NULL,
len - 1, src_prefix);
......@@ -300,6 +306,8 @@ parse_request_subtlv(int ae, const unsigned char *a, int alen,
{
int type, len, i = 0;
*src_plen = 0;
while(i < alen) {
type = a[0];
if(type == SUBTLV_PAD1) {
......@@ -320,6 +328,10 @@ parse_request_subtlv(int ae, const unsigned char *a, int alen,
int rc;
if(len < 1)
goto fail;
if(a[i + 2] == 0)
goto fail;
if(*src_plen != 0)
goto fail;
*src_plen = a[i + 2];
rc = network_prefix(ae, *src_plen, 0, a + i + 3, NULL,
len - 1, src_prefix);
......@@ -1841,7 +1853,8 @@ send_ihu(struct neighbour *neigh, struct interface *ifp)
send_rtt_data = 0;
}
buffer_ihu(&ifp->buf, ifp, rxcost, interval, neigh->address,
buffer_ihu((ifp->flags & IF_UNICAST) != 0 ? &neigh->buf : &ifp->buf,
ifp, rxcost, interval, neigh->address,
send_rtt_data, neigh->hello_send_us,
time_us(neigh->hello_rtt_receive_time));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment