summaryrefslogtreecommitdiff
path: root/sys/net/pipex.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2020-04-07 07:11:23 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2020-04-07 07:11:23 +0000
commit7dcf8aded102d2930068d08e784dad6f2938be5c (patch)
treec73ff3b75e2df7a21815c446b95d48bd8df050cd /sys/net/pipex.c
parent06b0e38248a7ab3dedf2712dcfeb30ede605a222 (diff)
Deny to create a pipex session if the session id already exists.
From Vitaliy Makkoveev OK yasuoka@
Diffstat (limited to 'sys/net/pipex.c')
-rw-r--r--sys/net/pipex.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/net/pipex.c b/sys/net/pipex.c
index 281b4a73be9..c433e4beaa6 100644
--- a/sys/net/pipex.c
+++ b/sys/net/pipex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pipex.c,v 1.112 2020/04/06 13:14:04 claudio Exp $ */
+/* $OpenBSD: pipex.c,v 1.113 2020/04/07 07:11:22 claudio Exp $ */
/*-
* Copyright (c) 2009 Internet Initiative Japan Inc.
@@ -312,6 +312,11 @@ pipex_add_session(struct pipex_session_req *req,
return (EPROTONOSUPPORT);
}
+ session = pipex_lookup_by_session_id(req->pr_protocol,
+ req->pr_session_id);
+ if (session)
+ return (EEXIST);
+
/* prepare a new session */
session = pool_get(&pipex_session_pool, PR_WAITOK | PR_ZERO);
session->state = PIPEX_STATE_OPENED;