From owner-svn-src-all@FreeBSD.ORG Mon Jan 12 09:48:47 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29E634CC; Mon, 12 Jan 2015 09:48:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 15A38F2; Mon, 12 Jan 2015 09:48:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0C9mkF9005222; Mon, 12 Jan 2015 09:48:46 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0C9mkMx005218; Mon, 12 Jan 2015 09:48:46 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201501120948.t0C9mkMx005218@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 12 Jan 2015 09:48:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277058 - in head: share/man/man4 sys/netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2015 09:48:47 -0000 Author: glebius Date: Mon Jan 12 09:48:45 2015 New Revision: 277058 URL: https://svnweb.freebsd.org/changeset/base/277058 Log: Remove the support for NGM_CISCO_GET_IPADDR message from ng_iface(4). The legitimacy of removal is proved by the fact that implementation contained a critical bug: the response allocated was sizeof(pointer), while should had been 2*sizeof(struct ng_cisco_ipaddr). The reason for ng_iface(4) to support ng_cisco(4) message isn't explained anywhere, and code comes from original Whistle import. Sponsored by: Nginx, Inc. Modified: head/share/man/man4/ng_iface.4 head/sys/netgraph/ng_iface.c Modified: head/share/man/man4/ng_iface.4 ============================================================================== --- head/share/man/man4/ng_iface.4 Mon Jan 12 09:46:49 2015 (r277057) +++ head/share/man/man4/ng_iface.4 Mon Jan 12 09:48:45 2015 (r277058) @@ -35,7 +35,7 @@ .\" $FreeBSD$ .\" $Whistle: ng_iface.8,v 1.5 1999/01/25 23:46:26 archie Exp $ .\" -.Dd October 28, 2005 +.Dd January 12, 2015 .Dt NG_IFACE 4 .Os .Sh NAME @@ -111,12 +111,6 @@ The interface must not currently be up. .It Dv NGM_IFACE_BROADCAST Pq Ic broadcast Set the interface to broadcast mode. The interface must not currently be up. -.It Dv NGM_CISCO_GET_IPADDR Pq Ic getipaddr -This message is defined by the -.Xr ng_cisco 4 -node type; see -.Xr ng_cisco 4 -for a description. .El .Sh SHUTDOWN This node shuts down upon receipt of a Modified: head/sys/netgraph/ng_iface.c ============================================================================== --- head/sys/netgraph/ng_iface.c Mon Jan 12 09:46:49 2015 (r277057) +++ head/sys/netgraph/ng_iface.c Mon Jan 12 09:48:45 2015 (r277058) @@ -83,7 +83,6 @@ #include #include #include -#include #ifdef NG_SEPARATE_MALLOC static MALLOC_DEFINE(M_NETGRAPH_IFACE, "netgraph_iface", "netgraph iface node"); @@ -144,14 +143,6 @@ static iffam_p get_iffam_from_hook(priv_ static iffam_p get_iffam_from_name(const char *name); static hook_p *get_hook_from_iffam(priv_p priv, iffam_p iffam); -/* Parse type for struct ng_cisco_ipaddr */ -static const struct ng_parse_struct_field ng_cisco_ipaddr_type_fields[] - = NG_CISCO_IPADDR_TYPE_INFO; -static const struct ng_parse_type ng_cisco_ipaddr_type = { - &ng_parse_struct_type, - &ng_cisco_ipaddr_type_fields -}; - /* List of commands and how to convert arguments to/from ASCII */ static const struct ng_cmdlist ng_iface_cmds[] = { { @@ -176,13 +167,6 @@ static const struct ng_cmdlist ng_iface_ NULL }, { - NGM_CISCO_COOKIE, - NGM_CISCO_GET_IPADDR, - "getipaddr", - NULL, - &ng_cisco_ipaddr_type - }, - { NGM_IFACE_COOKIE, NGM_IFACE_GET_IFINDEX, "getifindex", @@ -652,43 +636,6 @@ ng_iface_rcvmsg(node_p node, item_p item break; } break; - case NGM_CISCO_COOKIE: - switch (msg->header.cmd) { - case NGM_CISCO_GET_IPADDR: /* we understand this too */ - { - struct ifaddr *ifa; - - /* Return the first configured IP address */ - if_addr_rlock(ifp); - TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - struct ng_cisco_ipaddr *ips; - - if (ifa->ifa_addr->sa_family != AF_INET) - continue; - NG_MKRESPONSE(resp, msg, sizeof(ips), M_NOWAIT); - if (resp == NULL) { - error = ENOMEM; - break; - } - ips = (struct ng_cisco_ipaddr *)resp->data; - ips->ipaddr = ((struct sockaddr_in *) - ifa->ifa_addr)->sin_addr; - ips->netmask = ((struct sockaddr_in *) - ifa->ifa_netmask)->sin_addr; - break; - } - if_addr_runlock(ifp); - - /* No IP addresses on this interface? */ - if (ifa == NULL) - error = EADDRNOTAVAIL; - break; - } - default: - error = EINVAL; - break; - } - break; case NGM_FLOW_COOKIE: switch (msg->header.cmd) { case NGM_LINK_IS_UP: