diff options
author | Stuart Henderson <sthen@cvs.openbsd.org> | 2010-11-24 00:56:09 +0000 |
---|---|---|
committer | Stuart Henderson <sthen@cvs.openbsd.org> | 2010-11-24 00:56:09 +0000 |
commit | 097d94b07d3f0ce3d3250737aa39825ec63a1574 (patch) | |
tree | 74a098e488eb06783f2cec44edc1c2a4fc49b5d9 /sys/net/if_pppx.c | |
parent | 70f8b47c8815d4a68fce00865c4b4e44d53b1a66 (diff) |
malloc the temporary struct pppx_if used in pppx_if_find (it's currently
only called from pppx_del_session); lets an amd64 pppx kernel build
(otherwise we hit excessive stack use warnings with -Werror).
if this ends up being called more frequently in future, then dlg
suggests making it static instead. ok claudio@
Diffstat (limited to 'sys/net/if_pppx.c')
-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); } |