following claudio's work in src/, this adds some missing RTM_VERSION
checks in ports (or, in the case of ntp, changes the check to skip over
messages with the wrong version).

is there anyone using these who can check any of them?

Index: security/dante/patches/patch-sockd_getifa_c
Index: security/fragrouter/patches/patch-Libnet-0_99b_src_route_c
Index: sysutils/gkrellm/gkrellm/patches/patch-src_sysdeps_bsd-common_c
Index: net/ntp/patches/patch-ntpd_ntp_io_c
Index: net/transmission/patches/patch-third-party_libnatpmp_getgateway_c

there are almost certainly more ports needing similar treatment; here is
a hitlist of some that would be worth checking over..

mrtd olsrd openvpn pktstat quagga wide-dhcp xorp wpa_supplicant openldap
bwm-ng ifstat iftop ipcad libbind libdnet mrtd squid openafs p5-Net-RawIP
pidgin kdebase(ksysguard) slurm trafshow wmifinfo pwlib splint
xulrunner/mozilla kdeutils(ksim,monitors/net) xfce4-netload wormulon



Index: security/dante/Makefile
===================================================================
RCS file: /cvs/ports/security/dante/Makefile,v
retrieving revision 1.35
diff -u -p -r1.35 Makefile
--- security/dante/Makefile     18 Sep 2007 22:15:11 -0000      1.35
+++ security/dante/Makefile     26 Jun 2009 09:09:07 -0000
@@ -3,7 +3,7 @@
 COMMENT=       SOCKS client and server
 
 DISTNAME=      dante-1.1.19
-PKGNAME=       ${DISTNAME}p0
+PKGNAME=       ${DISTNAME}p1
 CATEGORIES=    security
 
 SHARED_LIBS=   dsocks  1.1 \
Index: security/dante/patches/patch-sockd_getifa_c
===================================================================
RCS file: security/dante/patches/patch-sockd_getifa_c
diff -N security/dante/patches/patch-sockd_getifa_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ security/dante/patches/patch-sockd_getifa_c 26 Jun 2009 09:09:07 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+--- sockd/getifa.c.orig        Thu Jun 25 17:19:31 2009
++++ sockd/getifa.c     Thu Jun 25 17:20:22 2009
+@@ -301,8 +301,10 @@ getifa(destaddr)
+                               close(sockfd);
+                               return inaddr_none;
+                       }
+-              } while (rtm->rtm_type != RTM_GET || rtm->rtm_seq != SEQ
+-              || rtm->rtm_pid != pid);
++              } while (rtm->rtm_version != RTM_VERSION ||
++                  rtm->rtm_type != RTM_GET ||
++                  rtm->rtm_seq != SEQ ||
++                  rtm->rtm_pid != pid);
+ 
+               /*============================================================
+                * Go straight to the RTA_GATEWAY entry for our info.
Index: security/fragrouter/Makefile
===================================================================
RCS file: /cvs/ports/security/fragrouter/Makefile,v
retrieving revision 1.24
diff -u -p -r1.24 Makefile
--- security/fragrouter/Makefile        15 Sep 2007 23:29:58 -0000      1.24
+++ security/fragrouter/Makefile        26 Jun 2009 09:09:07 -0000
@@ -3,6 +3,7 @@
 COMMENT=       tool for testing network IDS implementations
 
 DISTNAME=      fragrouter-1.6
+PKGNAME=       ${DISTNAME}p0
 CATEGORIES=    security
 
 MASTER_SITES=  http://monkey.org/~dugsong/
Index: security/fragrouter/patches/patch-Libnet-0_99b_src_route_c
===================================================================
RCS file: security/fragrouter/patches/patch-Libnet-0_99b_src_route_c
diff -N security/fragrouter/patches/patch-Libnet-0_99b_src_route_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ security/fragrouter/patches/patch-Libnet-0_99b_src_route_c  26 Jun 2009 
09:09:07 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+--- Libnet-0.99b/src/route.c.orig      Thu Jun 25 17:25:04 2009
++++ Libnet-0.99b/src/route.c   Thu Jun 25 17:25:26 2009
+@@ -68,8 +68,8 @@ libnet_get_next_hop(u_long ip, char *ebuf)
+     do
+     {
+         n=read(fd, rtm, sizeof buf); 
+-    } while (rtm->rtm_type != RTM_GET || rtm->rtm_seq != seq || 
+-             rtm->rtm_pid != pid);
++    } while (rtm->rtm_version != RTM_VERSION || rtm->rtm_type != RTM_GET ||
++           rtm->rtm_seq != seq || rtm->rtm_pid != pid);
+ 
+     rtm=(struct rt_msghdr *)buf;
+ 
Index: sysutils/gkrellm/gkrellm/Makefile
===================================================================
RCS file: /cvs/ports/sysutils/gkrellm/gkrellm/Makefile,v
retrieving revision 1.46
diff -u -p -r1.46 Makefile
--- sysutils/gkrellm/gkrellm/Makefile   9 Mar 2009 22:42:07 -0000       1.46
+++ sysutils/gkrellm/gkrellm/Makefile   26 Jun 2009 09:09:07 -0000
@@ -7,8 +7,8 @@ COMMENT-client= single process stack of 
 
 V=             2.3.2
 DISTNAME=      gkrellm-${V}
-PKGNAME-main=  gkrellm-server-${V}p3
-PKGNAME-client=        gkrellm-${V}p3
+PKGNAME-main=  gkrellm-server-${V}p4
+PKGNAME-client=        gkrellm-${V}p4
 CATEGORIES=    sysutils sysutils/gkrellm
 
 MAINTAINER=    Antoine Jacoutot <[email protected]>
Index: sysutils/gkrellm/gkrellm/patches/patch-src_sysdeps_bsd-common_c
===================================================================
RCS file: sysutils/gkrellm/gkrellm/patches/patch-src_sysdeps_bsd-common_c
diff -N sysutils/gkrellm/gkrellm/patches/patch-src_sysdeps_bsd-common_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ sysutils/gkrellm/gkrellm/patches/patch-src_sysdeps_bsd-common_c     26 Jun 
2009 09:09:07 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+--- src/sysdeps/bsd-common.c.orig      Thu Jun 25 17:29:06 2009
++++ src/sysdeps/bsd-common.c   Thu Jun 25 17:34:51 2009
+@@ -115,9 +115,11 @@ gkrellm_sys_net_read_data(void)
+       while (next < lim)
+               {
+               ifm = (struct if_msghdr *)next;
++              next += ifm->ifm_msglen;
++              if (ifm->ifm_version != RTM_VERSION)
++                      continue;
+               if (ifm->ifm_type != RTM_IFINFO)
+                       return;
+-              next += ifm->ifm_msglen;
+ 
+               while (next < lim)
+                       {
Index: net/ntp/Makefile
===================================================================
RCS file: /cvs/ports/net/ntp/Makefile,v
retrieving revision 1.41
diff -u -p -r1.41 Makefile
--- net/ntp/Makefile    23 May 2009 16:32:29 -0000      1.41
+++ net/ntp/Makefile    26 Jun 2009 09:09:07 -0000
@@ -8,7 +8,7 @@ COMMENT=        Network Time Protocol reference
 
 VERSION=       4.2.4p7
 DISTNAME=      ntp-${VERSION}
-PKGNAME=       ntp-${VERSION:S/p/pl/}
+PKGNAME=       ntp-${VERSION:S/p/pl/}p0
 CATEGORIES=    net
 MASTER_SITES=  ftp://archive.ntp.org/ntp4/ntp-4.2/ \
                http://archive.ntp.org/ntp4/ntp-4.2/
Index: net/ntp/patches/patch-ntpd_ntp_io_c
===================================================================
RCS file: net/ntp/patches/patch-ntpd_ntp_io_c
diff -N net/ntp/patches/patch-ntpd_ntp_io_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ net/ntp/patches/patch-ntpd_ntp_io_c 26 Jun 2009 09:09:07 -0000
@@ -0,0 +1,18 @@
+$OpenBSD$
+--- ntpd/ntp_io.c.orig Mon May 18 09:21:15 2009
++++ ntpd/ntp_io.c      Thu Jun 25 23:43:12 2009
+@@ -3896,11 +3896,10 @@ process_routing_msgs(struct asyncio_reader *reader)
+               struct rt_msghdr *rtm;
+               
+               rtm = (struct rt_msghdr *)p;
++
+               if (rtm->rtm_version != RTM_VERSION) {
+-                      msyslog(LOG_ERR, "version mismatch on routing socket %m 
- disabling");
+-                      remove_asyncio_reader(reader);
+-                      delete_asyncio_reader(reader);
+-                      return;
++                      rtm+=rtm->rtm_msglen;
++                      continue;
+               }
+               
+               switch (rtm->rtm_type) {
Index: net/transmission/Makefile
===================================================================
RCS file: /cvs/ports/net/transmission/Makefile,v
retrieving revision 1.37
diff -u -p -r1.37 Makefile
--- net/transmission/Makefile   20 Jun 2009 13:07:22 -0000      1.37
+++ net/transmission/Makefile   26 Jun 2009 09:09:07 -0000
@@ -5,7 +5,7 @@ COMMENT-gui=    lightweight BitTorrent clie
 
 VER=           1.72
 DISTNAME=      transmission-${VER}
-PKGNAME-main=  transmission-${VER}
+PKGNAME-main=  transmission-${VER}p0
 PKGNAME-gui=   transmission-gui-${VER}
 CATEGORIES=    net
 HOMEPAGE=      http://www.transmissionbt.com/
Index: net/transmission/patches/patch-third-party_libnatpmp_getgateway_c
===================================================================
RCS file: net/transmission/patches/patch-third-party_libnatpmp_getgateway_c
diff -N net/transmission/patches/patch-third-party_libnatpmp_getgateway_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ net/transmission/patches/patch-third-party_libnatpmp_getgateway_c   26 Jun 
2009 09:09:07 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- third-party/libnatpmp/getgateway.c.orig    Thu Jun 25 23:41:44 2009
++++ third-party/libnatpmp/getgateway.c Thu Jun 25 23:41:45 2009
+@@ -230,7 +230,7 @@ int getdefaultgateway(in_addr_t *addr)
+ 
+   do {
+     l = read(s, (char *)&m_rtmsg, sizeof(m_rtmsg));
+-  } while (l > 0 && (rtm.rtm_seq != seq || rtm.rtm_pid != pid));
++  } while (l > 0 && (rtm.rtm_version != RTM_VERSION || rtm.rtm_seq != seq || 
rtm.rtm_pid != pid));
+                         
+   close(s);
+ 

Reply via email to