Commit 8dd23d14 authored by Julien Muchembled's avatar Julien Muchembled

Merge upstream master

parents 223c72e2 0835d5d8
20 August 2019: babeld-1.9.1
* Fixed a crash that could happen when unicast and RTT estimation are
both enabled on an interface. Thanks to Dave Taht.
* Fixed compilation under BSD. Thanks to Dave Taht.
4 August 2019: babeld-1.9.0
* Reworked buffering of unicast packets to use a per-neighbour buffer
......
......@@ -44,6 +44,8 @@ THE SOFTWARE.
#include "xroute.h"
#include "hmac.h"
#define MIN_MTU 512
struct interface *interfaces = NULL;
static struct interface *
......@@ -280,12 +282,8 @@ interface_updown(struct interface *ifp, int up)
if((!!up) == if_up(ifp))
return 0;
if(up)
ifp->flags |= IF_UP;
else
ifp->flags &= ~IF_UP;
if(up) {
ifp->flags |= IF_UP;
if(ifp->ifindex <= 0) {
fprintf(stderr,
"Upping unknown interface %s.\n", ifp->name);
......@@ -307,7 +305,9 @@ interface_updown(struct interface *ifp, int up)
mtu = kernel_interface_mtu(ifp->name, ifp->ifindex);
if(mtu < 0) {
fprintf(stderr, "Warning: couldn't get MTU of interface %s (%u).\n",
fprintf(stderr,
"Warning: couldn't get MTU of interface %s (%u), "
"using 1280\n",
ifp->name, ifp->ifindex);
mtu = 1280;
}
......@@ -318,10 +318,10 @@ interface_updown(struct interface *ifp, int up)
to reassemble up to 1500 bytes. In IPv4, every host must be
able to reassemble up to 576 bytes. At any rate, the Babel spec
says that every node must be able to parse packets of size 512. */
if(mtu < 512) {
if(mtu < MIN_MTU) {
fprintf(stderr,
"Suspiciously low MTU %d on interface %s (%u), using 512.\n",
mtu, ifp->name, ifp->ifindex);
"Suspiciously low MTU %d on interface %s (%u), using %d.\n",
mtu, ifp->name, ifp->ifindex, MIN_MTU);
mtu = 512;
}
......@@ -498,6 +498,7 @@ interface_updown(struct interface *ifp, int up)
send_update(ifp, 0, NULL, 0, NULL, 0);
send_multicast_request(ifp, NULL, 0, NULL, 0);
} else {
ifp->flags &= ~IF_UP;
flush_interface_routes(ifp, 0);
ifp->buf.len = 0;
ifp->buf.size = 0;
......
......@@ -456,11 +456,11 @@ kernel_route(int operation, int table,
/* Avoid atomic route changes that is buggy on OS X. */
kernel_route(ROUTE_FLUSH, table, dest, plen,
src, src_plen,
src, src_plen, NULL,
gate, ifindex, metric,
NULL, 0, 0, 0);
return kernel_route(ROUTE_ADD, table, dest, plen,
src, src_plen,
src, src_plen, NULL,
newgate, newifindex, newmetric,
NULL, 0, 0, 0);
......
......@@ -1218,7 +1218,7 @@ buffer_hello(struct buffered *buf, struct interface *ifp,
accumulate_byte(buf, 4);
accumulate_int(buf, 0);
}
end_message(&ifp->buf, MESSAGE_HELLO, timestamp ? 12 : 6);
end_message(buf, MESSAGE_HELLO, timestamp ? 12 : 6);
}
void
......
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