ifconfig(8) return "Not supported" if you try to configure tso on a non-tso
authorjan <jan@openbsd.org>
Tue, 28 Jun 2022 09:41:24 +0000 (09:41 +0000)
committerjan <jan@openbsd.org>
Tue, 28 Jun 2022 09:41:24 +0000 (09:41 +0000)
supported interface.

pointed out by bluhm@

OK bluhm@

sys/net/if.c

index 8a29aec..0493f1b 100644 (file)
@@ -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