Re: pf_ioctl.c question

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ryan McBride
Date: Sunday, October 4, 2009 - 6:00 am

I can't speak for everyone, but splitting the clauses of an if statement
with ifdefs makes my eyes bleed.

I would personally prefer to see these replaced with a switch statment,
as used elsewhere in PF; however this would probably need a goto that
points to the end of the main switch() statment to avoid insanely
complex costructs. Wait, that already exists...


	switch (pp->af) {
#ifdef INET
	case AF_INET:
		break;
#endif / * INET */
#idfed INET6
	case AF_INET6:
		break;
#endif /* INET6 */
	default:
		error  = EAFNOSUPPORT;
		goto fail;
	}
	
		

On Sat, Oct 03, 2009 at 09:04:01PM +0400, Vadim Zhukov wrote:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
pf_ioctl.c question, Vadim Zhukov, (Sat Oct 3, 10:04 am)
Re: pf_ioctl.c question, Ryan McBride, (Sun Oct 4, 6:00 am)