Commit bc26b858 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Ensure that a Hello is sent in the same packet as an IHU.

If no Hello has been buffered yet, insert an unscheduled Hello.
This only works if rfc6126-compatible is false.
parent 0db7e63b
...@@ -1683,6 +1683,7 @@ send_ihu(struct neighbour *neigh, struct interface *ifp) ...@@ -1683,6 +1683,7 @@ send_ihu(struct neighbour *neigh, struct interface *ifp)
{ {
int rxcost, interval; int rxcost, interval;
int send_rtt_data; int send_rtt_data;
int unicast;
if(neigh == NULL && ifp == NULL) { if(neigh == NULL && ifp == NULL) {
struct interface *ifp_aux; struct interface *ifp_aux;
...@@ -1718,7 +1719,9 @@ send_ihu(struct neighbour *neigh, struct interface *ifp) ...@@ -1718,7 +1719,9 @@ send_ihu(struct neighbour *neigh, struct interface *ifp)
neigh->ifp->name, neigh->ifp->name,
format_address(neigh->address)); format_address(neigh->address));
if((ifp->flags & IF_TIMESTAMPS) != 0 && neigh->hello_send_us && unicast = !!(ifp->flags & IF_UNICAST);
if(!!(ifp->flags & IF_TIMESTAMPS) != 0 && neigh->hello_send_us &&
/* Checks whether the RTT data is not too old to be sent. */ /* Checks whether the RTT data is not too old to be sent. */
timeval_minus_msec(&now, &neigh->hello_rtt_receive_time) < 1000000) { timeval_minus_msec(&now, &neigh->hello_rtt_receive_time) < 1000000) {
send_rtt_data = 1; send_rtt_data = 1;
...@@ -1727,7 +1730,16 @@ send_ihu(struct neighbour *neigh, struct interface *ifp) ...@@ -1727,7 +1730,16 @@ send_ihu(struct neighbour *neigh, struct interface *ifp)
send_rtt_data = 0; send_rtt_data = 0;
} }
buffer_ihu((ifp->flags & IF_UNICAST) != 0 ? &neigh->buf : &ifp->buf, if(send_rtt_data) {
/* Ensure that there is a Hello in the same packet. */
ensure_space(unicast ? &neigh->buf : &ifp->buf, ifp, 14 + 16);
if(unicast)
send_unicast_hello(neigh, 0, 0);
else
send_multicast_hello(ifp, 0, 0);
}
buffer_ihu(unicast ? &neigh->buf : &ifp->buf,
ifp, rxcost, interval, neigh->address, ifp, rxcost, interval, neigh->address,
send_rtt_data, neigh->hello_send_us, send_rtt_data, neigh->hello_send_us,
time_us(neigh->hello_rtt_receive_time)); 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