From owner-svn-ports-all@freebsd.org Mon Jan 4 07:03:18 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 3839EA5FBFF; Mon, 4 Jan 2016 07:03:18 +0000 (UTC) (envelope-from hrs@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 EB51C19EC; Mon, 4 Jan 2016 07:03:17 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0473HYr082481; Mon, 4 Jan 2016 07:03:17 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0473Gku082477; Mon, 4 Jan 2016 07:03:16 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201601040703.u0473Gku082477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Mon, 4 Jan 2016 07:03:16 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r405216 - in head/net/dhcp6: . 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.20 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: Mon, 04 Jan 2016 07:03:18 -0000 Author: hrs Date: Mon Jan 4 07:03:16 2016 New Revision: 405216 URL: https://svnweb.freebsd.org/changeset/ports/405216 Log: Add patches to fix the following bugs: - Fix renewal of IA_NA [*] - Update ifid on interface restart, it may have changed [*] - Remove unnecessary PF_ROUTE socket. [*] - Fix wrong length used in memset(). Obtained from: Debian/Ubuntu/Fedora/Red Hat packages via OpenBSD [*] Suggested by: Brad Smith [*] Added: head/net/dhcp6/files/patch-addrconf.c (contents, props changed) head/net/dhcp6/files/patch-auth.c (contents, props changed) Modified: head/net/dhcp6/Makefile head/net/dhcp6/files/patch-dhcp6c.c Modified: head/net/dhcp6/Makefile ============================================================================== --- head/net/dhcp6/Makefile Mon Jan 4 06:44:45 2016 (r405215) +++ head/net/dhcp6/Makefile Mon Jan 4 07:03:16 2016 (r405216) @@ -3,7 +3,7 @@ PORTNAME= dhcp6 PORTVERSION= 20080615 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= net ipv6 MASTER_SITES= SF/wide-dhcpv6/wide-dhcpv6/wide-dhcpv6-${PORTVERSION} DISTNAME= wide-dhcpv6-${PORTVERSION} Added: head/net/dhcp6/files/patch-addrconf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/dhcp6/files/patch-addrconf.c Mon Jan 4 07:03:16 2016 (r405216) @@ -0,0 +1,11 @@ +--- addrconf.c.orig 2008-06-15 07:48:40 UTC ++++ addrconf.c +@@ -173,7 +173,7 @@ update_address(ia, addr, dhcpifp, ctlp, + sacreate ? "create" : "update", + in6addr2str(&addr->addr, 0), addr->pltime, addr->vltime); + +- if (sa->addr.vltime != 0) ++ if (sa->addr.vltime != 0 || sacreate) + if (na_ifaddrconf(IFADDRCONF_ADD, sa) < 0) + return (-1); + Added: head/net/dhcp6/files/patch-auth.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/dhcp6/files/patch-auth.c Mon Jan 4 07:03:16 2016 (r405216) @@ -0,0 +1,11 @@ +--- auth.c.orig 2007-03-21 09:52:57 UTC ++++ auth.c +@@ -222,7 +222,7 @@ hmacmd5_invalidate(hmacmd5_t *ctx) + { + md5_invalidate(&ctx->md5ctx); + memset(ctx->key, 0, sizeof(ctx->key)); +- memset(ctx, 0, sizeof(ctx)); ++ memset(ctx, 0, sizeof(*ctx)); + } + + /* Modified: head/net/dhcp6/files/patch-dhcp6c.c ============================================================================== --- head/net/dhcp6/files/patch-dhcp6c.c Mon Jan 4 06:44:45 2016 (r405215) +++ head/net/dhcp6/files/patch-dhcp6c.c Mon Jan 4 07:03:16 2016 (r405216) @@ -8,7 +8,15 @@ #include #include -@@ -257,7 +258,7 @@ client6_init() +@@ -88,7 +89,6 @@ static sig_atomic_t sig_flags = 0; + const dhcp6_mode_t dhcp6_mode = DHCP6_MODE_CLIENT; + + int sock; /* inbound/outbound udp port */ +-int rtsock; /* routing socket */ + int ctlsock = -1; /* control TCP port */ + char *ctladdr = DEFAULT_CLIENT_CONTROL_ADDR; + char *ctlport = DEFAULT_CLIENT_CONTROL_PORT; +@@ -257,7 +257,7 @@ client6_init() { struct addrinfo hints, *res; static struct sockaddr_in6 sa6_allagent_storage; @@ -17,7 +25,7 @@ /* get our DUID */ if (get_duid(DUID_FILE, &client_duid)) { -@@ -287,6 +288,20 @@ client6_init() +@@ -287,6 +287,20 @@ client6_init() dprintf(LOG_ERR, FNAME, "socket"); exit(1); } @@ -38,7 +46,55 @@ if (setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, &on, sizeof(on)) < 0) { dprintf(LOG_ERR, FNAME, -@@ -1828,15 +1843,6 @@ client6_recvreply(ifp, dh6, len, optinfo +@@ -337,13 +351,6 @@ client6_init() + } + freeaddrinfo(res); + +- /* open a routing socket to watch the routing table */ +- if ((rtsock = socket(PF_ROUTE, SOCK_RAW, 0)) < 0) { +- dprintf(LOG_ERR, FNAME, "open a routing socket: %s", +- strerror(errno)); +- exit(1); +- } +- + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_INET6; + hints.ai_socktype = SOCK_DGRAM; +@@ -596,7 +603,7 @@ get_ifname(bpp, lenp, ifbuf, ifbuflen) + if (*lenp < ifnamelen || ifnamelen > ifbuflen) + return (-1); + +- memset(ifbuf, 0, sizeof(ifbuf)); ++ memset(ifbuf, 0, ifbuflen); + memcpy(ifbuf, *bpp, ifnamelen); + if (ifbuf[ifbuflen - 1] != '\0') + return (-1); /* not null terminated */ +@@ -763,6 +770,15 @@ client6_ifctl(ifname, command) + + switch(command) { + case DHCP6CTL_COMMAND_START: ++ /* ++ * The ifid might have changed, so reset it before releasing the ++ * lease. ++ */ ++ if (ifreset(ifp)) { ++ dprintf(LOG_NOTICE, FNAME, "failed to reset %s", ++ ifname); ++ return (-1); ++ } + free_resources(ifp); + if (client6_start(ifp)) { + dprintf(LOG_NOTICE, FNAME, "failed to restart %s", +@@ -929,7 +945,7 @@ construct_confdata(ifp, ev) + "failed to create a new event data"); + goto fail; + } +- memset(evd, 0, sizeof(evd)); ++ memset(evd, 0, sizeof(*evd)); + + memset(&iaparam, 0, sizeof(iaparam)); + iaparam.iaid = iac->iaid; +@@ -1828,15 +1844,6 @@ client6_recvreply(ifp, dh6, len, optinfo } /* @@ -54,7 +110,7 @@ * Set refresh timer for configuration information specified in * information-request. If the timer value is specified by the server * in an information refresh time option, use it; use the protocol -@@ -1888,6 +1894,15 @@ client6_recvreply(ifp, dh6, len, optinfo +@@ -1888,6 +1895,15 @@ client6_recvreply(ifp, dh6, len, optinfo &optinfo->serverID, ev->authparam); }