diff options
author | 2019-05-10 13:50:34 +0000 | |
---|---|---|
committer | 2019-05-10 13:50:34 +0000 | |
commit | df59d22f03bf66408f8b328b8e7197313efa0630 (patch) | |
tree | b68a69575ccfaea1063fa061f4d8d0361b8c3f79 | |
parent | ld.so boot cleanup support: (diff) | |
download | wireguard-openbsd-df59d22f03bf66408f8b328b8e7197313efa0630.tar.xz wireguard-openbsd-df59d22f03bf66408f8b328b8e7197313efa0630.zip |
When calculating how much payload ospf6d can put into DD and LSREQ packets
substract the size of the IPv6 header and not the IPv4 header from the MTU.
This stops ospf6d to send out fragmented packets.
Found with and OK benno@
-rw-r--r-- | usr.sbin/ospf6d/database.c | 6 | ||||
-rw-r--r-- | usr.sbin/ospf6d/lsreq.c | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/ospf6d/database.c b/usr.sbin/ospf6d/database.c index 37ad3048762..93f13a01402 100644 --- a/usr.sbin/ospf6d/database.c +++ b/usr.sbin/ospf6d/database.c @@ -1,4 +1,4 @@ -/* $OpenBSD: database.c,v 1.15 2014/10/25 03:23:49 lteo Exp $ */ +/* $OpenBSD: database.c,v 1.16 2019/05/10 13:50:34 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -20,7 +20,7 @@ #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> -#include <netinet/ip.h> +#include <netinet/ip6.h> #include <arpa/inet.h> #include <stdlib.h> #include <string.h> @@ -46,7 +46,7 @@ send_db_description(struct nbr *nbr) int ret = 0; u_int8_t bits = 0; - if ((buf = ibuf_open(nbr->iface->mtu - sizeof(struct ip))) == NULL) + if ((buf = ibuf_open(nbr->iface->mtu - sizeof(struct ip6_hdr))) == NULL) fatal("send_db_description"); /* OSPF header */ diff --git a/usr.sbin/ospf6d/lsreq.c b/usr.sbin/ospf6d/lsreq.c index af5ee550561..ac28dd8762e 100644 --- a/usr.sbin/ospf6d/lsreq.c +++ b/usr.sbin/ospf6d/lsreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lsreq.c,v 1.8 2013/03/22 14:26:35 sthen Exp $ */ +/* $OpenBSD: lsreq.c,v 1.9 2019/05/10 13:50:34 claudio Exp $ */ /* * Copyright (c) 2004, 2005, 2007 Esben Norby <norby@openbsd.org> @@ -19,6 +19,7 @@ #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> +#include <netinet/ip6.h> #include <arpa/inet.h> #include <stdlib.h> @@ -39,7 +40,7 @@ send_ls_req(struct nbr *nbr) struct ibuf *buf; int ret; - if ((buf = ibuf_open(nbr->iface->mtu - sizeof(struct ip))) == NULL) + if ((buf = ibuf_open(nbr->iface->mtu - sizeof(struct ip6_hdr))) == NULL) fatal("send_ls_req"); switch (nbr->iface->type) { |