From 02581be962b52038dcf5c7d826efd9ec7cfd10db Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 25 Aug 2017 08:56:49 +0200 Subject: [PATCH] netgraph/pppoe: fix panic in session lookup Submitted by: Alex Dupre PR: https://forum.opnsense.org/index.php?topic=5697.0 See also: https://reviews.freebsd.org/D9270 (cherry picked from commit 1511b8ac7bc2d27242ee12924c076d1e6bcaf5d6) --- sys/netgraph/ng_pppoe.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netgraph/ng_pppoe.c b/sys/netgraph/ng_pppoe.c index 5a60aa35fd5..b1520821728 100644 --- a/sys/netgraph/ng_pppoe.c +++ b/sys/netgraph/ng_pppoe.c @@ -613,6 +613,9 @@ pppoe_finduniq(node_p node, const struct pppoe_tag *tag) if (NG_HOOK_PRIVATE(hook) == NULL) continue; sp = NG_HOOK_PRIVATE(hook); + /* Skip already connected sessions. */ + if (sp->neg == NULL) + continue; if (sp->neg->host_uniq_len == ntohs(tag->tag_len) && bcmp(sp->neg->host_uniq.data, (const char *)(tag + 1), sp->neg->host_uniq_len) == 0)