View | Details | Raw Unified | Return to bug 27983
Collapse All | Expand All

(-)sbin/ifconfig/ifconfig.8 (-3 / +22 lines)
Lines 50-55 Link Here
50
.Oc
50
.Oc
51
.Op Ar parameters
51
.Op Ar parameters
52
.Nm
52
.Nm
53
.Fl D
54
.Ar interface
55
.Nm
53
.Fl a
56
.Fl a
54
.Op Fl L
57
.Op Fl L
55
.Op Fl d
58
.Op Fl d
Lines 142-147 Link Here
142
.Dq name unit ,
145
.Dq name unit ,
143
for example,
146
for example,
144
.Dq en0 .
147
.Dq en0 .
148
Generally this device must exist, but some pseudo interfaces support
149
creation of demand.
150
For those devices, an arbitrary unit number may be specified and the
151
interface will be created so long as another parameter is specified.
152
Additionally, a wildcard name of the form
153
.Dq driver# ,
154
for example,
155
.Dq gif# ,
156
may be specified which will cause a new interface to be created.
157
In this case the new interface name will be printed to stdout.
145
.El
158
.El
146
.Pp
159
.Pp
147
The following parameters may be set with 
160
The following parameters may be set with 
Lines 537-548 Link Here
537
.Nm
550
.Nm
538
will report only the details specific to that protocol family.
551
will report only the details specific to that protocol family.
539
.Pp
552
.Pp
540
If the driver does supports the media selection system, the supported
553
If the
541
media list will be included in the output.
554
.Fl D
555
flag is passed before an interface name
556
.Nm
557
will attempt to delete
558
the interface via its control device.
542
.Pp
559
.Pp
543
If the
560
If the
544
.Fl m
561
.Fl m
545
flag is passed before an interface name, ifconfig will display all
562
flag is passed before an interface name,
563
.Nm
564
will display all
546
of the supported media for the specified interface.
565
of the supported media for the specified interface.
547
If
566
If
548
.Fl L
567
.Fl L
(-)sbin/ifconfig/ifconfig.c (-11 / +202 lines)
Lines 104-109 Link Here
104
#define	NI_WITHSCOPEID	0
104
#define	NI_WITHSCOPEID	0
105
#endif
105
#endif
106
106
107
#ifndef WILDCARDUNIT
108
#define WILDCARDUNIT	'#'
109
#endif
110
107
struct	ifreq		ifr, ridreq;
111
struct	ifreq		ifr, ridreq;
108
struct	ifaliasreq	addreq;
112
struct	ifaliasreq	addreq;
109
#ifdef INET6
113
#ifdef INET6
Lines 128-133 Link Here
128
int	doalias;
132
int	doalias;
129
int	clearaddr;
133
int	clearaddr;
130
int	newaddr = 1;
134
int	newaddr = 1;
135
int	deleteif;
131
#ifdef INET6
136
#ifdef INET6
132
static	int ip6lifetime;
137
static	int ip6lifetime;
133
#endif
138
#endif
Lines 150-156 Link Here
150
		    struct sockaddr_dl *sdl, struct if_msghdr *ifm,
155
		    struct sockaddr_dl *sdl, struct if_msghdr *ifm,
151
		    struct ifa_msghdr *ifam));
156
		    struct ifa_msghdr *ifam));
152
void	usage __P((void));
157
void	usage __P((void));
153
void	ifmaybeload __P((char *name));
158
void	name2typeunit __P((const char *name, char *type, size_t tlen,
159
			    int *unit));
160
void	typeunit2name __P((char *name, size_t nlen, const char *type,
161
			    int unit));
162
void	ifmaybeload __P((const char *name));
163
int	ifmaybecreate __P((char *name, size_t len, int trystatic));
164
void	ifdelete __P((const char *name));
154
165
155
#ifdef INET6
166
#ifdef INET6
156
int	prefix __P((void *, int));
167
int	prefix __P((void *, int));
Lines 350-365 Link Here
350
usage()
361
usage()
351
{
362
{
352
#ifndef INET6
363
#ifndef INET6
353
	fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n",
364
	fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n",
354
	"usage: ifconfig interface address_family [address [dest_address]]",
365
	"usage: ifconfig interface address_family [address [dest_address]]",
355
	"                [parameters]",
366
	"                [parameters]",
367
	"       ifconfig -D interface",
356
	"       ifconfig -a [-d] [-m] [-u] [address_family]",
368
	"       ifconfig -a [-d] [-m] [-u] [address_family]",
357
	"       ifconfig -l [-d] [-u] [address_family]",
369
	"       ifconfig -l [-d] [-u] [address_family]",
358
	"       ifconfig [-d] [-m] [-u]");
370
	"       ifconfig [-d] [-m] [-u]");
359
#else
371
#else
360
	fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n",
372
	fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n",
361
	"usage: ifconfig [-L] interface address_family [address [dest_address]]",
373
	"usage: ifconfig [-L] interface address_family [address [dest_address]]",
362
	"                [parameters]",
374
	"                [parameters]",
375
	"       ifconfig -D interface",
363
	"       ifconfig -a [-L] [-d] [-m] [-u] [address_family]",
376
	"       ifconfig -a [-L] [-d] [-m] [-u] [address_family]",
364
	"       ifconfig -l [-d] [-u] [address_family]",
377
	"       ifconfig -l [-d] [-u] [address_family]",
365
	"       ifconfig [-L] [-d] [-m] [-u]");
378
	"       ifconfig [-L] [-d] [-m] [-u]");
Lines 388-394 Link Here
388
401
389
	/* Parse leading line options */
402
	/* Parse leading line options */
390
	all = downonly = uponly = namesonly = 0;
403
	all = downonly = uponly = namesonly = 0;
391
	while ((c = getopt(argc, argv, "adlmu"
404
	while ((c = getopt(argc, argv, "adDlmu"
392
#ifdef INET6
405
#ifdef INET6
393
					"L"
406
					"L"
394
#endif
407
#endif
Lines 411-416 Link Here
411
		case 'u':	/* restrict scan to "up" interfaces */
424
		case 'u':	/* restrict scan to "up" interfaces */
412
			uponly++;
425
			uponly++;
413
			break;
426
			break;
427
		case 'D':	/* delete the specified interface */
428
			deleteif++;
429
			break;
414
		case 'm':	/* show media choices in status */
430
		case 'm':	/* show media choices in status */
415
			supmedia = 1;
431
			supmedia = 1;
416
			break;
432
			break;
Lines 430-439 Link Here
430
	if (uponly && downonly)
446
	if (uponly && downonly)
431
		usage();
447
		usage();
432
448
449
	/* -D make no sense with any other flags or other then one argument */
450
	if (deleteif && (argc != 1 || all || namesonly || uponly ||
451
	    downonly || supmedia))
452
		usage();
453
433
	/* no arguments is equivalent to '-a' */
454
	/* no arguments is equivalent to '-a' */
434
	if (!namesonly && argc < 1)
455
	if (!namesonly && argc < 1)
435
		all = 1;
456
		all = 1;
436
457
458
	/* -u and -d are meaningless with a specified interface */
459
	if (!namesonly && !all && (uponly || downonly))
460
		usage();
461
437
	/* -a and -l allow an address family arg to limit the output */
462
	/* -a and -l allow an address family arg to limit the output */
438
	if (all || namesonly) {
463
	if (all || namesonly) {
439
		if (argc > 1)
464
		if (argc > 1)
Lines 457-464 Link Here
457
		strncpy(name, *argv, sizeof(name));
482
		strncpy(name, *argv, sizeof(name));
458
		argc--, argv++;
483
		argc--, argv++;
459
484
485
		if (deleteif) {
486
			ifdelete(name);
487
			return 0;
488
		}
489
460
		/* check and maybe load support for this interface */
490
		/* check and maybe load support for this interface */
461
		ifmaybeload(name);
491
		ifmaybeload(name);
492
493
		/*
494
		 * If we're actually going to try and do something with
495
		 * this device or the user want's a wildcard device, try
496
		 * and create it for them.  If we create a wild card
497
		 * device and we don't have anything to do with it, just
498
		 * return now rather then printing it's status.  This
499
		 * insures that wildcard creation prints the device name
500
		 * and only the device name.
501
		 */
502
		if (ifmaybecreate(name, sizeof(name), (argc != 0)) == 2 &&
503
		    argc == 0)
504
			return 0;
462
	}
505
	}
463
506
464
	/* Check for address family */
507
	/* Check for address family */
Lines 1644-1662 Link Here
1644
#endif /*INET6*/
1687
#endif /*INET6*/
1645
1688
1646
void
1689
void
1647
ifmaybeload(name)
1690
name2typeunit(name, type, tlen, unit)
1691
	const char *name;
1692
	char *type;
1693
	size_t tlen;
1694
	int *unit;
1695
{
1696
	char *cp;
1697
1698
	/* copy the type */
1699
	for (cp = type; !isdigit(name[0]) && name[0] != WILDCARDUNIT &&
1700
	    name[0] != '\0' && tlen > 0; name++, cp++, tlen--)
1701
		cp[0] = name[0];
1702
	if (tlen == 0) {
1703
		goto error;
1704
	}
1705
1706
	/* figure out the unit */
1707
	if (name[0] == WILDCARDUNIT) {
1708
		*unit = -1;
1709
		name++;
1710
	} else if (isdigit(name[0])) {
1711
		*unit = atoi(name);
1712
		for (; isdigit(name[0]); name++);
1713
	} else {
1714
		goto error;
1715
	}
1716
1717
	if (name[0] != '\0')
1718
		goto error;
1719
1720
	return;
1721
1722
error:
1723
	type[0] = '\0';
1724
}
1725
1726
void
1727
typeunit2name(name, nlen, type, unit)
1648
	char *name;
1728
	char *name;
1729
	size_t nlen;
1730
	const char *type;
1731
	int unit;
1732
{
1733
	if(nlen <= 0)
1734
		return;
1735
1736
	if(snprintf(name, nlen, "%s%d", type, unit) > nlen-1) {
1737
		/* just null the name if it doesn't fit */
1738
		name[0] = '\0';
1739
	}
1740
}
1741
1742
void
1743
ifmaybeload(name)
1744
	const char *name;
1649
{
1745
{
1650
	struct module_stat mstat;
1746
	struct module_stat mstat;
1651
	int fileid, modid;
1747
	int fileid, modid, unit;
1652
	char ifkind[35], *cp, *dp;
1748
	char ifkind[35], type[35], *cp;
1653
1749
1654
1750
1655
	/* turn interface and unit into module name */
1751
	/* turn interface and unit into module name */
1656
	strcpy(ifkind, "if_");
1752
	name2typeunit(name, type, sizeof(type), &unit);
1657
	for (cp = name, dp = ifkind + 3; (*cp != 0) && !isdigit(*cp); cp++, dp++)
1753
	if (type[0] == '\0')
1658
		*dp = *cp;
1754
		return;
1659
	*dp = 0;
1755
	if (snprintf(ifkind, sizeof(ifkind), "if_%s", type) >= sizeof(ifkind))
1756
		return;
1660
1757
1661
	/* scan files in kernel */
1758
	/* scan files in kernel */
1662
	mstat.version = sizeof(struct module_stat);
1759
	mstat.version = sizeof(struct module_stat);
Lines 1680-1683 Link Here
1680
1777
1681
	/* not present, we should try to load it */
1778
	/* not present, we should try to load it */
1682
	kldload(ifkind);
1779
	kldload(ifkind);
1780
}
1781
1782
/*
1783
 * Try to create the interface through a control node.  If nothing is
1784
 * created, return 0.  If a static interface is created return 1.  If a
1785
 * wildcard interface is created, return 2.
1786
 */
1787
int
1788
ifmaybecreate(name, len, trystatic)
1789
	char *name;
1790
	size_t len;
1791
	int trystatic;
1792
{
1793
	char if_dev[40];
1794
	int d;
1795
	int wildcard = 0;
1796
	struct if_manage ifman;
1797
1798
	bzero(&ifman, sizeof(ifman));
1799
1800
	/* turn interface and unit into control device name */
1801
	name2typeunit(name, ifman.ifman_name, sizeof(ifman.ifman_name),
1802
	    &ifman.ifman_unit);
1803
	if (ifman.ifman_name[0] == '\0')
1804
		return (0);
1805
	if (ifman.ifman_unit >= 0 && !trystatic)
1806
		return (0);
1807
	if (snprintf(if_dev, sizeof(if_dev), "/dev/if_%s",
1808
	    ifman.ifman_name) >= sizeof(if_dev))
1809
		return (0);
1810
	if (ifman.ifman_unit < 0)
1811
		wildcard = 1;
1812
1813
	/* try to open the control device */
1814
	d = open(if_dev, O_RDWR);
1815
	if (d == -1)
1816
		return (0);
1817
1818
	/* try to create the device in question */
1819
	ifman.ifman_action = IFMAN_CREATE;
1820
	if (ioctl(d, IOCIFMANAGE, &ifman) == -1) {
1821
		close(d);
1822
		return (0);
1823
	}
1824
	close(d);
1825
1826
	/*
1827
	 * our name might have been changed (in the wildcard case) so
1828
	 * update it.
1829
	 * XXX: if the device is on crack and mangles non-wildcard
1830
	 * units, this could be weird.
1831
	 */
1832
	typeunit2name(name, len, ifman.ifman_name, ifman.ifman_unit);
1833
1834
	if (name[0] != '\0' && wildcard) {
1835
		printf("%s\n", name);
1836
		return (2);
1837
	}
1838
1839
	return (1);
1840
}
1841
1842
void
1843
ifdelete(name)
1844
	const char *name;
1845
{
1846
	char if_dev[40];
1847
	int d;
1848
	struct if_manage ifman;
1849
1850
	bzero(&ifman, sizeof(ifman));
1851
1852
	ifman.ifman_action = IFMAN_DELETE;
1853
	name2typeunit(name, ifman.ifman_name, sizeof(ifman.ifman_name),
1854
	    &ifman.ifman_unit);
1855
	if (ifman.ifman_name[0] == '\0')
1856
		errx(1, "invalid interface");
1857
	if (ifman.ifman_unit < 0)
1858
		errx(1, "can't delete wildcard interface");
1859
	if (snprintf(if_dev, sizeof(if_dev), "/dev/if_%s",
1860
	    ifman.ifman_name) >= sizeof(if_dev))
1861
		return;
1862
1863
	/* try to open the control device */
1864
	d = open(if_dev, O_RDWR);
1865
	if (d == -1)
1866
		return;
1867
1868
	/* try to create the device in question */
1869
	if (ioctl(d, IOCIFMANAGE, &ifman) == -1) {
1870
		close(d);
1871
		err(1, "IOCIFMANAGE error");
1872
	}
1873
	close(d);
1683
}
1874
}
(-)sys/conf/files (-1 / +1 lines)
Lines 881-887 Link Here
881
net/if_ethersubr.c	optional ether
881
net/if_ethersubr.c	optional ether
882
net/if_faith.c		count faith
882
net/if_faith.c		count faith
883
net/if_fddisubr.c	optional fddi
883
net/if_fddisubr.c	optional fddi
884
net/if_gif.c		count gif
884
net/if_gif.c		optional gif
885
net/if_iso88025subr.c	optional token
885
net/if_iso88025subr.c	optional token
886
net/if_loop.c		optional loop
886
net/if_loop.c		optional loop
887
net/if_media.c		standard
887
net/if_media.c		standard
(-)sys/conf/majors (+1 lines)
Lines 179-184 Link Here
179
160	spic		Sony Programmable I/O Controller (jogdial)
179
160	spic		Sony Programmable I/O Controller (jogdial)
180
161	swdoc		Sitara networks watchdog device
180
161	swdoc		Sitara networks watchdog device
181
162	digi		Digiboard
181
162	digi		Digiboard
182
163	if_gif		Generic Tunneling control device
182
200	??		entries from 200-252 are reserved for local use
183
200	??		entries from 200-252 are reserved for local use
183
252	??		entries from 200-252 are reserved for local use
184
252	??		entries from 200-252 are reserved for local use
184
254	internal	Used internally by the kernel
185
254	internal	Used internally by the kernel
(-)sys/i386/conf/GENERIC (-1 / +1 lines)
Lines 210-216 Link Here
210
device		tun		# Packet tunnel.
210
device		tun		# Packet tunnel.
211
device		pty		# Pseudo-ttys (telnet etc)
211
device		pty		# Pseudo-ttys (telnet etc)
212
device		md		# Memory "disks"
212
device		md		# Memory "disks"
213
device		gif	4	# IPv6 and IPv4 tunneling
213
device		gif		# IPv6 and IPv4 tunneling
214
device		faith	1	# IPv6-to-IPv4 relaying (translation)
214
device		faith	1	# IPv6-to-IPv4 relaying (translation)
215
215
216
# The `bpf' device enables the Berkeley Packet Filter.
216
# The `bpf' device enables the Berkeley Packet Filter.
(-)sys/ia64/conf/GENERIC (-1 / +1 lines)
Lines 140-146 Link Here
140
device		tun		# Packet tunnel.
140
device		tun		# Packet tunnel.
141
device		pty		# Pseudo-ttys (telnet etc)
141
device		pty		# Pseudo-ttys (telnet etc)
142
device		md		# Memory "disks"
142
device		md		# Memory "disks"
143
device		gif	4	# IPv6 and IPv4 tunneling
143
device		gif		# IPv6 and IPv4 tunneling
144
device		faith	1	# IPv6-to-IPv4 relaying/(translation)
144
device		faith	1	# IPv6-to-IPv4 relaying/(translation)
145
145
146
# The `bpf' device enables the Berkeley Packet Filter.
146
# The `bpf' device enables the Berkeley Packet Filter.
(-)sys/alpha/conf/GENERIC (-1 / +1 lines)
Lines 165-171 Link Here
165
device		tun		# Packet tunnel.
165
device		tun		# Packet tunnel.
166
device		pty		# Pseudo-ttys (telnet etc)
166
device		pty		# Pseudo-ttys (telnet etc)
167
device		md		# Memory "disks"
167
device		md		# Memory "disks"
168
device		gif	4	# IPv6 and IPv4 tunneling
168
device		gif		# IPv6 and IPv4 tunneling
169
device		faith	1	# IPv6-to-IPv4 relaying/(translation)
169
device		faith	1	# IPv6-to-IPv4 relaying/(translation)
170
170
171
# The `bpf' device enables the Berkeley Packet Filter.
171
# The `bpf' device enables the Berkeley Packet Filter.
(-)sys/net/if_gif.c (-58 / +295 lines)
Lines 1-4 Link Here
1
/*	$FreeBSD: src/sys/net/if_gif.c,v 1.9 2001/06/03 17:31:11 yar Exp $	*/
1
/*	$FreeBSD: src/sys/net/if_gif.c,v 1.9 2001/06/03 17:31:11 yar Exp $ */
2
/*	$KAME: if_gif.c,v 1.28 2000/06/20 12:30:03 jinmei Exp $	*/
2
/*	$KAME: if_gif.c,v 1.28 2000/06/20 12:30:03 jinmei Exp $	*/
3
3
4
/*
4
/*
Lines 44-49 Link Here
44
#include <sys/time.h>
44
#include <sys/time.h>
45
#include <sys/syslog.h>
45
#include <sys/syslog.h>
46
#include <sys/protosw.h>
46
#include <sys/protosw.h>
47
#include <sys/conf.h>
48
#include <machine/bus.h>	/* XXX: Shouldn't really be required! */
49
#include <sys/rman.h>
47
#include <machine/cpu.h>
50
#include <machine/cpu.h>
48
51
49
#include <net/if.h>
52
#include <net/if.h>
Lines 58-63 Link Here
58
#include <netinet/in_var.h>
61
#include <netinet/in_var.h>
59
#include <netinet/ip.h>
62
#include <netinet/ip.h>
60
#include <netinet/in_gif.h>
63
#include <netinet/in_gif.h>
64
#include <netinet/ip_var.h>
65
#include <netinet/ipprotosw.h>
61
#endif	/* INET */
66
#endif	/* INET */
62
67
63
#ifdef INET6
68
#ifdef INET6
Lines 74-101 Link Here
74
#include <netinet/ip_encap.h>
79
#include <netinet/ip_encap.h>
75
#include <net/if_gif.h>
80
#include <net/if_gif.h>
76
81
77
#include "gif.h"
82
#if defined(__FreeBSD__)
83
#define NBPFILTER	1
84
#else
78
#include "bpf.h"
85
#include "bpf.h"
79
#define NBPFILTER	NBPF
86
#define NBPFILTER	NBPF
87
#endif
80
88
81
#include <net/net_osdep.h>
89
#include <net/net_osdep.h>
82
83
#if NGIF > 0
84
90
85
void gifattach __P((void *));
91
#define GIFNAME		"gif"
92
#define GIFDEV		"if_gif"
93
#define GIF_MAXUNIT	0x7fff	/* ifp->if_unit is only 15 bits */
94
95
static MALLOC_DEFINE(M_GIF, "gif", "Generic Tunnel Interface");
96
static struct rman gifunits[1];
97
TAILQ_HEAD(gifhead, gif_softc) gifs = TAILQ_HEAD_INITIALIZER(gifs);
98
99
static int gifcreate __P((int *));
100
static int gifdelete __P((int));
101
static int gifmodevent __P((module_t, int, void *));
102
static struct gif_softc *gifunit2sc __P((int unit));
86
static int gif_encapcheck __P((const struct mbuf *, int, int, void *));
103
static int gif_encapcheck __P((const struct mbuf *, int, int, void *));
87
#ifdef INET
88
extern struct protosw in_gif_protosw;
89
#endif
90
#ifdef INET6
91
extern struct ip6protosw in6_gif_protosw;
92
#endif
93
104
94
/*
105
#ifdef INET
95
 * gif global variable definitions
106
extern  struct domain inetdomain;
96
 */
107
struct ipprotosw in_gif_protosw =
97
static int ngif;		/* number of interfaces */
108
{ SOCK_RAW,	&inetdomain,	0/*IPPROTO_IPV[46]*/,	PR_ATOMIC|PR_ADDR,
98
static struct gif_softc *gif = 0;
109
  in_gif_input,	rip_output,	0,		rip_ctloutput,
110
  0,
111
  0,		0,		0,		0,
112
  &rip_usrreqs
113
};
114
#endif
115
#ifdef INET6
116
extern  struct domain6 inet6domain;
117
struct ip6protosw in6_gif_protosw =
118
{ SOCK_RAW,	&inet6domain,	0/*IPPROTO_IPV[46]*/,	PR_ATOMIC|PR_ADDR,
119
  in6_gif_input, rip6_output,	0,		rip6_ctloutput,
120
  0,
121
  0,		0,		0,		0,
122
  &rip6_usrreqs
123
};
124
#endif
125
126
static d_ioctl_t	gifioctl;
127
128
#define CDEV_MAJOR 163
129
static struct cdevsw gif_cdevsw = {
130
	/* open */	nullopen,
131
	/* close */	nullclose,
132
	/* read */	noread,
133
	/* write */	nowrite,
134
	/* ioctl */	gifioctl,
135
	/* poll */	nopoll,
136
	/* mmap */	nommap,
137
	/* strategy */	nostrategy,
138
	/* name */	GIFDEV,
139
	/* maj */	CDEV_MAJOR,
140
	/* dump */	nodump,
141
	/* psize */	nopsize,
142
	/* flags */	0,
143
};
99
144
100
#ifndef MAX_GIF_NEST
145
#ifndef MAX_GIF_NEST
101
/*
146
/*
Lines 110-171 Link Here
110
#endif
155
#endif
111
static int max_gif_nesting = MAX_GIF_NEST;
156
static int max_gif_nesting = MAX_GIF_NEST;
112
157
113
void
158
static struct gif_softc *
114
gifattach(dummy)
159
gifunit2sc(unit)
115
	void *dummy;
160
	int unit;
116
{
161
{
117
	register struct gif_softc *sc;
162
	struct gif_softc *sc;
118
	register int i;
163
164
	TAILQ_FOREACH(sc, &gifs, gif_link) {
165
		if (sc->gif_if.if_unit == unit)
166
			break;
167
	}
168
	if (sc->gif_if.if_unit != unit)
169
		return NULL;
170
171
	return sc;
172
}
173
174
static int
175
gifcreate(unit)
176
	int *unit;
177
{
178
	struct resource *r;
179
	struct gif_softc *sc;
180
181
	if (*unit > GIF_MAXUNIT)
182
		return (ENXIO);
119
183
120
	ngif = NGIF;
184
	if (*unit < 0) {
121
	gif = sc = malloc (ngif * sizeof(struct gif_softc), M_DEVBUF, M_WAITOK);
185
		r = rman_reserve_resource(gifunits, 0, GIF_MAXUNIT, 1,
122
	bzero(sc, ngif * sizeof(struct gif_softc));
186
		    RF_ALLOCATED | RF_ACTIVE, NULL);
123
	for (i = 0; i < ngif; sc++, i++) {
187
		if (r == NULL)
124
		sc->gif_if.if_name = "gif";
188
			return (ENOSPC);
125
		sc->gif_if.if_unit = i;
189
		*unit = rman_get_start(r);
190
	} else {
191
		r = rman_reserve_resource(gifunits, *unit, *unit, 1,
192
		    RF_ALLOCATED | RF_ACTIVE, NULL);
193
		if (r == NULL)
194
			return (EBUSY);
195
	}
196
197
	sc = malloc (sizeof(struct gif_softc), M_GIF, M_WAITOK);
198
	bzero(sc, sizeof(struct gif_softc));
199
	sc->gif_if.if_softc = sc;
200
	sc->gif_if.if_name = GIFNAME;
201
	sc->gif_if.if_unit = *unit;
202
	sc->r_unit = r;
126
203
127
		sc->encap_cookie4 = sc->encap_cookie6 = NULL;
204
	sc->encap_cookie4 = sc->encap_cookie6 = NULL;
128
#ifdef INET
205
#ifdef INET
129
		sc->encap_cookie4 = encap_attach_func(AF_INET, -1,
206
	sc->encap_cookie4 = encap_attach_func(AF_INET, -1,
130
		    gif_encapcheck, &in_gif_protosw, sc);
207
	    gif_encapcheck, &in_gif_protosw, sc);
131
		if (sc->encap_cookie4 == NULL) {
208
	if (sc->encap_cookie4 == NULL) {
132
			printf("%s: attach failed\n", if_name(&sc->gif_if));
209
		free(sc, M_GIF);
133
			continue;
210
		return (ENOMEM);
134
		}
211
	}
135
#endif
212
#endif
136
#ifdef INET6
213
#ifdef INET6
137
		sc->encap_cookie6 = encap_attach_func(AF_INET6, -1,
214
	sc->encap_cookie6 = encap_attach_func(AF_INET6, -1,
138
		    gif_encapcheck, (struct protosw *)&in6_gif_protosw, sc);
215
	    gif_encapcheck, (struct protosw *)&in6_gif_protosw, sc);
139
		if (sc->encap_cookie6 == NULL) {
216
	if (sc->encap_cookie6 == NULL) {
140
			if (sc->encap_cookie4) {
217
		if (sc->encap_cookie4) {
141
				encap_detach(sc->encap_cookie4);
218
			encap_detach(sc->encap_cookie4);
142
				sc->encap_cookie4 = NULL;
219
			sc->encap_cookie4 = NULL;
143
			}
144
			printf("%s: attach failed\n", if_name(&sc->gif_if));
145
			continue;
146
		}
220
		}
221
		free(sc, M_GIF);
222
		return (ENOMEM);
223
	}
147
#endif
224
#endif
148
225
149
		sc->gif_if.if_mtu    = GIF_MTU;
226
	sc->gif_if.if_mtu    = GIF_MTU;
150
		sc->gif_if.if_flags  = IFF_POINTOPOINT | IFF_MULTICAST;
227
	sc->gif_if.if_flags  = IFF_POINTOPOINT | IFF_MULTICAST;
151
		sc->gif_if.if_ioctl  = gif_ioctl;
228
	sc->gif_if.if_ioctl  = gif_ifioctl;
152
		sc->gif_if.if_output = gif_output;
229
	sc->gif_if.if_output = gif_output;
153
		sc->gif_if.if_type   = IFT_GIF;
230
	sc->gif_if.if_type   = IFT_GIF;
154
		sc->gif_if.if_snd.ifq_maxlen = IFQ_MAXLEN;
231
	sc->gif_if.if_snd.ifq_maxlen = IFQ_MAXLEN;
155
		if_attach(&sc->gif_if);
232
	if_attach(&sc->gif_if);
156
#if NBPFILTER > 0
233
#if NBPFILTER > 0
157
#ifdef HAVE_OLD_BPF
234
#ifdef HAVE_OLD_BPF
158
		bpfattach(&sc->gif_if, DLT_NULL, sizeof(u_int));
235
	bpfattach(&sc->gif_if, DLT_NULL, sizeof(u_int));
159
#else
236
#else
160
		bpfattach(&sc->gif_if.if_bpf, &sc->gif_if, DLT_NULL, sizeof(u_int));
237
	bpfattach(&sc->gif_if.if_bpf, &sc->gif_if, DLT_NULL, sizeof(u_int));
238
#endif
239
#endif
240
241
	TAILQ_INSERT_TAIL(&gifs, sc, gif_link);
242
243
	return (0);
244
}
245
246
static int
247
gifdelete(unit)
248
	int unit;
249
{
250
	int err;
251
	struct gif_softc *sc;
252
253
	sc = gifunit2sc(unit);
254
	if (sc == NULL)
255
		return (ENXIO);
256
257
	bpfdetach(&sc->gif_if);
258
	if_detach(&sc->gif_if);
259
260
	if (sc->encap_cookie4 != NULL) {
261
		err = encap_detach(sc->encap_cookie4);
262
		KASSERT(err == 0, ("Unexpected error detaching encap_cookie4"));
263
	}
264
	if (sc->encap_cookie6 != NULL) {
265
		err = encap_detach(sc->encap_cookie6);
266
		KASSERT(err == 0, ("Unexpected error detaching encap_cookie6"));
267
	}
268
269
	if (sc->gif_psrc)
270
		free((caddr_t)sc->gif_psrc, M_IFADDR);
271
	if (sc->gif_pdst)
272
		free((caddr_t)sc->gif_pdst, M_IFADDR);
273
274
	err = rman_release_resource(sc->r_unit);
275
	KASSERT(err == 0, ("Unexpected error freeing resource"));
276
277
	TAILQ_REMOVE(&gifs, sc, gif_link);
278
	free(sc, M_GIF);
279
280
	return 0;
281
}
282
283
static int
284
gifmodevent(mod, type, data)
285
	module_t mod;
286
	int type;
287
	void *data;
288
{
289
	static dev_t dev;
290
	int err;
291
292
	switch (type) {
293
	case MOD_LOAD:
294
		if (!devfs_present) {
295
			err = cdevsw_add(&gif_cdevsw);
296
			if (err != 0) {
297
				return (err);
298
			}
299
		}
300
		gifunits->rm_type = RMAN_ARRAY;
301
		gifunits->rm_descr = "configurable if_gif units";
302
		err = rman_init(gifunits);
303
		if (err != 0) {
304
			if (!devfs_present)
305
				cdevsw_remove(&gif_cdevsw);
306
			return (err);
307
		}
308
		err = rman_manage_region(gifunits, 0, GIF_MAXUNIT);
309
		if (err != 0) {
310
			printf("%s: gifunits: rman_manage_region: Failed %d\n",
311
			    GIFNAME, err);
312
			rman_fini(gifunits);
313
			if (!devfs_present)
314
				cdevsw_remove(&gif_cdevsw);
315
			return (err);
316
		}
317
		dev = make_dev(&gif_cdevsw, unit2minor(0),
318
		    UID_ROOT, GID_WHEEL, 0600, GIFDEV, 0);
319
320
#ifdef INET6
321
		ip6_gif_hlim = GIF_HLIM;
161
#endif
322
#endif
323
324
		break;
325
	case MOD_UNLOAD:
326
		destroy_dev(dev);
327
328
		while (!TAILQ_EMPTY(&gifs))
329
			gifdelete(TAILQ_FIRST(&gifs)->gif_if.if_unit);
330
331
		err = rman_fini(gifunits);
332
		if (err != 0)
333
			return (err);
334
335
		if (!devfs_present)
336
			cdevsw_remove(&gif_cdevsw);
337
338
#ifdef INET6
339
		ip6_gif_hlim = 0;
162
#endif
340
#endif
341
		break;
163
	}
342
	}
343
	return 0;
164
}
344
}
345
346
static moduledata_t gif_mod = {
347
	"if_gif",
348
	gifmodevent,
349
	0
350
};
165
351
166
PSEUDO_SET(gifattach, if_gif);
352
DECLARE_MODULE(if_gif, gif_mod, SI_SUB_PSEUDO, SI_ORDER_ANY);
167
353
168
static int
354
static int
355
gifioctl(dev, cmd, data, flag, p)
356
	dev_t dev;
357
	u_long cmd;
358
	caddr_t data;
359
	int flag;
360
	struct proc *p;
361
{
362
	int err;
363
	struct if_manage *ifman;
364
	struct gif_softc *sc;
365
366
	/* all actions require root, so check now. */
367
	err = suser(p);
368
	if (err != 0)
369
		return (err);
370
371
	switch (cmd) {
372
	case IOCIFMANAGE:
373
		ifman = (void*)data;
374
		switch (ifman->ifman_action) {
375
		case IFMAN_CREATE:
376
			if (strcmp(GIFNAME, ifman->ifman_name) != 0)
377
				return (EINVAL);
378
			err = gifcreate(&ifman->ifman_unit);
379
			if (err != 0)
380
				return (err);
381
			break;
382
		case IFMAN_DELETE:
383
			sc = gifunit2sc(ifman->ifman_unit);
384
			if (sc == NULL)
385
				return (ENXIO);
386
			if (sc->gif_if.if_flags & IFF_UP)
387
				return (EBUSY);
388
			err = gifdelete(ifman->ifman_unit);
389
			if(err != 0)
390
				return (err);
391
			break;
392
		default:
393
			return (EINVAL);
394
		}
395
		break;
396
	default:
397
		return (ENOTTY);
398
	}
399
400
	return (0);
401
}
402
403
static int
169
gif_encapcheck(m, off, proto, arg)
404
gif_encapcheck(m, off, proto, arg)
170
	const struct mbuf *m;
405
	const struct mbuf *m;
171
	int off;
406
	int off;
Lines 390-396 Link Here
390
625
391
/* XXX how should we handle IPv6 scope on SIOC[GS]IFPHYADDR? */
626
/* XXX how should we handle IPv6 scope on SIOC[GS]IFPHYADDR? */
392
int
627
int
393
gif_ioctl(ifp, cmd, data)
628
gif_ifioctl(ifp, cmd, data)
394
	struct ifnet *ifp;
629
	struct ifnet *ifp;
395
	u_long cmd;
630
	u_long cmd;
396
	caddr_t data;
631
	caddr_t data;
Lines 400-407 Link Here
400
	int error = 0, size;
635
	int error = 0, size;
401
	struct sockaddr *dst, *src;
636
	struct sockaddr *dst, *src;
402
	struct sockaddr *sa;
637
	struct sockaddr *sa;
403
	int i;
404
	int s;
638
	int s;
639
	struct ifnet *ifp2;
405
	struct gif_softc *sc2;
640
	struct gif_softc *sc2;
406
		
641
		
407
	switch (cmd) {
642
	switch (cmd) {
Lines 451-459 Link Here
451
			break;
686
			break;
452
#endif
687
#endif
453
		}
688
		}
689
690
		TAILQ_FOREACH(ifp2, &ifnet, if_link) {
691
			if (strcmp(ifp2->if_name, GIFNAME) != 0)
692
				continue;
693
			sc2 = ifp2->if_softc;
454
694
455
		for (i = 0; i < ngif; i++) {
456
			sc2 = gif + i;
457
			if (sc2 == sc)
695
			if (sc2 == sc)
458
				continue;
696
				continue;
459
			if (!sc2->gif_pdst || !sc2->gif_psrc)
697
			if (!sc2->gif_pdst || !sc2->gif_psrc)
Lines 623-626 Link Here
623
 bad:
861
 bad:
624
	return error;
862
	return error;
625
}
863
}
626
#endif /*NGIF > 0*/
(-)sys/net/if_gif.h (-1 / +3 lines)
Lines 62-67 Link Here
62
	int		gif_flags;
62
	int		gif_flags;
63
	const struct encaptab *encap_cookie4;
63
	const struct encaptab *encap_cookie4;
64
	const struct encaptab *encap_cookie6;
64
	const struct encaptab *encap_cookie6;
65
	struct resource *r_unit;	/* resource allocated for this unit */
66
	TAILQ_ENTRY(gif_softc) gif_link; /* all gif's are linked */
65
};
67
};
66
68
67
#define gif_ro gifsc_gifscr.gifscr_ro
69
#define gif_ro gifsc_gifscr.gifscr_ro
Lines 77-82 Link Here
77
void gif_input __P((struct mbuf *, int, struct ifnet *));
79
void gif_input __P((struct mbuf *, int, struct ifnet *));
78
int gif_output __P((struct ifnet *, struct mbuf *,
80
int gif_output __P((struct ifnet *, struct mbuf *,
79
		    struct sockaddr *, struct rtentry *));
81
		    struct sockaddr *, struct rtentry *));
80
int gif_ioctl __P((struct ifnet *, u_long, caddr_t));
82
int gif_ifioctl __P((struct ifnet *, u_long, caddr_t));
81
83
82
#endif /* _NET_IF_GIF_H_ */
84
#endif /* _NET_IF_GIF_H_ */
(-)sys/net/if.h (+12 lines)
Lines 241-246 Link Here
241
	struct	sockaddr_storage dstaddr; /* out */
241
	struct	sockaddr_storage dstaddr; /* out */
242
};
242
};
243
243
244
/*
245
 * Structure and definiation for IOCIFMANAGE
246
 */
247
struct if_manage {
248
	int	ifman_action;
249
#define IFMAN_CREATE	0
250
#define IFMAN_DELETE	1
251
	char	ifman_name[IFNAMSIZ];
252
	int	ifman_unit;
253
};
254
#define IOCIFMANAGE	_IOWR('i', 190, struct if_manage)
255
244
#ifdef _KERNEL
256
#ifdef _KERNEL
245
#ifdef MALLOC_DECLARE
257
#ifdef MALLOC_DECLARE
246
MALLOC_DECLARE(M_IFADDR);
258
MALLOC_DECLARE(M_IFADDR);
(-)sys/net/if_stf.c (-12 / +2 lines)
Lines 102-108 Link Here
102
102
103
#include <netinet/ip6.h>
103
#include <netinet/ip6.h>
104
#include <netinet6/ip6_var.h>
104
#include <netinet6/ip6_var.h>
105
#include <netinet6/in6_gif.h>
106
#include <netinet6/in6_var.h>
105
#include <netinet6/in6_var.h>
107
#include <netinet/ip_ecn.h>
106
#include <netinet/ip_ecn.h>
108
107
Lines 115-130 Link Here
115
#include "bpf.h"
114
#include "bpf.h"
116
#define NBPFILTER	NBPF
115
#define NBPFILTER	NBPF
117
#include "stf.h"
116
#include "stf.h"
118
#include "gif.h"	/*XXX*/
119
117
120
#if NBPFILTER > 0
118
#if NBPFILTER > 0
121
#include <net/bpf.h>
119
#include <net/bpf.h>
122
#endif
120
#endif
123
121
124
#if NGIF > 0
125
#include <net/if_gif.h>
126
#endif
127
128
#if NSTF > 0
122
#if NSTF > 0
129
#if NSTF != 1
123
#if NSTF != 1
130
# error only single stf interface allowed
124
# error only single stf interface allowed
Lines 146-156 Link Here
146
static struct stf_softc *stf;
140
static struct stf_softc *stf;
147
static int nstf;
141
static int nstf;
148
142
149
#if NGIF > 0
143
static int ip_stf_ttl = 40;
150
extern int ip_gif_ttl;	/*XXX*/
151
#else
152
static int ip_gif_ttl = 40;	/*XXX*/
153
#endif
154
144
155
extern struct protosw in_stf_protosw;
145
extern struct protosw in_stf_protosw;
156
146
Lines 364-370 Link Here
364
	    &ip->ip_src, sizeof(ip->ip_src));
354
	    &ip->ip_src, sizeof(ip->ip_src));
365
	bcopy(GET_V4(&dst6->sin6_addr), &ip->ip_dst, sizeof(ip->ip_dst));
355
	bcopy(GET_V4(&dst6->sin6_addr), &ip->ip_dst, sizeof(ip->ip_dst));
366
	ip->ip_p = IPPROTO_IPV6;
356
	ip->ip_p = IPPROTO_IPV6;
367
	ip->ip_ttl = ip_gif_ttl;	/*XXX*/
357
	ip->ip_ttl = ip_stf_ttl;
368
	ip->ip_len = m->m_pkthdr.len;	/*host order*/
358
	ip->ip_len = m->m_pkthdr.len;	/*host order*/
369
	if (ifp->if_flags & IFF_LINK1)
359
	if (ifp->if_flags & IFF_LINK1)
370
		ip_ecn_ingress(ECN_ALLOWED, &ip->ip_tos, &tos);
360
		ip_ecn_ingress(ECN_ALLOWED, &ip->ip_tos, &tos);
(-)sys/netinet/in.c (-8 / +1 lines)
Lines 51-61 Link Here
51
51
52
#include <netinet/igmp_var.h>
52
#include <netinet/igmp_var.h>
53
53
54
#include "gif.h"
55
#if NGIF > 0
56
#include <net/if_gif.h>
57
#endif
58
59
static MALLOC_DEFINE(M_IPMADDR, "in_multi", "internet multicast address");
54
static MALLOC_DEFINE(M_IPMADDR, "in_multi", "internet multicast address");
60
55
61
static int in_mask2len __P((struct in_addr *));
56
static int in_mask2len __P((struct in_addr *));
Lines 200-206 Link Here
200
	int error, hostIsNew, maskIsNew, s;
195
	int error, hostIsNew, maskIsNew, s;
201
	u_long i;
196
	u_long i;
202
197
203
#if NGIF > 0
204
        if (ifp && ifp->if_type == IFT_GIF) {
198
        if (ifp && ifp->if_type == IFT_GIF) {
205
                switch (cmd) {
199
                switch (cmd) {
206
                case SIOCSIFPHYADDR:
200
                case SIOCSIFPHYADDR:
Lines 210-219 Link Here
210
        			return(error);
204
        			return(error);
211
                case SIOCGIFPSRCADDR:
205
                case SIOCGIFPSRCADDR:
212
                case SIOCGIFPDSTADDR:
206
                case SIOCGIFPDSTADDR:
213
                        return gif_ioctl(ifp, cmd, data);
207
                        return ifp->if_ioctl(ifp, cmd, data);
214
                }
208
                }
215
        }
209
        }
216
#endif
217
210
218
	switch (cmd) {
211
	switch (cmd) {
219
	case SIOCALIFADDR:
212
	case SIOCALIFADDR:
(-)sys/netinet/in_gif.c (-6 lines)
Lines 67-83 Link Here
67
67
68
#include <net/if_gif.h>	
68
#include <net/if_gif.h>	
69
69
70
#include "gif.h"
71
72
#include <machine/stdarg.h>
70
#include <machine/stdarg.h>
73
71
74
#include <net/net_osdep.h>
72
#include <net/net_osdep.h>
75
73
76
#if NGIF > 0
77
int ip_gif_ttl = GIF_TTL;
74
int ip_gif_ttl = GIF_TTL;
78
#else
79
int ip_gif_ttl = 0;
80
#endif
81
SYSCTL_INT(_net_inet_ip, IPCTL_GIF_TTL, gifttl, CTLFLAG_RW,
75
SYSCTL_INT(_net_inet_ip, IPCTL_GIF_TTL, gifttl, CTLFLAG_RW,
82
	&ip_gif_ttl,	0, "");
76
	&ip_gif_ttl,	0, "");
83
77
(-)sys/netinet/in_proto.c (-15 lines)
Lines 77-87 Link Here
77
#endif
77
#endif
78
#endif /* IPSEC */
78
#endif /* IPSEC */
79
79
80
#include "gif.h"
81
#if NGIF > 0
82
#include <netinet/in_gif.h>
83
#endif
84
85
#include "stf.h"
80
#include "stf.h"
86
#if NSTF > 0
81
#if NSTF > 0
87
#include <net/if_stf.h>
82
#include <net/if_stf.h>
Lines 205-220 Link Here
205
  &rip_usrreqs
200
  &rip_usrreqs
206
},
201
},
207
};
202
};
208
209
#if NGIF > 0
210
struct ipprotosw in_gif_protosw =
211
{ SOCK_RAW,	&inetdomain,	0/*IPPROTO_IPV[46]*/,	PR_ATOMIC|PR_ADDR,
212
  in_gif_input, rip_output,	0,		rip_ctloutput,
213
  0,
214
  0,            0,              0,              0,
215
  &rip_usrreqs
216
};
217
#endif /*NGIF*/
218
203
219
#if NSTF > 0
204
#if NSTF > 0
220
struct ipprotosw in_stf_protosw =
205
struct ipprotosw in_stf_protosw =
(-)sys/netinet6/in6.c (-8 / +2 lines)
Lines 97-107 Link Here
97
#include <netinet6/in6_ifattach.h>
97
#include <netinet6/in6_ifattach.h>
98
#include <netinet6/scope6_var.h>
98
#include <netinet6/scope6_var.h>
99
99
100
#include "gif.h"
101
#if NGIF > 0
102
#include <net/if_gif.h>
103
#endif
104
105
#include <net/net_osdep.h>
100
#include <net/net_osdep.h>
106
101
107
MALLOC_DEFINE(M_IPMADDR, "in6_multi", "internet multicast address");
102
MALLOC_DEFINE(M_IPMADDR, "in6_multi", "internet multicast address");
Lines 343-349 Link Here
343
	/*
338
	/*
344
	 * xxx should prevent processes for link-local addresses?
339
	 * xxx should prevent processes for link-local addresses?
345
	 */
340
	 */
346
#if NGIF > 0
347
	if (ifp && ifp->if_type == IFT_GIF) {
341
	if (ifp && ifp->if_type == IFT_GIF) {
348
		switch (cmd) {
342
		switch (cmd) {
349
		case SIOCSIFPHYADDR_IN6:
343
		case SIOCSIFPHYADDR_IN6:
Lines 352-361 Link Here
352
			/*fall through*/
346
			/*fall through*/
353
		case SIOCGIFPSRCADDR_IN6:
347
		case SIOCGIFPSRCADDR_IN6:
354
		case SIOCGIFPDSTADDR_IN6:
348
		case SIOCGIFPDSTADDR_IN6:
355
			return gif_ioctl(ifp, cmd, data);
349
			return ifp->if_ioctl(ifp, cmd, data);
356
		}
350
		}
357
	}
351
	}
358
#endif
352
359
	switch (cmd) {
353
	switch (cmd) {
360
	case SIOCGETSGCNT_IN6:
354
	case SIOCGETSGCNT_IN6:
361
	case SIOCGETMIFCNT_IN6:
355
	case SIOCGETMIFCNT_IN6:
(-)sys/netinet6/in6_proto.c (-19 lines)
Lines 122-132 Link Here
122
122
123
#include <netinet6/ip6protosw.h>
123
#include <netinet6/ip6protosw.h>
124
124
125
#include "gif.h"
126
#if NGIF > 0
127
#include <netinet6/in6_gif.h>
128
#endif
129
130
#include <net/net_osdep.h>
125
#include <net/net_osdep.h>
131
126
132
/*
127
/*
Lines 244-259 Link Here
244
},
239
},
245
};
240
};
246
241
247
#if NGIF > 0
248
struct ip6protosw in6_gif_protosw =
249
{ SOCK_RAW,	&inet6domain,	0/*IPPROTO_IPV[46]*/,	PR_ATOMIC|PR_ADDR,
250
  in6_gif_input, rip6_output,	0,		rip6_ctloutput,
251
  0,
252
  0,            0,              0,              0,
253
  &rip6_usrreqs
254
};
255
#endif /*NGIF*/
256
257
extern int in6_inithead __P((void **, int));
242
extern int in6_inithead __P((void **, int));
258
243
259
struct domain inet6domain =
244
struct domain inet6domain =
Lines 292-302 Link Here
292
int	ip6_dad_count = 1;	/* DupAddrDetectionTransmits */
277
int	ip6_dad_count = 1;	/* DupAddrDetectionTransmits */
293
u_int32_t ip6_flow_seq;
278
u_int32_t ip6_flow_seq;
294
int	ip6_auto_flowlabel = 1;
279
int	ip6_auto_flowlabel = 1;
295
#if NGIF > 0
296
int	ip6_gif_hlim = GIF_HLIM;
297
#else
298
int	ip6_gif_hlim = 0;
280
int	ip6_gif_hlim = 0;
299
#endif
300
int	ip6_use_deprecated = 1;	/* allow deprecated addr (RFC2462 5.5.4) */
281
int	ip6_use_deprecated = 1;	/* allow deprecated addr (RFC2462 5.5.4) */
301
int	ip6_rr_prune = 5;	/* router renumbering prefix
282
int	ip6_rr_prune = 5;	/* router renumbering prefix
302
				 * walk list every 5 sec.    */
283
				 * walk list every 5 sec.    */
(-)sys/netinet6/ip6_input.c (-1 lines)
Lines 113-119 Link Here
113
#include <netinet6/ip6protosw.h>
113
#include <netinet6/ip6protosw.h>
114
114
115
#include "faith.h"
115
#include "faith.h"
116
#include "gif.h"
117
116
118
#include <net/net_osdep.h>
117
#include <net/net_osdep.h>
119
118
(-)sys/modules/Makefile (+1 lines)
Lines 8-13 Link Here
8
8
9
SUBDIR=	3dfx accf_data accf_http agp aha amr an aue \
9
SUBDIR=	3dfx accf_data accf_http agp aha amr an aue \
10
	cam ccd cd9660 coda cue dc de dgm digi ed fdescfs fxp if_disc if_ef \
10
	cam ccd cd9660 coda cue dc de dgm digi ed fdescfs fxp if_disc if_ef \
11
	if_gif \
11
	if_ppp if_sl if_tap if_tun ip6fw ipfilter ipfw ispfw joy kue lge \
12
	if_ppp if_sl if_tap if_tun ip6fw ipfilter ipfw ispfw joy kue lge \
12
	libmchain linux lnc md mii mlx msdosfs ncp netgraph nfs nge ntfs \
13
	libmchain linux lnc md mii mlx msdosfs ncp netgraph nfs nge ntfs \
13
	nullfs nwfs pcn portalfs procfs ${_random}  \
14
	nullfs nwfs pcn portalfs procfs ${_random}  \
(-)sys/modules/if_gif/Makefile (+18 lines)
Line 0 Link Here
1
# $FreeBSD$
2
3
.PATH: ${.CURDIR}/../../net ${.CURDIR}/../../netinet ${.CURDIR}/../../netinet6
4
5
KMOD=	if_gif
6
SRCS=	if_gif.c in_gif.c in6_gif.c opt_inet.h opt_inet6.h opt_mrouting.h
7
NOMAN=
8
9
opt_inet.h:
10
	echo "#define INET 1" > ${.TARGET}
11
12
opt_inet6.h:
13
	echo "#define INET6 1" > ${.TARGET}
14
15
opt_mrouting.h:
16
	echo "#define MROUTING 1" > ${.TARGET}
17
18
.include <bsd.kmod.mk>

Return to bug 27983