Skip to content

Commit

Permalink
Replace the redundant MENTAT macro with SOLARIS.
Browse files Browse the repository at this point in the history
MENTAT and SOLARIS are synonymous. Remove the extraneous duplicate
macro.

MFC after:	1 week
  • Loading branch information
cschuber committed Feb 2, 2021
1 parent 7071734 commit 0f34c80
Show file tree
Hide file tree
Showing 13 changed files with 69 additions and 71 deletions.
50 changes: 25 additions & 25 deletions contrib/ipfilter/ip_fil_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ typedef struct fr_info_4_1_32 {
ip_t *ofin_ip;
mb_t **fin_mp; /* pointer to pointer to mbuf */
mb_t *fin_m; /* pointer to mbuf */
#ifdef MENTAT
#if SOLARIS
mb_t *fin_qfm; /* pointer to mblk where pkt starts */
void *fin_qpi;
char fin_ifname[LIFNAMSIZ];
Expand Down Expand Up @@ -371,7 +371,7 @@ typedef struct fr_info_4_1_24 {
ip_t *ofin_ip;
mb_t **fin_mp;
mb_t *fin_m;
#ifdef MENTAT
#if SOLARIS
mb_t *fin_qfm;
void *fin_qpi;
char fin_ifname[LIFNAMSIZ];
Expand Down Expand Up @@ -408,7 +408,7 @@ typedef struct fr_info_4_1_23 {
ip_t *ofin_ip;
mb_t **fin_mp;
mb_t *fin_m;
#ifdef MENTAT
#if SOLARIS
mb_t *fin_qfm;
void *fin_qpi;
char fin_ifname[LIFNAMSIZ];
Expand Down Expand Up @@ -444,7 +444,7 @@ typedef struct fr_info_4_1_11 {
ip_t *ofin_ip;
mb_t **fin_mp;
mb_t *fin_m;
#ifdef MENTAT
#if SOLARIS
mb_t *fin_qfm;
void *fin_qpi;
char fin_ifname[LIFNAMSIZ];
Expand Down Expand Up @@ -933,7 +933,7 @@ typedef struct frauth_4_1_32 {
fr_info_4_1_32_t fra_info;
char *fra_buf;
u_32_t fra_flx;
#ifdef MENTAT
#if SOLARIS
queue_t *fra_q;
mb_t *fra_m;
#endif
Expand All @@ -947,7 +947,7 @@ typedef struct frauth_4_1_29 {
fr_info_4_1_24_t fra_info;
char *fra_buf;
u_32_t fra_flx;
#ifdef MENTAT
#if SOLARIS
queue_t *fra_q;
mb_t *fra_m;
#endif
Expand All @@ -960,7 +960,7 @@ typedef struct frauth_4_1_24 {
u_32_t fra_pass;
fr_info_4_1_24_t fra_info;
char *fra_buf;
#ifdef MENTAT
#if SOLARIS
queue_t *fra_q;
mb_t *fra_m;
#endif
Expand All @@ -973,7 +973,7 @@ typedef struct frauth_4_1_23 {
u_32_t fra_pass;
fr_info_4_1_23_t fra_info;
char *fra_buf;
#ifdef MENTAT
#if SOLARIS
queue_t *fra_q;
mb_t *fra_m;
#endif
Expand All @@ -986,7 +986,7 @@ typedef struct frauth_4_1_11 {
u_32_t fra_pass;
fr_info_4_1_11_t fra_info;
char *fra_buf;
#ifdef MENTAT
#if SOLARIS
queue_t *fra_q;
mb_t *fra_m;
#endif
Expand Down Expand Up @@ -2533,7 +2533,7 @@ frauth_4_1_32_to_current(old, current)
fr_info_4_1_32_to_current(&old->fra_info, &fra->fra_info);
fra->fra_buf = old->fra_buf;
fra->fra_flx = old->fra_flx;
#ifdef MENTAT
#if SOLARIS
fra->fra_q = old->fra_q;
fra->fra_m = old->fra_m;
#endif
Expand All @@ -2554,7 +2554,7 @@ frauth_4_1_29_to_current(old, current)
fr_info_4_1_24_to_current(&old->fra_info, &fra->fra_info);
fra->fra_buf = old->fra_buf;
fra->fra_flx = old->fra_flx;
#ifdef MENTAT
#if SOLARIS
fra->fra_q = old->fra_q;
fra->fra_m = old->fra_m;
#endif
Expand All @@ -2574,7 +2574,7 @@ frauth_4_1_24_to_current(old, current)
fra->fra_pass = old->fra_pass;
fr_info_4_1_24_to_current(&old->fra_info, &fra->fra_info);
fra->fra_buf = old->fra_buf;
#ifdef MENTAT
#if SOLARIS
fra->fra_q = old->fra_q;
fra->fra_m = old->fra_m;
#endif
Expand All @@ -2594,7 +2594,7 @@ frauth_4_1_23_to_current(old, current)
fra->fra_pass = old->fra_pass;
fr_info_4_1_23_to_current(&old->fra_info, &fra->fra_info);
fra->fra_buf = old->fra_buf;
#ifdef MENTAT
#if SOLARIS
fra->fra_q = old->fra_q;
fra->fra_m = old->fra_m;
#endif
Expand All @@ -2614,7 +2614,7 @@ frauth_4_1_11_to_current(old, current)
fra->fra_pass = old->fra_pass;
fr_info_4_1_11_to_current(&old->fra_info, &fra->fra_info);
fra->fra_buf = old->fra_buf;
#ifdef MENTAT
#if SOLARIS
fra->fra_q = old->fra_q;
fra->fra_m = old->fra_m;
#endif
Expand Down Expand Up @@ -2652,7 +2652,7 @@ fr_info_4_1_32_to_current(old, current)
fin->fin_ip = old->ofin_ip;
fin->fin_mp = old->fin_mp;
fin->fin_m = old->fin_m;
#ifdef MENTAT
#if SOLARIS
fin->fin_qfm = old->fin_qfm;
fin->fin_qpi = old->fin_qpi;
#endif
Expand Down Expand Up @@ -2690,7 +2690,7 @@ fr_info_4_1_24_to_current(old, current)
fin->fin_ip = old->ofin_ip;
fin->fin_mp = old->fin_mp;
fin->fin_m = old->fin_m;
#ifdef MENTAT
#if SOLARIS
fin->fin_qfm = old->fin_qfm;
fin->fin_qpi = old->fin_qpi;
#endif
Expand Down Expand Up @@ -2727,7 +2727,7 @@ fr_info_4_1_23_to_current(old, current)
fin->fin_ip = old->ofin_ip;
fin->fin_mp = old->fin_mp;
fin->fin_m = old->fin_m;
#ifdef MENTAT
#if SOLARIS
fin->fin_qfm = old->fin_qfm;
fin->fin_qpi = old->fin_qpi;
#endif
Expand Down Expand Up @@ -2764,7 +2764,7 @@ fr_info_4_1_11_to_current(old, current)
fin->fin_ip = old->ofin_ip;
fin->fin_mp = old->fin_mp;
fin->fin_m = old->fin_m;
#ifdef MENTAT
#if SOLARIS
fin->fin_qfm = old->fin_qfm;
fin->fin_qpi = old->fin_qpi;
#endif
Expand Down Expand Up @@ -4039,7 +4039,7 @@ fr_info_current_to_4_1_24(current, old)
old->ofin_ip = fin->fin_ip;
old->fin_mp = fin->fin_mp;
old->fin_m = fin->fin_m;
#ifdef MENTAT
#if SOLARIS
old->fin_qfm = fin->fin_qfm;
old->fin_qpi = fin->fin_qpi;
old->fin_ifname[0] = '\0';
Expand Down Expand Up @@ -4079,7 +4079,7 @@ fr_info_current_to_4_1_23(current, old)
old->ofin_ip = fin->fin_ip;
old->fin_mp = fin->fin_mp;
old->fin_m = fin->fin_m;
#ifdef MENTAT
#if SOLARIS
old->fin_qfm = fin->fin_qfm;
old->fin_qpi = fin->fin_qpi;
old->fin_ifname[0] = '\0';
Expand Down Expand Up @@ -4119,7 +4119,7 @@ fr_info_current_to_4_1_11(current, old)
old->ofin_ip = fin->fin_ip;
old->fin_mp = fin->fin_mp;
old->fin_m = fin->fin_m;
#ifdef MENTAT
#if SOLARIS
old->fin_qfm = fin->fin_qfm;
old->fin_qpi = fin->fin_qpi;
old->fin_ifname[0] = '\0';
Expand All @@ -4141,7 +4141,7 @@ frauth_current_to_4_1_29(current, old)
fr_info_current_to_4_1_24(&fra->fra_info, &old->fra_info);
old->fra_buf = fra->fra_buf;
old->fra_flx = fra->fra_flx;
#ifdef MENTAT
#if SOLARIS
old->fra_q = fra->fra_q;
old->fra_m = fra->fra_m;
#endif
Expand All @@ -4161,7 +4161,7 @@ frauth_current_to_4_1_24(current, old)
old->fra_pass = fra->fra_pass;
fr_info_current_to_4_1_24(&fra->fra_info, &old->fra_info);
old->fra_buf = fra->fra_buf;
#ifdef MENTAT
#if SOLARIS
old->fra_q = fra->fra_q;
old->fra_m = fra->fra_m;
#endif
Expand All @@ -4181,7 +4181,7 @@ frauth_current_to_4_1_23(current, old)
old->fra_pass = fra->fra_pass;
fr_info_current_to_4_1_23(&fra->fra_info, &old->fra_info);
old->fra_buf = fra->fra_buf;
#ifdef MENTAT
#if SOLARIS
old->fra_q = fra->fra_q;
old->fra_m = fra->fra_m;
#endif
Expand All @@ -4201,7 +4201,7 @@ frauth_current_to_4_1_11(current, old)
old->fra_pass = fra->fra_pass;
fr_info_current_to_4_1_11(&fra->fra_info, &old->fra_info);
old->fra_buf = fra->fra_buf;
#ifdef MENTAT
#if SOLARIS
old->fra_q = fra->fra_q;
old->fra_m = fra->fra_m;
#endif
Expand Down
4 changes: 2 additions & 2 deletions contrib/ipfilter/tools/ipmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ char *reasons[] = {
"natv6_in-fail",
};

#ifdef MENTAT
#if SOLARIS
static char *pidfile = "/etc/opt/ipf/ipmon.pid";
#else
static char *pidfile = "/var/run/ipmon.pid";
Expand Down Expand Up @@ -1108,7 +1108,7 @@ static void print_ipflog(conf, buf, blen)
ifname[sizeof(ipf->fl_ifname)] = '\0';
sprintf(t, "%s", ifname);
t += strlen(t);
# if defined(MENTAT)
# if SOLARIS
if (ISALPHA(*(t - 1))) {
sprintf(t, "%d", ipf->fl_unit);
t += strlen(t);
Expand Down
24 changes: 12 additions & 12 deletions sys/contrib/ipfilter/netinet/fil.c
Original file line number Diff line number Diff line change
Expand Up @@ -2805,7 +2805,7 @@ ipf_firewall(fin, passp)
/* ------------------------------------------------------------------------ */
int
ipf_check(ctx, ip, hlen, ifp, out
#if defined(_KERNEL) && defined(MENTAT)
#if defined(_KERNEL) && SOLARIS
, qif, mp)
void *qif;
#else
Expand Down Expand Up @@ -2837,7 +2837,7 @@ ipf_check(ctx, ip, hlen, ifp, out
* to hold all the required packet headers.
*/
#ifdef _KERNEL
# ifdef MENTAT
# if SOLARIS
qpktinfo_t *qpi = qif;

# ifdef __sparc
Expand All @@ -2854,15 +2854,15 @@ ipf_check(ctx, ip, hlen, ifp, out

bzero((char *)fin, sizeof(*fin));

# ifdef MENTAT
# if SOLARIS
if (qpi->qpi_flags & QF_BROADCAST)
fin->fin_flx |= FI_MBCAST|FI_BROADCAST;
if (qpi->qpi_flags & QF_MULTICAST)
fin->fin_flx |= FI_MBCAST|FI_MULTICAST;
m = qpi->qpi_m;
fin->fin_qfm = m;
fin->fin_qpi = qpi;
# else /* MENTAT */
# else /* SOLARIS */

m = *mp;

Expand Down Expand Up @@ -2895,7 +2895,7 @@ ipf_check(ctx, ip, hlen, ifp, out
m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA;
}
# endif /* CSUM_DELAY_DATA */
# endif /* MENTAT */
# endif /* SOLARIS */
#else
bzero((char *)fin, sizeof(*fin));
m = *mp;
Expand Down Expand Up @@ -6156,7 +6156,7 @@ ipf_getifname(ifp, buffer)
char *buffer;
{
static char namebuf[LIFNAMSIZ];
# if defined(MENTAT) || defined(__FreeBSD__)
# if SOLARIS || defined(__FreeBSD__)
int unit, space;
char temp[20];
char *s;
Expand All @@ -6166,7 +6166,7 @@ ipf_getifname(ifp, buffer)
buffer = namebuf;
(void) strncpy(buffer, ifp->if_name, LIFNAMSIZ);
buffer[LIFNAMSIZ - 1] = '\0';
# if defined(MENTAT) || defined(__FreeBSD__)
# if SOLARIS || defined(__FreeBSD__)
for (s = buffer; *s; s++)
;
unit = ifp->if_unit;
Expand Down Expand Up @@ -6916,7 +6916,7 @@ ipf_coalesce(fin)

DT1(frb_coalesce, fr_info_t *, fin);
LBUMP(ipf_stats[fin->fin_out].fr_badcoalesces);
# ifdef MENTAT
# if SOLARIS
FREE_MB_T(*fin->fin_mp);
# endif
fin->fin_reason = FRB_COALESCE;
Expand Down Expand Up @@ -8397,7 +8397,7 @@ ipf_ipf_ioctl(softc, data, cmd, mode, uid, ctx)
error = EPERM;
} else {
WRITE_ENTER(&softc->ipf_global);
#if (defined(MENTAT) && defined(_KERNEL)) && !defined(INSTANCES)
#if (SOLARIS && defined(_KERNEL)) && !defined(INSTANCES)
error = ipfsync();
#else
ipf_sync(softc, NULL);
Expand Down Expand Up @@ -8570,7 +8570,7 @@ ipf_decaps(fin, pass, l5proto)
fino = fin;
fin = &fin2;
elen = hlen;
#if defined(MENTAT) && defined(_KERNEL)
#if SOLARIS && defined(_KERNEL)
m->b_rptr += elen;
#else
m->m_data += elen;
Expand Down Expand Up @@ -8609,7 +8609,7 @@ ipf_decaps(fin, pass, l5proto)
if (ipf_makefrip(hlen, ip, fin) == -1) {
cantdecaps2:
if (m != NULL) {
#if defined(MENTAT) && defined(_KERNEL)
#if SOLARIS && defined(_KERNEL)
m->b_rptr -= elen;
#else
m->m_data -= elen;
Expand Down Expand Up @@ -8642,7 +8642,7 @@ ipf_decaps(fin, pass, l5proto)
fino->fin_m = fin->fin_m;
m = fin->fin_m;
if (m != NULL) {
#if defined(MENTAT) && defined(_KERNEL)
#if SOLARIS && defined(_KERNEL)
m->b_rptr -= elen;
#else
m->m_data -= elen;
Expand Down
6 changes: 3 additions & 3 deletions sys/contrib/ipfilter/netinet/ip_auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
#include <netinet/tcpip.h>
#include "netinet/ip_fil.h"
#include "netinet/ip_auth.h"
#if !defined(MENTAT)
#if !SOLARIS
# include <net/netisr.h>
# ifdef __FreeBSD__
# include <machine/cpufunc.h>
Expand Down Expand Up @@ -466,7 +466,7 @@ ipf_auth_new(m, fin)
{
ipf_main_softc_t *softc = fin->fin_main_soft;
ipf_auth_softc_t *softa = softc->ipf_auth_soft;
#if defined(_KERNEL) && defined(MENTAT)
#if defined(_KERNEL) && SOLARIS
qpktinfo_t *qpi = fin->fin_qpi;
#endif
frauth_t *fra;
Expand Down Expand Up @@ -508,7 +508,7 @@ ipf_auth_new(m, fin)
* them.
*/
ip = fin->fin_ip;
# if defined(MENTAT) && defined(_KERNEL)
# if SOLARIS && defined(_KERNEL)
if ((ip == (ip_t *)m->b_rptr) && (fin->fin_v == 4))
# endif
{
Expand Down
2 changes: 1 addition & 1 deletion sys/contrib/ipfilter/netinet/ip_auth.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ typedef struct frauth {
fr_info_t fra_info;
char *fra_buf;
u_32_t fra_flx;
#ifdef MENTAT
#if SOLARIS
queue_t *fra_q;
mb_t *fra_m;
#endif
Expand Down
2 changes: 1 addition & 1 deletion sys/contrib/ipfilter/netinet/ip_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ typedef struct ip6_hdr ip6_t;
#endif

#if defined(_KERNEL)
# if defined(MENTAT) && !defined(INSTANCES)
# if SOLARIS && !defined(INSTANCES)
# define COPYDATA mb_copydata
# define COPYBACK mb_copyback
# else
Expand Down
Loading

0 comments on commit 0f34c80

Please sign in to comment.