Commit Graph

1385 Commits

Author SHA1 Message Date
christos be3704c73f pass the flag to fdclone. 2005-02-12 23:14:03 +00:00
manu 5c217c1a67 Add support for IPsec Network Address Translator traversal (NAT-T), as
described by RFC 3947 and 3948.
2005-02-12 12:31:07 +00:00
he 2a8a7aabd7 Fix "unused local variable" warning/error if compiling without
bridge support by making variable declaration conditional.  Found
while compiling for shark.
2005-02-01 12:13:51 +00:00
kim c9f56c04dc Add RFC 3378 EtherIP support, ported from OpenBSD to NetBSD by
Hans Rosenfeld (rosenfeld at grumpf.hope-2000.org)

This change makes it possible to add gif interfaces to bridges, which
will then send and receive IP protocol 97 packets. Packets are Ethernet
frames with an EtherIP header prepended.
2005-01-31 23:49:36 +00:00
matt 53fdea69cb Switch to using ifa for ifaddr's instead of ia (which are traditionally
used for in_ifaddr's) which could lead to confusion.
2005-01-25 17:22:08 +00:00
tron ed9b5b2073 Fix cut and paste error in last commit. 2005-01-25 11:20:37 +00:00
ragge 9bb19bb2e0 Do not cast simple_lock() to (void). It may be a do { } while() macro,
and then compilation fails.  Found by Håvard Eidnes.
2005-01-25 09:57:15 +00:00
matt 027c11539b Add IFNET_FOREACH and IFADDR_FOREACH macros and start using them. 2005-01-24 21:25:09 +00:00
enami f1b6d58e81 To fix bad pointer dereference on start up when gif is used,
- Allow rn_init() to be called multiple times, but do nothing except the
  first call.
- Include opt_inet.h so that #ifdef INET works.
- Call rn_init() from encap_init() explicitly rather than depending on the
  order of initialization.
2005-01-24 04:46:49 +00:00
matt d341be30f4 Change initialzie of domains to use link sets. Switch to using STAILQ.
Add a convenience macro DOMAIN_FOREACH to interate through the domain.
2005-01-23 18:41:56 +00:00
cube d76d637295 s/PF_LINK/AF_LINK/ because that way it makes sense. 2005-01-22 07:33:56 +00:00
martin 5e83f0d7e8 Remove deleted interfaces from the instance list (inspired by an OpenBSD
change). While there, fix a comment.
2005-01-19 15:05:55 +00:00
cube 755855a1f9 Make this LKM-friendly by using _KERNEL_OPT and having a prototype for the
sysctl setup function.
2005-01-19 10:18:40 +00:00
itojun 5377005da8 ESP AESCTR got an official protocol number
http://www.iana.org/assignments/isakmp-registry
2005-01-14 04:11:55 +00:00
yamt d502f705e1 ifioctl: don't use super user priviledge unless it's needed. 2005-01-09 12:18:46 +00:00
cube da24800d8c Install net/if_tap.h. 2005-01-08 22:28:51 +00:00
cube 0615d0207e Addition of tap(4).
NAME
     tap - virtual Ethernet device

SYNOPSIS
     pseudo-device tap

DESCRIPTION
     The tap driver allows the creation and use of virtual Ethernet devices.
     Those interfaces appear just as any real Ethernet NIC to the kernel, but
     can also be accessed by userland through a character device node in order
     to read frames being sent by the system or to inject frames.

     In that respect it is very similar to what tun(4) provides, but the added
     Ethernet layer allows easy integration with machine emulators or virtual
     Ethernet networks through the use of bridge(4) with tunneling.

``Qui tacet consentire videtur.''
2005-01-08 22:27:54 +00:00
yamt 6292485301 constify broadcastaddr. 2005-01-08 03:18:18 +00:00
yamt d06c4aee84 remove an unused member, enm_ec from ether_multi. 2005-01-08 03:13:09 +00:00
yamt f276045e22 add ETHERTYPE_SLOWPROTOCOLS. (0x8809) 2005-01-07 12:37:55 +00:00
reinoud 486e5e2819 Fixup of bad patch made by me; the #ifdef ought to be also including ISO
rather than being removed. Also fixed a small comment about the scope of
#if's.

This code is a but ugly IMHO but as long as we dont have to change it ....
2004-12-30 15:38:50 +00:00
reinoud 533a9f0186 Remove conditional around label. Its allways used in the code and thus not
explicitly only for the protocols indicated by the #if

Allthough its unlikely a kernel will be build without NET_INET, it will
fail compilation here when NET_INET is not defined.
2004-12-29 17:57:19 +00:00
itojun b97cc48910 whitespace 2004-12-22 05:11:24 +00:00
dyoung a8699ab9a4 As pointed out by Greg Troxel, ifmedia_entrys were allocated with
malloc_type M_IFADDR and freed with malloc_type M_DEVBUF.  This
causes a panic(9) in DIAGNOSTIC kernels.  Add malloc_type M_IFMEDIA
and use it for both malloc'ing and free'ing ifmedia_entrys.
2004-12-08 20:37:43 +00:00
martin 0a72984c77 Factor out softc cleanup after loss of session into pppoe_clear_softc.
Use this when loosing the ethernet interface (when it deataches).
Fixes PR kern/28375.
2004-12-08 07:43:29 +00:00
itojun bc4b33d8be reqid (for unique policy) is u_int16_t quantity. from markus@openbsd 2004-12-06 08:05:26 +00:00
christos 64573a67d7 Sprinkle #ifdef INET to make a GENERIC kernel compile with INET undefined. 2004-12-06 02:59:23 +00:00
christos 6d413e70c4 pasto: simple_lock -> simple_unlock. 2004-12-05 15:03:13 +00:00
peter 42fc7edb33 Use ANSI function decls, change a few 0 to NULL. 2004-12-05 15:02:30 +00:00
peter cf47c76c1b Don't forget to call bpfdetach in the clone destroy function.
While here, add a missing static and change some spaces to tabs.
2004-12-05 15:00:47 +00:00
he 8194ddc3a5 Fix what must have been an omission: missing brace and a leftover
use of `i', which is no longer defined.  Fixes build problem for ports
not defining __HAVE_GENERIC_SOFT_INTERRUPTS.
2004-12-05 14:56:50 +00:00
he fdd8e7a3e5 Fix an obvious typo: scf -> sc. Discovered while compiling for x68k. 2004-12-05 13:32:03 +00:00
christos d2773f76b5 fix compilation issues. my kernel did not have strip... 2004-12-05 06:53:33 +00:00
christos f08ea58021 clonify strip and sl. 2004-12-05 05:43:04 +00:00
christos 7a05522334 void in arg prototype. 2004-12-05 05:42:19 +00:00
christos f11e795a0f Make ppp a cloning device. Based on the work of Quentin Garnier. 2004-12-05 04:15:16 +00:00
peter e3ceb08f8d Remove redundant conditional; NTUN is always 1 when this file is compiled.
Also remove tun.h include, since it's no longer needed.
2004-12-04 23:22:58 +00:00
peter 4f51481269 Fix a typo in Bill Studenmund's name. 2004-12-04 23:03:33 +00:00
peter b9c49ebff1 Change ifc_destroy to return an int instead of void, so that it
can pass back errors to ifconfig.
2004-12-04 18:31:43 +00:00
peter 396b87b8c2 Convert lo(4) to a clonable device.
This also removes the loif array and changes all code to use the new
lo0ifp pointer which points to the lo0 ifnet structure.

Approved by christos.
2004-12-04 16:10:25 +00:00
christos 0146482549 Clonify bpf. I am not changing /dev/bpfX -> /dev/bpf until all userland
programs have been fixed.
2004-11-30 04:28:43 +00:00
skrll 4979a4d3be Re-order the inclusion of opt_pfil_hooks so PFIL_HOOKS gets set properly. 2004-11-28 17:16:10 +00:00
martin e07d3f82e7 Add a pfil(9) hook to get notified when interfaces detach.
When the ethernet interface of a pppoe pseudo-interface detaches, remove
the association and mark the pppoe interface down.
This should fix PR kern/28375.
2004-11-28 11:44:36 +00:00
wiz 95f9af9926 Apply patch from PR 23990 by Greg Troxel (s/AF_DLI/AF_LINK/ in a comment):
<net/if_dl.h> defines struct sockaddr_dl.  On the line defining member
"sdl_family" (which overlaps "sa_family" in struct sockaddr), the
comment says AF_DLI.

But,
1) AF_DLI is said to be a DEC Direct data link interface
   (sys/socket.h)
2) The kernel actually sends sockaddr_dl structs with AF_LINK.
2004-11-20 00:53:13 +00:00
dsl de3f63a902 Add prototypes for functions that convert media to/from strings.
In libutil/if_media.c (moved from ifconfig.c so that they can be shared
in crunched binaries)
2004-11-11 20:34:30 +00:00
christos fbbeedbe63 PR/27286: Tom Ivar Helbekkmo: Allow RTM_GET to work with RTA_IFA|RTA_IFP set.
Quiting Tom: The problem is the special case of an RTM_GET message
that wants interface information included in the response, and
therefore include the RTA_IFA or RTA_IFP (or both) flags in the
bitmask that says what addresses are supplied in the message.  For
the RTM_GET message, it doesn't make sense to supply addresses
other than the one you're asking about, so those two other bits
are, in that specific case, overloaded with this meaning.

There is code in sys/net/rtsock.c to handle the case, but at some
time, extra sanity checking of the received message was added, that
failed to take this possibility into account.

The patch, is needed for the Asterisk software PBX to work properly
when it has multiple interfaces active: it needs to ask the kernel
for the IP address of the interface that will be used to communicate
with a given host.
2004-10-23 19:13:22 +00:00
dsl 43dde40d82 Put spaces either side of '|' for clarity ('|' looks too much like 'I' or 'l') 2004-10-16 11:11:04 +00:00
tron 8982fe0346 Backout last two revision:
1.) There is objection against this change by at least one developer.
2.) These changes cause repeatable system lockups and crashes for
    at least four people.
2004-10-07 20:06:58 +00:00
bad 2a256a96ac Interfaces that do checksum offloading indicate the checksum status of
received packets in csum_flags in the packet header.  Packets that are
forwarded over the bridge need to have csum_flags cleared before being
put on the output queue.  Do so in bridge_enqueue().

Discussed with Jason Thorpe.

Fixes PR kern/27007 and the first part of PR kern/21831.
2004-10-06 10:01:00 +00:00
itojun 6c66b599bb use ifunit() 2004-10-06 03:49:03 +00:00