-/* $OpenBSD: if.c,v 1.700 2023/06/12 21:19:54 mvs Exp $ */
+/* $OpenBSD: if.c,v 1.701 2023/06/27 21:02:13 mvs Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
{
struct ifg_group *ifg;
- if ((ifg = malloc(sizeof(*ifg), M_TEMP, M_NOWAIT)) == NULL)
+ if ((ifg = malloc(sizeof(*ifg), M_IFGROUP, M_NOWAIT)) == NULL)
return (NULL);
strlcpy(ifg->ifg_group, groupname, sizeof(ifg->ifg_group));
if (!strcmp(ifgl->ifgl_group->ifg_group, groupname))
return (EEXIST);
- if ((ifgl = malloc(sizeof(*ifgl), M_TEMP, M_NOWAIT)) == NULL)
+ if ((ifgl = malloc(sizeof(*ifgl), M_IFGROUP, M_NOWAIT)) == NULL)
return (ENOMEM);
- if ((ifgm = malloc(sizeof(*ifgm), M_TEMP, M_NOWAIT)) == NULL) {
- free(ifgl, M_TEMP, sizeof(*ifgl));
+ if ((ifgm = malloc(sizeof(*ifgm), M_IFGROUP, M_NOWAIT)) == NULL) {
+ free(ifgl, M_IFGROUP, sizeof(*ifgl));
return (ENOMEM);
}
if (ifg == NULL) {
ifg = if_creategroup(groupname);
if (ifg == NULL) {
- free(ifgl, M_TEMP, sizeof(*ifgl));
- free(ifgm, M_TEMP, sizeof(*ifgm));
+ free(ifgl, M_IFGROUP, sizeof(*ifgl));
+ free(ifgm, M_IFGROUP, sizeof(*ifgm));
return (ENOMEM);
}
} else
if (ifgm != NULL) {
TAILQ_REMOVE(&ifgl->ifgl_group->ifg_members, ifgm, ifgm_next);
- free(ifgm, M_TEMP, sizeof(*ifgm));
+ free(ifgm, M_IFGROUP, sizeof(*ifgm));
}
#if NPF > 0
#if NPF > 0
pfi_detach_ifgroup(ifgl->ifgl_group);
#endif
- free(ifgl->ifgl_group, M_TEMP, sizeof(*ifgl->ifgl_group));
+ free(ifgl->ifgl_group, M_IFGROUP, sizeof(*ifgl->ifgl_group));
}
- free(ifgl, M_TEMP, sizeof(*ifgl));
+ free(ifgl, M_IFGROUP, sizeof(*ifgl));
return (0);
}
-/* $OpenBSD: malloc.h,v 1.122 2022/02/03 17:18:22 guenther Exp $ */
+/* $OpenBSD: malloc.h,v 1.123 2023/06/27 21:02:13 mvs Exp $ */
/* $NetBSD: malloc.h,v 1.39 1998/07/12 19:52:01 augustss Exp $ */
/*
/* 7 - free */
/* 8 - free */
#define M_IFADDR 9 /* interface address */
-/* 10 - free */
+#define M_IFGROUP 10 /* interface group */
#define M_SYSCTL 11 /* sysctl buffers (persistent storage) */
#define M_COUNTERS 12 /* per CPU counters */
/* 13 - free */
NULL, \
NULL, \
"ifaddr", /* 9 M_IFADDR */ \
- NULL, \
+ "ifgroup", /* 10 M_IFGROUP */ \
"sysctl", /* 11 M_SYSCTL */ \
"counters", /* 12 M_COUNTERS */ \
NULL, \