Subject: bin/4412: ipf -y gives "SIOCFRSYN: Bad address" error
To: None <gnats-bugs@gnats.netbsd.org>
From: Dave Huang <khym@bga.com>
List: netbsd-bugs
Date: 11/02/1997 04:41:04
>Number:         4412
>Category:       bin
>Synopsis:       ipf -y gives "SIOCFRSYN: Bad address" error
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov  2 02:50:02 1997
>Last-Modified:
>Originator:     Dave Huang
>Organization:
Name: Dave Huang     |   Mammal, mammal / their names are called /
INet: khym@bga.com   |   they raise a paw / the bat, the cat /
FurryMUCK: Dahan     |   dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 22 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++
>Release:        NetBSD 1.3_ALPHA as of November 1, 1997 (IPFilter 3.2)
>Environment:
	
System: NetBSD dahan.metonymy.com 1.3_ALPHA NetBSD 1.3_ALPHA (SPIFF) #149: Sat Nov 1 01:18:13 CST 1997 root@dahan.metonymy.com:/usr/src.local/sys/arch/i386/compile/SPIFF i386


>Description:
	ipf -y gives "SIOCFRSYN: Bad address", and probably doesn't resync
the interface list like it's supposed to.

The frsync() function in src/usr.sbin/ipf/ipf.c does ioctl(fd, SIOCFRSYN, 0)
However, src/sys/netinet/ip_fil.h defines SIOCFRSYN as taking a u_int
argument. The kernel sees that 0 is not a valid pointer and returns
EFAULT.

>How-To-Repeat:
# /sbin/ipf -y
SIOCFRSYN: Bad address

>Fix:
I suppose SIOCFRSYN should be defined as not taking any argument:

--- /usr/src/sys/netinet/ip_fil.h	Thu Oct 30 07:08:21 1997
+++ ip_fil.h	Sun Nov  2 04:32:41 1997
@@ -52,7 +52,7 @@
 #define	SIOCINAFR	_IOW('r', 70, struct frentry)
 #define	SIOCINIFR	_IOW('r', 71, struct frentry)
 #define	SIOCFRENB	_IOW('r', 72, u_int)
-#define	SIOCFRSYN	_IOW('r', 73, u_int)
+#define	SIOCFRSYN	_IO('r', 73)
 #define	SIOCFRZST	_IOWR('r', 74, struct friostat)
 #define	SIOCZRLST	_IOWR('r', 75, struct frentry)
 #define	SIOCAUTHW	_IOWR('r', 76, struct fr_info)
@@ -72,7 +72,7 @@
 #define	SIOCINAFR	_IOW(r, 70, struct frentry)
 #define	SIOCINIFR	_IOW(r, 71, struct frentry)
 #define SIOCFRENB	_IOW(r, 72, u_int)
-#define	SIOCFRSYN	_IOW(r, 73, u_int)
+#define	SIOCFRSYN	_IO(r, 73)
 #define	SIOCFRZST	_IOWR(r, 74, struct friostat)
 #define	SIOCZRLST	_IOWR(r, 75, struct frentry)
 #define	SIOCAUTHW	_IOWR(r, 76, struct fr_info)
>Audit-Trail:
>Unformatted: