diff options
-rw-r--r-- | sys/net/if_pppx.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/net/if_pppx.c b/sys/net/if_pppx.c index 0dd0c16ea10..73c3ca1c87a 100644 --- a/sys/net/if_pppx.c +++ b/sys/net/if_pppx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pppx.c,v 1.2 2010/09/29 08:22:27 claudio Exp $ */ +/* $OpenBSD: if_pppx.c,v 1.3 2010/11/24 00:56:08 sthen Exp $ */ /* * Copyright (c) 2010 Claudio Jeker <claudio@openbsd.org> @@ -631,15 +631,17 @@ pppx_if_next_unit(void) struct pppx_if * pppx_if_find(struct pppx_dev *pxd, int session_id, int protocol) { - struct pppx_if s, *p; + struct pppx_if *s, *p; + s = malloc(sizeof(*s), M_DEVBUF, M_WAITOK | M_ZERO); - s.pxi_key.pxik_session_id = session_id; - s.pxi_key.pxik_protocol = protocol; + s->pxi_key.pxik_session_id = session_id; + s->pxi_key.pxik_protocol = protocol; rw_enter_read(&pppx_ifs_lk); - p = RB_FIND(pppx_ifs, &pppx_ifs, &s); + p = RB_FIND(pppx_ifs, &pppx_ifs, s); rw_exit_read(&pppx_ifs_lk); + free(s, M_DEVBUF); return (p); } |