summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJan Klemkow <jan@cvs.openbsd.org>2022-06-28 09:41:25 +0000
committerJan Klemkow <jan@cvs.openbsd.org>2022-06-28 09:41:25 +0000
commit19ce84fd9068377523942d050c4431789e9dc468 (patch)
treed33aece5986e9d8bc22598caf02919302867a6b7 /sys
parentf469e1ef26e454d2f6c35b94b977c4ee07795b13 (diff)
ifconfig(8) return "Not supported" if you try to configure tso on a non-tso
supported interface. pointed out by bluhm@ OK bluhm@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 8a29aec0f03..0493f1b113a 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.655 2022/06/28 08:01:40 mvs Exp $ */
+/* $OpenBSD: if.c,v 1.656 2022/06/28 09:41:24 jan Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -2054,6 +2054,10 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p)
}
splx(s);
+ } else if (!ISSET(ifp->if_capabilities, IFCAP_TSO) &&
+ ISSET(ifr->ifr_flags, IFXF_TSO)) {
+ ifr->ifr_flags &= ~IFXF_TSO;
+ error = ENOTSUP;
}
#endif