-/* $OpenBSD: in_pcb.c,v 1.284 2024/01/09 19:57:00 bluhm Exp $ */
+/* $OpenBSD: in_pcb.c,v 1.285 2024/01/18 11:03:16 claudio Exp $ */
/* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */
/*
{
struct inpcbtable *table = inp->inp_table;
+ /* table must exist */
+ if (!rtable_exists(rtableid))
+ return (EINVAL);
+
mtx_enter(&table->inpt_mtx);
if (inp->inp_lport) {
mtx_leave(&table->inpt_mtx);
-/* $OpenBSD: ip_output.c,v 1.392 2023/12/01 15:30:47 bluhm Exp $ */
+/* $OpenBSD: ip_output.c,v 1.393 2024/01/18 11:03:16 claudio Exp $ */
/* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */
/*
if (rtableid != rtid && rtableid != 0 &&
(error = suser(p)) != 0)
break;
- /* table must exist */
- if (!rtable_exists(rtid)) {
- error = EINVAL;
- break;
- }
error = in_pcbset_rtableid(inp, rtid);
break;
case IP_PIPEX:
-/* $OpenBSD: ip6_output.c,v 1.282 2023/12/01 15:30:47 bluhm Exp $ */
+/* $OpenBSD: ip6_output.c,v 1.283 2024/01/18 11:03:16 claudio Exp $ */
/* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */
/*
if (rtableid != rtid && rtableid != 0 &&
(error = suser(p)) != 0)
break;
- /* table must exist */
- if (!rtable_exists(rtid)) {
- error = EINVAL;
- break;
- }
error = in_pcbset_rtableid(inp, rtid);
break;
case IPV6_PIPEX: