Skip to content

Commit 29a15cf

Browse files
committed
Remove sysctl for divert6 recv and send space.
UDP has a common sysctl for recv and send space, but divert had a special knob for inet6. Remove net.inet6.divert.recvspace and net.inet6.divert.sendspace sysctl and use the net.inet.divert values instead. OK dlg@ mvs@
1 parent eddb43a commit 29a15cf

File tree

3 files changed

+11
-20
lines changed

3 files changed

+11
-20
lines changed

sys/netinet/ip_divert.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: ip_divert.h,v 1.28 2025/06/06 13:13:37 bluhm Exp $ */
1+
/* $OpenBSD: ip_divert.h,v 1.29 2025/06/18 17:45:07 bluhm Exp $ */
22

33
/*
44
* Copyright (c) 2009 Michele Marchetto <[email protected]>
@@ -67,8 +67,9 @@ divstat_inc(enum divstat_counters c)
6767
counters_inc(divcounters, c);
6868
}
6969

70-
extern struct inpcbtable divbtable;
71-
70+
extern u_int divert_sendspace;
71+
extern u_int divert_recvspace;
72+
extern struct inpcbtable divbtable;
7273
extern const struct pr_usrreqs divert_usrreqs;
7374

7475
void divert_init(void);

sys/netinet6/ip6_divert.c

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: ip6_divert.c,v 1.104 2025/06/06 13:13:37 bluhm Exp $ */
1+
/* $OpenBSD: ip6_divert.c,v 1.105 2025/06/18 17:45:07 bluhm Exp $ */
22

33
/*
44
* Copyright (c) 2009 Michele Marchetto <[email protected]>
@@ -52,14 +52,6 @@
5252
struct inpcbtable divb6table;
5353
struct cpumem *div6counters;
5454

55-
u_int divert6_sendspace = DIVERT_SENDSPACE; /* [a] */
56-
u_int divert6_recvspace = DIVERT_RECVSPACE; /* [a] */
57-
58-
const struct sysctl_bounded_args divert6ctl_vars[] = {
59-
{ DIVERT6CTL_RECVSPACE, &divert6_recvspace, 0, SB_MAX },
60-
{ DIVERT6CTL_SENDSPACE, &divert6_sendspace, 0, SB_MAX },
61-
};
62-
6355
const struct pr_usrreqs divert6_usrreqs = {
6456
.pru_attach = divert6_attach,
6557
.pru_detach = divert_detach,
@@ -267,8 +259,8 @@ divert6_attach(struct socket *so, int proto, int wait)
267259
if ((so->so_state & SS_PRIV) == 0)
268260
return EACCES;
269261

270-
error = soreserve(so, atomic_load_int(&divert6_sendspace),
271-
atomic_load_int(&divert6_recvspace));
262+
error = soreserve(so, atomic_load_int(&divert_sendspace),
263+
atomic_load_int(&divert_recvspace));
272264
if (error)
273265
return (error);
274266
error = in_pcballoc(so, &divb6table, wait);
@@ -304,9 +296,7 @@ divert6_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp,
304296
return (divert_sysctl_divstat(div6counters, oldp, oldlenp,
305297
newp));
306298
default:
307-
return (sysctl_bounded_arr(divert6ctl_vars,
308-
nitems(divert6ctl_vars), name, namelen, oldp, oldlenp,
309-
newp, newlen));
299+
return (EOPNOTSUPP);
310300
}
311301
/* NOTREACHED */
312302
}

sys/netinet6/ip6_divert.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: ip6_divert.h,v 1.24 2025/06/04 12:37:00 bluhm Exp $ */
1+
/* $OpenBSD: ip6_divert.h,v 1.25 2025/06/18 17:45:07 bluhm Exp $ */
22

33
/*
44
* Copyright (c) 2009 Michele Marchetto <[email protected]>
@@ -29,8 +29,8 @@
2929

3030
#define DIVERT6CTL_NAMES { \
3131
{ 0, 0 }, \
32-
{ "recvspace", CTLTYPE_INT }, \
33-
{ "sendspace", CTLTYPE_INT }, \
32+
{ NULL, 0 }, \
33+
{ NULL, 0 }, \
3434
{ "stats", CTLTYPE_STRUCT } \
3535
}
3636

0 commit comments

Comments
 (0)