mirror of
https://github.com/opnsense/src.git
synced 2026-06-10 17:22:46 -04:00
netgraph: revert an unused patch to the standard FreeBSD 10.2 state
(cherry picked from commit b04f2d8598)
This commit is contained in:
parent
55e09cf1f6
commit
b6c07be9be
2 changed files with 0 additions and 54 deletions
|
|
@ -43,7 +43,6 @@
|
|||
#include <net/if.h>
|
||||
#include <net/if_media.h>
|
||||
#include <net/if_types.h>
|
||||
#include <net/if_dl.h>
|
||||
#include <net/netisr.h>
|
||||
#include <net/route.h>
|
||||
#include <net/vnet.h>
|
||||
|
|
@ -65,13 +64,6 @@ static const struct ng_cmdlist ng_eiface_cmdlist[] = {
|
|||
NULL,
|
||||
&ng_parse_string_type
|
||||
},
|
||||
{
|
||||
NGM_EIFACE_COOKIE,
|
||||
NGM_EIFACE_SET_IFNAME,
|
||||
"setifname",
|
||||
&ng_parse_string_type,
|
||||
NULL
|
||||
},
|
||||
{
|
||||
NGM_EIFACE_COOKIE,
|
||||
NGM_EIFACE_SET,
|
||||
|
|
@ -478,11 +470,6 @@ ng_eiface_rcvmsg(node_p node, item_p item, hook_p lasthook)
|
|||
struct ng_mesg *resp = NULL;
|
||||
int error = 0;
|
||||
struct ng_mesg *msg;
|
||||
char *new_name;
|
||||
size_t namelen, onamelen;
|
||||
struct sockaddr_dl *sdl = NULL;
|
||||
struct ifaddr *ifa = NULL;
|
||||
node_p ethernode;
|
||||
|
||||
NGI_GET_MSG(item, msg);
|
||||
switch (msg->header.typecookie) {
|
||||
|
|
@ -509,46 +496,6 @@ ng_eiface_rcvmsg(node_p node, item_p item, hook_p lasthook)
|
|||
}
|
||||
strlcpy(resp->data, ifp->if_xname, IFNAMSIZ);
|
||||
break;
|
||||
case NGM_EIFACE_SET_IFNAME:
|
||||
new_name = (char *)msg->data;
|
||||
|
||||
/* Deny request if interface is UP */
|
||||
if ((ifp->if_flags & IFF_UP) != 0) {
|
||||
error = EBUSY;
|
||||
break;
|
||||
}
|
||||
|
||||
EVENTHANDLER_INVOKE(ifnet_departure_event, ifp);
|
||||
|
||||
ethernode = ng_name2noderef(node, ifp->if_xname);
|
||||
if (ethernode != NULL)
|
||||
ng_name_node(ethernode, new_name);
|
||||
|
||||
IF_ADDR_WLOCK(ifp);
|
||||
strlcpy(ifp->if_xname, new_name, sizeof(ifp->if_xname));
|
||||
ifa = ifp->if_addr;
|
||||
sdl = (struct sockaddr_dl *)ifa->ifa_addr;
|
||||
namelen = strlen(new_name) + 1;
|
||||
onamelen = sdl->sdl_nlen;
|
||||
/*
|
||||
* Move the address if needed. This is safe because we
|
||||
* allocate space for a name of length IFNAMSIZ when we
|
||||
* create this in if_attach().
|
||||
*/
|
||||
if (namelen != onamelen) {
|
||||
bcopy(sdl->sdl_data + onamelen,
|
||||
sdl->sdl_data + namelen, sdl->sdl_alen);
|
||||
}
|
||||
bcopy(new_name, sdl->sdl_data, namelen);
|
||||
sdl->sdl_nlen = namelen;
|
||||
sdl = (struct sockaddr_dl *)ifa->ifa_netmask;
|
||||
bzero(sdl->sdl_data, onamelen);
|
||||
while (namelen != 0)
|
||||
sdl->sdl_data[--namelen] = 0xff;
|
||||
IF_ADDR_WUNLOCK(ifp);
|
||||
|
||||
EVENTHANDLER_INVOKE(ifnet_arrival_event, ifp);
|
||||
break;
|
||||
|
||||
case NGM_EIFACE_GET_IFADDRS:
|
||||
{
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@ enum {
|
|||
NGM_EIFACE_GET_IFNAME = 1, /* get the interface name */
|
||||
NGM_EIFACE_GET_IFADDRS, /* returns list of addresses */
|
||||
NGM_EIFACE_SET, /* set ethernet address */
|
||||
NGM_EIFACE_SET_IFNAME,
|
||||
};
|
||||
|
||||
#endif /* _NETGRAPH_NG_EIFACE_H_ */
|
||||
|
|
|
|||
Loading…
Reference in a new issue