Update olsrd to the latest stable release (not listed on the project's
website but visible at http://www.olsr.org/releases/0.9/ -- pointed out by
upstream in https://lists.olsr.org/pipermail/olsr-dev/2017-May/008407.html)
ok?
Index: Makefile
===================================================================
RCS file: /cvs/ports/net/olsrd/Makefile,v
retrieving revision 1.28
diff -u -p -r1.28 Makefile
--- Makefile 13 May 2017 22:27:20 -0000 1.28
+++ Makefile 4 Jun 2017 09:48:51 -0000
@@ -3,7 +3,7 @@
COMMENT-main= OLSR routing daemon
COMMENT-gui= OLSR routing daemon GUI
-VERSION= 0.9.0.3
+VERSION= 0.9.6.1
DISTNAME= olsrd-${VERSION}
PKGNAME-main= olsrd-${VERSION}
PKGNAME-gui= olsrd-gui-${VERSION}
@@ -41,7 +41,10 @@ NO_TEST= Yes
MODULES= devel/gettext
ALL_TARGET= build_all
-MAKE_FLAGS= DEBUG=0 CC="${CC}" OS=obsd LIBNET=1
+MAKE_FLAGS= CC="${CC}" OS=obsd LIBNET=1
+.ifdef DEBUG
+MAKE_FLAGS+= DEBUG=1
+.endif
CPPFLAGS+= "-I${PREFIX}/libnet-1.1"
FAKE_FLAGS= SBINDIR=${DESTDIR}/${PREFIX}/sbin \
ETCDIR=${DESTDIR}/${PREFIX}/share/examples/olsrd \
Index: distinfo
===================================================================
RCS file: /cvs/ports/net/olsrd/distinfo,v
retrieving revision 1.9
diff -u -p -r1.9 distinfo
--- distinfo 13 May 2017 22:27:20 -0000 1.9
+++ distinfo 4 Jun 2017 09:49:03 -0000
@@ -1,2 +1,2 @@
-SHA256 (olsrd-0.9.0.3.tar.gz) = WdN1cMWOwlY2px1afPRGBEi+aT8B12iuNpp/ZuWAd/s=
-SIZE (olsrd-0.9.0.3.tar.gz) = 5791920
+SHA256 (olsrd-0.9.6.1.tar.gz) = y5UaXThKtIApcx+hs9109/ErU1L0LuraVLuB3ULHdFc=
+SIZE (olsrd-0.9.6.1.tar.gz) = 1104287
Index: patches/patch-Makefile_inc
===================================================================
RCS file: /cvs/ports/net/olsrd/patches/patch-Makefile_inc,v
retrieving revision 1.3
diff -u -p -r1.3 patch-Makefile_inc
--- patches/patch-Makefile_inc 17 May 2017 12:46:42 -0000 1.3
+++ patches/patch-Makefile_inc 4 Jun 2017 10:02:25 -0000
@@ -3,7 +3,7 @@ $OpenBSD: patch-Makefile_inc,v 1.3 2017/
Index: Makefile.inc
--- Makefile.inc.orig
+++ Makefile.inc
-@@ -42,12 +42,6 @@ endif
+@@ -90,13 +90,6 @@ endif
#
# programs
@@ -13,6 +13,7 @@ Index: Makefile.inc
-else
-CC ?= $(CCACHE) gcc
-endif
+-CC := $(strip $(CC))
ifeq ($(DEBUG),0)
- STRIP ?= strip
- else
+ ifeq ($(NOSTRIP),0)
+ STRIP ?= strip
Index: patches/patch-make_Makefile_obsd
===================================================================
RCS file: /cvs/ports/net/olsrd/patches/patch-make_Makefile_obsd,v
retrieving revision 1.3
diff -u -p -r1.3 patch-make_Makefile_obsd
--- patches/patch-make_Makefile_obsd 13 May 2017 22:27:20 -0000 1.3
+++ patches/patch-make_Makefile_obsd 4 Jun 2017 09:59:54 -0000
@@ -2,7 +2,7 @@ $OpenBSD: patch-make_Makefile_obsd,v 1.3
Index: make/Makefile.obsd
--- make/Makefile.obsd.orig
+++ make/Makefile.obsd
-@@ -8,22 +8,24 @@ ETCDIR = /etc/olsrd
+@@ -51,22 +51,24 @@ ETCDIR = /etc/olsrd
LIBDIR = $(PREFIX)/lib
DOCDIR = $(PREFIX)/share/doc
MANDIR = $(PREFIX)/man
Index: patches/patch-src_bsd_kernel_routes_c
===================================================================
RCS file: /cvs/ports/net/olsrd/patches/patch-src_bsd_kernel_routes_c,v
retrieving revision 1.1
diff -u -p -r1.1 patch-src_bsd_kernel_routes_c
--- patches/patch-src_bsd_kernel_routes_c 13 May 2017 22:27:20 -0000
1.1
+++ patches/patch-src_bsd_kernel_routes_c 4 Jun 2017 09:59:54 -0000
@@ -3,7 +3,7 @@ $OpenBSD: patch-src_bsd_kernel_routes_c,
Index: src/bsd/kernel_routes.c
--- src/bsd/kernel_routes.c.orig
+++ src/bsd/kernel_routes.c
-@@ -111,6 +111,9 @@ add_del_route(const struct rt_entry *rt, int add)
+@@ -115,6 +115,9 @@ add_del_route(const struct rt_entry *rt, int add)
rtm->rtm_flags = olsr_rt_flags(rt, add);
rtm->rtm_pid = OLSR_PID;
rtm->rtm_seq = ++seq;
@@ -13,7 +13,7 @@ Index: src/bsd/kernel_routes.c
/* walk to the end of the header */
walker = buff + sizeof(struct rt_msghdr);
-@@ -222,14 +225,31 @@ add_del_route(const struct rt_entry *rt, int add)
+@@ -226,14 +229,24 @@ add_del_route(const struct rt_entry *rt, int add)
drtm->rtm_version = RTM_VERSION;
drtm->rtm_type = RTM_DELETE;
drtm->rtm_index = 0;
@@ -29,13 +29,6 @@ Index: src/bsd/kernel_routes.c
memcpy(walker, &sin4, sizeof(sin4));
walker += sin_size;
drtm->rtm_addrs = RTA_DST;
-+ if (0 != (drtm->rtm_flags & RTF_GATEWAY)) {
-+ nexthop = &rt->rt_nexthop;
-+ sin4.sin_addr = nexthop->gateway.v4;
-+ memcpy(walker, &sin4, sizeof(sin4));
-+ walker += sin_size;
-+ drtm->rtm_addrs |= RTA_GATEWAY;
-+ }
+ if (0 == (drtm->rtm_flags & RTF_HOST)) {
+ olsr_prefix_to_netmask(&mask, rt->rt_dst.prefix_len);
+ sin4.sin_addr = mask.v4;
@@ -46,7 +39,7 @@ Index: src/bsd/kernel_routes.c
drtm->rtm_msglen = (unsigned short)(walker - dbuff);
len = write(olsr_cnf->rts, dbuff, drtm->rtm_msglen);
if (len < 0) {
-@@ -298,6 +318,9 @@ add_del_route6(const struct rt_entry *rt, int add)
+@@ -302,6 +315,9 @@ add_del_route6(const struct rt_entry *rt, int add)
rtm->rtm_flags = olsr_rt_flags(rt, add);
rtm->rtm_pid = OLSR_PID;
rtm->rtm_seq = ++seq;
@@ -56,7 +49,7 @@ Index: src/bsd/kernel_routes.c
/* walk to the end of the header */
walker = buff + sizeof(struct rt_msghdr);
-@@ -385,6 +408,9 @@ add_del_route6(const struct rt_entry *rt, int add)
+@@ -389,6 +405,9 @@ add_del_route6(const struct rt_entry *rt, int add)
drtm->rtm_index = 0;
drtm->rtm_flags = olsr_rt_flags(rt, add);
drtm->rtm_seq = ++seq;
Index: patches/patch-src_bsd_net_c
===================================================================
RCS file: /cvs/ports/net/olsrd/patches/patch-src_bsd_net_c,v
retrieving revision 1.3
diff -u -p -r1.3 patch-src_bsd_net_c
--- patches/patch-src_bsd_net_c 13 May 2017 22:27:20 -0000 1.3
+++ patches/patch-src_bsd_net_c 4 Jun 2017 10:45:16 -0000
@@ -3,11 +3,92 @@ $OpenBSD: patch-src_bsd_net_c,v 1.3 2017
Index: src/bsd/net.c
--- src/bsd/net.c.orig
+++ src/bsd/net.c
-@@ -51,6 +51,7 @@
- #include "../ipcalc.h"
- #include "../parser.h" /* dnc: needed for call to packet_parser() */
- #include "../olsr_protocol.h"
-+#include "../olsr_random.h"
- #include "../olsr_cfg.h"
- #include "../olsr.h"
+@@ -55,6 +55,7 @@
+ #include "ipcalc.h"
+ #include "parser.h" /* dnc: needed for call to packet_parser() */
+ #include "olsr_protocol.h"
++#include "olsr_random.h"
+ #include "olsr_cfg.h"
+ #include "olsr.h"
+@@ -64,6 +65,7 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <net/if.h>
++#include <net/if_media.h>
+ #include <sys/ioctl.h>
+ #include <fcntl.h>
+ #include <syslog.h>
+@@ -86,7 +88,6 @@
+ #ifdef __NetBSD__
+ #include <net/if_ether.h>
+ #include <netinet6/in6_var.h> /* For struct in6_ifreq */
+-#include <net80211/ieee80211_ioctl.h>
+ #include <ifaddrs.h>
+ #endif /* __NetBSD__ */
+
+@@ -100,8 +101,6 @@
+ #include <netinet6/in6_var.h> /* For struct in6_ifreq */
+ #include <ifaddrs.h>
+ #include <sys/uio.h>
+-#include <net80211/ieee80211.h>
+-#include <net80211/ieee80211_ioctl.h>
+ #endif /* __OpenBSD__ */
+
+ #if defined __FreeBSD__ || defined __FreeBSD_kernel__
+@@ -109,10 +108,6 @@
+ #include <net/ethernet.h>
+ #include <netinet/in_var.h>
+ #include <ifaddrs.h>
+-#ifndef FBSD_NO_80211
+-#include <net80211/ieee80211.h>
+-#include <net80211/ieee80211_ioctl.h>
+-#endif /* FBSD_NO_80211 */
+ #endif /* defined __FreeBSD__ || defined __FreeBSD_kernel__ */
+
+ #ifdef __APPLE__
+@@ -747,39 +742,12 @@ olsr_select(int nfds, fd_set * readfds, fd_set * write
+ int
+ check_wireless_interface(char *ifname)
+ {
+-#if (defined __FreeBSD__ || defined __FreeBSD_kernel__ ) && !defined
FBSD_NO_80211
+-
+-/* From FreeBSD ifconfig/ifieee80211.c ieee80211_status() */
+- struct ieee80211req ireq;
+- u_int8_t data[32];
+-
+- memset(&ireq, 0, sizeof(ireq));
+- strscpy(ireq.i_name, ifname, sizeof(ireq.i_name));
+- ireq.i_data = &data;
+- ireq.i_type = IEEE80211_IOC_SSID;
+- ireq.i_val = -1;
+- return (ioctl(olsr_cnf->ioctl_s, SIOCG80211, &ireq) >= 0) ? 1 : 0;
+-#elif defined __OpenBSD__
+- struct ieee80211_nodereq nr;
+- bzero(&nr, sizeof(nr));
+- strscpy(nr.nr_ifname, ifname, sizeof(nr.nr_ifname));
+- return (ioctl(olsr_cnf->ioctl_s, SIOCG80211FLAGS, &nr) >= 0) ? 1 : 0;
+-#elif defined __NetBSD__
+- struct ifreq ireq;
+- struct ieee80211_nwid data;
++ struct ifmediareq ifmr;
+ int ret;
+-
+- memset(&ireq, 0, sizeof(ireq));
+- strscpy(ireq.ifr_name, ifname, sizeof(ireq.ifr_name));
+- ireq.ifr_data = &data;
+- ret = ioctl(olsr_cnf->ioctl_s, SIOCG80211NWID, &ireq);
+- if(ret == 0)
+- return 1;
+- return 0;
+-#else /* defined __NetBSD__ */
+- ifname = NULL; /* squelsh compiler warning */
+- return 0;
+-#endif /* defined __NetBSD__ */
++ bzero(&ifmr, sizeof(ifmr));
++ strscpy(ifmr.ifm_name, ifname, sizeof(ifmr.ifm_name));
++ ret = ioctl(olsr_cnf->ioctl_s, SIOCGIFMEDIA, (caddr_t)&ifmr);
++ return (ret == 0 && IFM_TYPE(ifmr.ifm_current) == IFM_IEEE80211);
+ }
+
+ #include <sys/sockio.h>
Index: patches/patch-src_cfgparser_local_mk
===================================================================
RCS file: /cvs/ports/net/olsrd/patches/patch-src_cfgparser_local_mk,v
retrieving revision 1.2
diff -u -p -r1.2 patch-src_cfgparser_local_mk
--- patches/patch-src_cfgparser_local_mk 13 May 2017 22:27:20 -0000
1.2
+++ patches/patch-src_cfgparser_local_mk 4 Jun 2017 09:59:54 -0000
@@ -1,7 +1,8 @@
$OpenBSD: patch-src_cfgparser_local_mk,v 1.2 2017/05/13 22:27:20 stsp Exp $
---- src/cfgparser/local.mk.orig Sun Sep 20 14:22:23 2015
-+++ src/cfgparser/local.mk Sun Apr 3 12:48:37 2016
-@@ -79,5 +79,7 @@ endif
+Index: src/cfgparser/local.mk
+--- src/cfgparser/local.mk.orig
++++ src/cfgparser/local.mk
+@@ -83,5 +83,7 @@ endif
$(C)oparse.o: CFLAGS := $(filter-out -Wunreachable-code,$(CFLAGS))
Index: patches/patch-src_olsr_random_h
===================================================================
RCS file: /cvs/ports/net/olsrd/patches/patch-src_olsr_random_h,v
retrieving revision 1.1
diff -u -p -r1.1 patch-src_olsr_random_h
--- patches/patch-src_olsr_random_h 13 May 2017 22:27:20 -0000 1.1
+++ patches/patch-src_olsr_random_h 4 Jun 2017 10:03:36 -0000
@@ -3,30 +3,25 @@ $OpenBSD: patch-src_olsr_random_h,v 1.1
Index: src/olsr_random.h
--- src/olsr_random.h.orig
+++ src/olsr_random.h
-@@ -9,7 +9,14 @@
+@@ -54,7 +54,14 @@
#define OLSR_RANDOM_MAX INT32_MAX
+#if defined(__OpenBSD__)
- static inline long int olsr_random(void) {
+ static INLINE long int olsr_random(void) {
+ long int r;
+ arc4random_buf(&r, sizeof(r));
+ return r;
+}
+#else
-+static inline long int olsr_random(void) {
++static INLINE long int olsr_random(void) {
int32_t value;
int randomFile;
-@@ -32,9 +39,10 @@ static inline long int olsr_random(void) {
+@@ -77,5 +84,6 @@ static INLINE long int olsr_random(void) {
return abs(value);
}
-+#endif
-
- static inline void olsr_init_random(void) {
-- srandom(time(NULL));
-+ srandom(arc4random());
- }
++#endif /* __OpenBSD__ */
#endif /* _OLSR_RANDOM_H */
Index: patches/patch-src_plugin_loader_c
===================================================================
RCS file: /cvs/ports/net/olsrd/patches/patch-src_plugin_loader_c,v
retrieving revision 1.2
diff -u -p -r1.2 patch-src_plugin_loader_c
--- patches/patch-src_plugin_loader_c 13 May 2017 22:27:20 -0000 1.2
+++ patches/patch-src_plugin_loader_c 4 Jun 2017 09:59:54 -0000
@@ -1,8 +1,9 @@
$OpenBSD: patch-src_plugin_loader_c,v 1.2 2017/05/13 22:27:20 stsp Exp $
the plugins get installed to $LOCALBASE/lib/olsrd-plugins, so load them from
there.
---- src/plugin_loader.c.orig Sun Sep 20 14:22:23 2015
-+++ src/plugin_loader.c Sun Apr 3 14:06:06 2016
-@@ -88,20 +88,14 @@ olsr_load_plugins(void)
+Index: src/plugin_loader.c
+--- src/plugin_loader.c.orig
++++ src/plugin_loader.c
+@@ -91,20 +91,14 @@ olsr_load_plugins(void)
static int
olsr_load_dl(char *libname, struct plugin_param *params)
{
Index: patches/patch-src_unix_ifnet_c
===================================================================
RCS file: /cvs/ports/net/olsrd/patches/patch-src_unix_ifnet_c,v
retrieving revision 1.3
diff -u -p -r1.3 patch-src_unix_ifnet_c
--- patches/patch-src_unix_ifnet_c 13 May 2017 22:27:20 -0000 1.3
+++ patches/patch-src_unix_ifnet_c 4 Jun 2017 09:59:54 -0000
@@ -3,7 +3,7 @@ $OpenBSD: patch-src_unix_ifnet_c,v 1.3 2
Index: src/unix/ifnet.c
--- src/unix/ifnet.c.orig
+++ src/unix/ifnet.c
-@@ -646,7 +646,10 @@ chk_if_up(struct olsr_if *iface, int debuglvl __attrib
+@@ -632,7 +632,10 @@ chk_if_up(struct olsr_if *iface, int debuglvl __attrib
/* Find broadcast address */
if (iface->cnf->ipv4_multicast.v4.s_addr) {
/* Specified broadcast */
@@ -14,4 +14,4 @@ Index: src/unix/ifnet.c
+ sin->sin_family = AF_INET;
} else {
/* Autodetect */
- if (ioctl(olsr_cnf->ioctl_s, SIOCGIFBRDADDR, &ifr) < 0) {
+ struct sockaddr* ifrb;
Index: pkg/PLIST-main
===================================================================
RCS file: /cvs/ports/net/olsrd/pkg/PLIST-main,v
retrieving revision 1.3
diff -u -p -r1.3 PLIST-main
--- pkg/PLIST-main 13 May 2017 22:27:20 -0000 1.3
+++ pkg/PLIST-main 4 Jun 2017 10:06:54 -0000
@@ -1,7 +1,7 @@
@comment $OpenBSD: PLIST-main,v 1.3 2017/05/13 22:27:20 stsp Exp $
+@conflict olsrd-plugins-*
@pkgpath net/olsrd
@pkgpath net/olsrd,-plugins
-@conflict olsrd-plugins-*
bin/olsr-topology-view.pl
lib/olsrd-plugins/
lib/olsrd-plugins/olsrd_dot_draw.so
@@ -9,6 +9,7 @@ lib/olsrd-plugins/olsrd_httpinfo.so
lib/olsrd-plugins/olsrd_jsoninfo.so
lib/olsrd-plugins/olsrd_mini.so
lib/olsrd-plugins/olsrd_nameservice.so
+lib/olsrd-plugins/olsrd_netjson.so
lib/olsrd-plugins/olsrd_pgraph.so
lib/olsrd-plugins/olsrd_secure.so
lib/olsrd-plugins/olsrd_txtinfo.so
@@ -20,8 +21,7 @@ share/examples/olsrd/
@sample ${SYSCONFDIR}/olsrd/
share/examples/olsrd/olsrd.conf
@sample ${SYSCONFDIR}/olsrd/olsrd.conf
-share/examples/olsrd/olsrd.conf.default.full
-share/examples/olsrd/olsrd.conf.default.full.txt
share/examples/olsrd/olsrd.conf.default.lq
share/examples/olsrd/olsrd.conf.default.rfc
+share/examples/olsrd/olsrd.conf.default.txt
@rcscript /etc/rc.d/olsrd