ses = LIST_NEXT(ses, s_next);
static u_int8_t *key_make __P((u_int8_t *, int, u_int8_t *, int));static int key_cmp __P((u_int8_t *, int, u_int8_t *, int, u_int8_t *, int));voidserver_mode(bpffd, sysname, srvname, ea)	int bpffd;	char *sysname, *srvname;	struct ether_addr *ea;{	struct pppoe_session *ses;	fd_set rfds;	int n;	key_gen();	while (1) {reselect:		FD_ZERO(&rfds);		FD_SET(bpffd, &rfds);		n = bpffd;		ses = LIST_FIRST(&session_master.sm_sessions);		while (ses) {			if (ses->s_fd != -1) {				FD_SET(ses->s_fd, &rfds);				if (ses->s_fd > n)					n = ses->s_fd;			}			ses = LIST_NEXT(ses, s_next);		}		n = select(n+1, &rfds, NULL, NULL, NULL);		if (n < 0) {			if (errno == EINTR)				goto reselect;			err(EX_IOERR, "select");			return;		}		if (n == 0)			continue;		if (FD_ISSET(bpffd, &rfds)) {			n--;			getpackets(bpffd, sysname, ea);		}		if (n == 0)			continue;		ses = LIST_FIRST(&session_master.sm_sessions);		while (ses) {			if (ses->s_fd != -1 && FD_ISSET(ses->s_fd, &rfds)) {				if (ppp_to_bpf(bpffd, ses->s_fd, ea,					&ses->s_ea, ses->s_id) < 0) {					send_padt(bpffd, ea,					    &ses->s_ea, ses->s_id);					session_destroy(ses);				}				n--;				if (n == 0)					break;			}			ses = LIST_NEXT(ses, s_next);		}	}}voidkey_gen(){	u_int32_t r;	r = arc4random();	memcpy(ac_cookie_key, &r, sizeof(r));	r = arc4random();	memcpy(ac_cookie_key + sizeof(r), &r, sizeof(r));}u_int8_t *key_make(in1, in1len, in2, in2len)	u_int8_t *in1, *in2;	int in1len, in2len;{	u_int8_t *p;	MD5_CTX ctx;	p = (u_int8_t *)malloc(COOKIE_MAX);	if (p == NULL)		return (p);	MD5Init(&ctx);	MD5Update(&ctx, in1, in1len);	MD5Update(&ctx, in2, in2len);	MD5Final(p, &ctx);	return (p);}