View | Details | Raw Unified | Return to bug 238796 | Differences between
and this patch

Collapse All | Expand All

(-)b/sys/contrib/ipfilter/netinet/fil.c (-1 / +28 lines)
Lines 4418-4423 ipf_matchicmpqueryreply(v, ic, icmp, rev) Link Here
4418
}
4418
}
4419
4419
4420
4420
4421
/* ------------------------------------------------------------------------ */
4422
/* Function:    ipf_ifnames_cmp                                             */
4423
/* Parameters:  fr1(I) - first rule structure to compare                    */
4424
/*              fr2(I) - second rule structure to compare                   */
4425
/* Returns:     int    - 0 == rules are the same, 1 == mismatch             */
4426
/*                                                                          */
4427
/* Compare two ifnames within frentry structures and return 0 if they       */
4428
/* match or 1 if they do not.                                               */
4429
/* ------------------------------------------------------------------------ */
4430
static int
4431
ipf_ifnames_cmp(const frentry_t *fr1, const frentry_t *fr2)
4432
{
4433
	int i, rc = 0;
4434
4435
	for (i = 0; i < 4; i++) {
4436
		if ((!fr1->fr_ifnames[i] && !fr2->fr_ifnames[i]) ||
4437
		    strcmp(FR_NAME(fr1, fr_ifnames[i]),
4438
		    	FR_NAME(fr2, fr_ifnames[i])) == 0)
4439
			continue;
4440
		rc = 1;
4441
	}
4442
	return (rc);
4443
}
4444
4445
4421
/* ------------------------------------------------------------------------ */
4446
/* ------------------------------------------------------------------------ */
4422
/* Function:    ipf_rule_compare                                            */
4447
/* Function:    ipf_rule_compare                                            */
4423
/* Parameters:  fr1(I) - first rule structure to compare                    */
4448
/* Parameters:  fr1(I) - first rule structure to compare                    */
Lines 4439-4451 ipf_rule_compare(frentry_t *fr1, frentry_t *fr2) Link Here
4439
	if (bcmp((char *)&fr1->fr_func, (char *)&fr2->fr_func, FR_CMPSIZ(fr1))
4464
	if (bcmp((char *)&fr1->fr_func, (char *)&fr2->fr_func, FR_CMPSIZ(fr1))
4440
	    != 0)
4465
	    != 0)
4441
		return (4);
4466
		return (4);
4467
	if (ipf_ifnames_cmp(fr1, fr2) != 0)
4468
		return (5);
4442
	if (!fr1->fr_data && !fr2->fr_data)
4469
	if (!fr1->fr_data && !fr2->fr_data)
4443
		return (0);	/* move along, nothing to see here */
4470
		return (0);	/* move along, nothing to see here */
4444
	if (fr1->fr_data && fr2->fr_data) {
4471
	if (fr1->fr_data && fr2->fr_data) {
4445
		if (bcmp(fr1->fr_caddr, fr2->fr_caddr, fr1->fr_dsize) == 0)
4472
		if (bcmp(fr1->fr_caddr, fr2->fr_caddr, fr1->fr_dsize) == 0)
4446
			return (0);	/* same */
4473
			return (0);	/* same */
4447
	}
4474
	}
4448
	return (5);
4475
	return (6);
4449
}
4476
}
4450
4477
4451
4478
(-)b/sys/contrib/ipfilter/netinet/ip_fil.h (-1 / +1 lines)
Lines 718-723 typedef struct frentry { Link Here
718
		fripf_t		*fru_ipf;
718
		fripf_t		*fru_ipf;
719
		frentfunc_t	fru_func;
719
		frentfunc_t	fru_func;
720
	} fr_dun;
720
	} fr_dun;
721
	int	fr_ifnames[4];
721
722
722
	/*
723
	/*
723
	 * Fields after this may not change whilst in the kernel.
724
	 * Fields after this may not change whilst in the kernel.
Lines 735-741 typedef struct frentry { Link Here
735
	u_char	fr_icode;	/* return ICMP code */
736
	u_char	fr_icode;	/* return ICMP code */
736
	int	fr_group;	/* group to which this rule belongs */
737
	int	fr_group;	/* group to which this rule belongs */
737
	int	fr_grhead;	/* group # which this rule starts */
738
	int	fr_grhead;	/* group # which this rule starts */
738
	int	fr_ifnames[4];
739
	int	fr_isctag;
739
	int	fr_isctag;
740
	int	fr_rpc;		/* XID Filtering */ 
740
	int	fr_rpc;		/* XID Filtering */ 
741
	ipftag_t fr_nattag;
741
	ipftag_t fr_nattag;

Return to bug 238796