From owner-svn-ports-all@freebsd.org Sun Aug 14 23:08:10 2016 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92AEEBB90CE; Sun, 14 Aug 2016 23:08:10 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A0CD1B9F; Sun, 14 Aug 2016 23:08:10 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EN89SP036689; Sun, 14 Aug 2016 23:08:09 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EN89bx036687; Sun, 14 Aug 2016 23:08:09 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201608142308.u7EN89bx036687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 14 Aug 2016 23:08:09 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r420203 - head/net/bird/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Aug 2016 23:08:10 -0000 Author: melifaro (src committer) Date: Sun Aug 14 23:08:09 2016 New Revision: 420203 URL: https://svnweb.freebsd.org/changeset/ports/420203 Log: Fix net/bird r420176 update: really add bugfixes from git. Approved by: az(implicit) Added: head/net/bird/files/patch-proto-bgp-attrs.c (contents, props changed) head/net/bird/files/patch-sysdep-unix-io.c (contents, props changed) Added: head/net/bird/files/patch-proto-bgp-attrs.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/bird/files/patch-proto-bgp-attrs.c Sun Aug 14 23:08:09 2016 (r420203) @@ -0,0 +1,62 @@ +diff --git proto/bgp/attrs.c proto/bgp/attrs.c +index d85afa8..b8371f3 100644 +--- proto/bgp/attrs.c ++++ proto/bgp/attrs.c +@@ -118,7 +118,7 @@ validate_path(struct bgp_proto *p, int as_path, int bs, byte *idata, uint *ileng + { + int res = 0; + u8 *a, *dst; +- int len, plen, copy; ++ int len, plen; + + dst = a = idata; + len = *ilength; +@@ -132,15 +132,20 @@ validate_path(struct bgp_proto *p, int as_path, int bs, byte *idata, uint *ileng + if (len < plen) + return -1; + ++ if (a[1] == 0) ++ { ++ log(L_WARN "%s: %s_PATH attribute contains empty segment, skipping it", ++ p->p.name, as_path ? "AS" : "AS4"); ++ goto skip; ++ } ++ + switch (a[0]) + { + case AS_PATH_SET: +- copy = 1; + res++; + break; + + case AS_PATH_SEQUENCE: +- copy = 1; + res += a[1]; + break; + +@@ -154,20 +159,17 @@ validate_path(struct bgp_proto *p, int as_path, int bs, byte *idata, uint *ileng + + log(L_WARN "%s: %s_PATH attribute contains AS_CONFED_* segment, skipping segment", + p->p.name, as_path ? "AS" : "AS4"); +- copy = 0; +- break; ++ goto skip; + + default: + return -1; + } + +- if (copy) +- { +- if (dst != a) +- memmove(dst, a, plen); +- dst += plen; +- } ++ if (dst != a) ++ memmove(dst, a, plen); ++ dst += plen; + ++ skip: + len -= plen; + a += plen; + } Added: head/net/bird/files/patch-sysdep-unix-io.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/bird/files/patch-sysdep-unix-io.c Sun Aug 14 23:08:09 2016 (r420203) @@ -0,0 +1,80 @@ +diff --git sysdep/unix/io.c sysdep/unix/io.c +index 486319f..8198743 100644 +--- sysdep/unix/io.c ++++ sysdep/unix/io.c +@@ -1211,7 +1211,7 @@ sk_setup(sock *s) + if (s->iface) + { + #ifdef SO_BINDTODEVICE +- struct ifreq ifr; ++ struct ifreq ifr = {}; + strcpy(ifr.ifr_name, s->iface->name); + if (setsockopt(s->fd, SOL_SOCKET, SO_BINDTODEVICE, &ifr, sizeof(ifr)) < 0) + ERR("SO_BINDTODEVICE"); +@@ -1854,6 +1854,20 @@ sk_write(sock *s) + } + + void ++sk_err(sock *s, int revents) ++{ ++ int se = 0, sse = sizeof(se); ++ if (revents & POLLERR) ++ if (getsockopt(s->fd, SOL_SOCKET, SO_ERROR, &se, &sse) < 0) ++ { ++ log(L_ERR "IO: Socket error: SO_ERROR: %m"); ++ se = 0; ++ } ++ ++ s->err_hook(s, se); ++} ++ ++void + sk_dump_all(void) + { + node *n; +@@ -2163,7 +2177,7 @@ io_loop(void) + int steps; + + steps = MAX_STEPS; +- if (s->fast_rx && (pfd[s->index].revents & (POLLIN | POLLHUP | POLLERR)) && s->rx_hook) ++ if (s->fast_rx && (pfd[s->index].revents & POLLIN) && s->rx_hook) + do + { + steps--; +@@ -2185,6 +2199,7 @@ io_loop(void) + goto next; + } + while (e && steps); ++ + current_sock = sk_next(s); + next: ; + } +@@ -2208,18 +2223,26 @@ io_loop(void) + goto next2; + } + +- if (!s->fast_rx && (pfd[s->index].revents & (POLLIN | POLLHUP | POLLERR)) && s->rx_hook) ++ if (!s->fast_rx && (pfd[s->index].revents & POLLIN) && s->rx_hook) + { + count++; + io_log_event(s->rx_hook, s->data); + sk_read(s, pfd[s->index].revents); + if (s != current_sock) +- goto next2; ++ goto next2; ++ } ++ ++ if (pfd[s->index].revents & (POLLHUP | POLLERR)) ++ { ++ sk_err(s, pfd[s->index].revents); ++ goto next2; + } ++ + current_sock = sk_next(s); + next2: ; + } + ++ + stored_sock = current_sock; + } + }