Skip to content

Commit 39200c1

Browse files
committed
Reset error for ifconfig tcplro.
To prevent returning an error from ioctl(2) after ifsetlro() has succeeded, reset the error variable. with and OK jan@
1 parent e97de13 commit 39200c1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sys/net/if.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: if.c,v 1.728 2025/03/02 21:28:31 bluhm Exp $ */
1+
/* $OpenBSD: if.c,v 1.729 2025/03/19 23:29:49 bluhm Exp $ */
22
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
33

44
/*
@@ -3359,9 +3359,8 @@ ifpromisc(struct ifnet *ifp, int pswitch)
33593359
int
33603360
ifsetlro(struct ifnet *ifp, int on)
33613361
{
3362-
int error = 0;
3363-
int s = splnet();
33643362
struct ifreq ifr;
3363+
int error, s = splnet();
33653364

33663365
NET_ASSERT_LOCKED(); /* for ioctl */
33673366
KERNEL_ASSERT_LOCKED(); /* for if_flags */
@@ -3373,6 +3372,7 @@ ifsetlro(struct ifnet *ifp, int on)
33733372
error = ((*ifp->if_ioctl)(ifp, SIOCSIFXFLAGS, (caddr_t)&ifr));
33743373
if (error == 0)
33753374
goto out;
3375+
error = 0;
33763376

33773377
if (!ISSET(ifp->if_capabilities, IFCAP_LRO)) {
33783378
error = ENOTSUP;

0 commit comments

Comments
 (0)