summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_iface.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2015-01-12 09:48:45 +0000
committerglebius <glebius@FreeBSD.org>2015-01-12 09:48:45 +0000
commitfc986ff561a8b6ae4ae01d40a8c04adaf8ef0ca7 (patch)
treee1211fffe3e89eba69d108042db88af0bb3ceb87 /sys/netgraph/ng_iface.c
parent84a33eb82c326bdab87b4c636228dbb9091d7c8b (diff)
downloadFreeBSD-src-fc986ff561a8b6ae4ae01d40a8c04adaf8ef0ca7.zip
FreeBSD-src-fc986ff561a8b6ae4ae01d40a8c04adaf8ef0ca7.tar.gz
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.
Diffstat (limited to 'sys/netgraph/ng_iface.c')
-rw-r--r--sys/netgraph/ng_iface.c53
1 files changed, 0 insertions, 53 deletions
diff --git a/sys/netgraph/ng_iface.c b/sys/netgraph/ng_iface.c
index 5aec8a3..814457e 100644
--- a/sys/netgraph/ng_iface.c
+++ b/sys/netgraph/ng_iface.c
@@ -83,7 +83,6 @@
#include <netgraph/netgraph.h>
#include <netgraph/ng_parse.h>
#include <netgraph/ng_iface.h>
-#include <netgraph/ng_cisco.h>
#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_p priv, hook_p hook);
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_cmds[] = {
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, hook_p lasthook)
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:
OpenPOWER on IntegriCloud