diff options
author | Gleb Smirnoff <glebius@FreeBSD.org> | 2015-01-12 09:48:45 +0000 |
---|---|---|
committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2015-01-12 09:48:45 +0000 |
commit | 42c3b709c2b6997d251888194b6973ade2ae8eb1 (patch) | |
tree | e1211fffe3e89eba69d108042db88af0bb3ceb87 /sys/netgraph | |
parent | 748bd8295751e2dc7587bce32a5d1899c02cf7a7 (diff) | |
download | src-42c3b709c2b6997d251888194b6973ade2ae8eb1.tar.gz src-42c3b709c2b6997d251888194b6973ade2ae8eb1.zip |
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.
Notes
Notes:
svn path=/head/; revision=277058
Diffstat (limited to 'sys/netgraph')
-rw-r--r-- | sys/netgraph/ng_iface.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/sys/netgraph/ng_iface.c b/sys/netgraph/ng_iface.c index 5aec8a3395b3..814457ea6380 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: |