summaryrefslogtreecommitdiff
path: root/sys/net
AgeCommit message (Collapse)Author
2010-07-01Allow to specify an alternative enc(4) interface for an SA. AllReyk Floeter
traffic for this SA will appear on the specified enc interface instead of enc0 and can be filtered and monitored separately. This will allow to group individual ipsec policies to virtual interfaces and simplifies monitoring and pf filtering with many ipsec policies a lot. This diff includes the following changes: - Store the enc interface unit (default 0) in the TDB of an SA and pass it to the enc_getif() lookup when running the bpf or pf_test() handlers. - Add the pfkey SADB_X_EXT_TAP extension to communicate the encX interface unit for a specified SA between userland and kernel. - Update enc(4) again to use an allocate array instead of the TAILQ to lookup the matching enc interface in enc_getif() quickly. Discussed with many, tested by a few, will need more testing & review. ok deraadt@
2010-07-01We have to add enc0 to the "enc" interface group manually on boot.Reyk Floeter
Adopted from the loop lo0 code.
2010-06-30fix route label awesomeness, issue also known as PR6416Henning Brauer
broken by ryan in australia problem found & nagging by sthen jsg found the fix but failed to apply the cluestick correctly ;) test & ok sthen
2010-06-29Replace enc(4) with a new implementation as a cloner device. We stillReyk Floeter
create enc0 by default, but it is possible to add additional enc interfaces. This will be used later to allow alternative encs per policy or to have an enc per rdomain when IPsec becomes rdomain-aware. manpage bits ok jmc@ input from henning@ deraadt@ toby@ naddy@ ok henning@ claudio@
2010-06-28Clean up iterface stats handling:Ryan Thomas McBride
- 'make -Fi' reset ALL the interface statistics can be restricted with -i ifname - 'make -Fa -i ifname' fail (it's meaningless) - get rid of a silly little struct that's only used for one thing ok henning
2010-06-28Add the rtable id as an argument to rn_walktree(). Functions likeClaudio Jeker
rt_if_remove_rtdelete() need to know the table id to be able to correctly remove nodes. Problem found by Andrea Parazzini and analyzed by Martin Pelikán. OK henning@
2010-06-27fix a comment and add a new one to make clear what the mbuf ptr save danceHenning Brauer
is for, it is not very obvious... with ryan and jsing
2010-06-27stuff nsaddr/ndaddr/nsport/ndport (addrs/ports after NAT, used a lot whileHenning Brauer
walking the ruleset and up until state is fully set up) into pf_pdesc instead of passing around those 4 seperately all the time, also shrinks the argument count for a few functions that have/partialy had an insane count of arguments. kinda preparational since we'll need them elsewhere too, soon ok ryan jsing
2010-06-27Fix DIOCCHANGERULE ioctl broken in the remove of the address pools.Ryan Thomas McBride
Reported by Alexander Vladimirov.
2010-06-26timeout_del() the timers before destroying an interface so that no timeoutClaudio Jeker
is fired afterwards. Fixes a use after free crash.
2010-06-26Implement a simple keepalive mechanism in gre(4) that is compatible withClaudio Jeker
the one used by Cisco. It sends a return gre packet inside a gre packet to the other side and expects it to return. OK deraadt, reyk additional testing by sthen
2010-06-26bye bye DLT_OLD_PFLOG & friends. dead since 2003. 7 years oughta be enoughHenning Brauer
ok ryan theo reyk
2010-06-04rt_timer_queue_destroy() did not actually destroy, leading to a potentialBret Lambert
memory leak due to misleading nomenclature. Change it to actually destroy, not just clean, the the rt_timer_queue passed to it and adjust the correct caller accordingly (i.e., no need to free the mem on our own now). As a bonus, this gets rid of one of the ridiculous R_Malloc/Bzero/Free cycles, and lets us sneak another bzero -> M_ZERO conversion in. ok claudio@
2010-06-03Add support for 802.1ad-style QinQ nested VLANs.Christian Weisgerber
QinQ-compliant svlan (service VLAN) interfaces are implemented as a new cloner type, use Ethernet type 0x88a8, and have a dedicated VLAN tag hash to avoid ID conflicts. vlan(4) interfaces can be stacked on top of svlan(4). Originally from reyk@, input from claudio@ and deraadt@ ok claudio@
2010-05-31Do not use IF_ENQUEUE() but IF_INPUT_ENQUEUE() instead. The first makroClaudio Jeker
does no overflow checking and does not set the congestion flag. Protocol input queues (inet, inet6, ...) should always use IF_INPUT_ENQUEUE(). OK henning@
2010-05-28Rework the way we handle MPLS in the kernel. Instead of fumbling MPLS intoClaudio Jeker
ether_output() and later on other L2 output functions use a trick and over- load the ifp->if_output() function pointer on MPLS enabled interfaces to go through mpls_output() which will then call the link level output function. By setting IFXF_MPLS on an interface the output pointers are switched. This now allows to cleanup the MPLS input and output pathes and fix mpe(4) so that the MPLS code now actually works for both P and PE systems. Tested by myself and michele (A custom kernel with MPLS and mpe enabled is still needed).
2010-05-24remove bpfdetach() here, because it is called correctly in if_detach()David Gwynne
afterwards diff from gleydson soares ok claudio@
2010-05-19Require RTF_MPLS to be set when a mpls route is added or changed. To removeClaudio Jeker
only the MPLS bits from a route set rtm_fmask to RTF_MPLS. Additionally check if the nexthop is modified and in that case always remove the MPLS info since the path changed. This change makes life in userland a lot easier since the routing daemons normaly don't know about MPLS and until now they destroyed MPLS information when issuing RTM_CHANGEs. OK michele@
2010-05-12bzero() the full compressed update struct before setting the values.Claudio Jeker
This is needed because pf_state_peer_hton() skips some fields in certain situations which could result in garbage beeing sent to the other peer. This seems to fix the pfsync storms seen by stephan@ and so dlg owes me a whiskey. OK dlg@, stephan@
2010-05-11Massiv cleanup of the gif(4) mess. Move encapsulation into gif_output()Claudio Jeker
where it is not necessary to guess protocols by looking at the first nibble. in_gif_output() will encapsulate the packet but not send it. Because of etherip support and the way the bridge works a minimal hack is needed in gif_start() to ensure that the bridged packets are encapsulated as well. This actually started with the idea to add MPLS support but that turned out to be not as simple as in the gre(4) case. Tested by myself (IP, IPv6, etherip, MPLS), sthen@ (IP, IPv6), naddy (IPv6) OK sthen@
2010-05-11Add support for MPLS in GRE. Fairly trivial and a NOP unless option MPLSClaudio Jeker
is defined.
2010-05-08Upon changing the MAC address of an if_trunk interface, all ports are switchedStefan Sperling
to the new MAC. But subsequently added ports were still being assigned the old MAC address because it was copied from the wrong place. Give newly added trunk ports the current MAC of the master port, rather than the saved MAC of the master port. The saved MAC should only be used to restore the original MAC address of the interface when it is removed from the trunk. ok claudio@
2010-05-08While handling SIOCSIFLLADDR, after adjusting the MAC of the interface,Stefan Sperling
call the interface-specific ioctl handler as well in case the driver needs to do something special. E.g. if_trunk expects this in order to update MAC addresses of its trunk ports. If you now see "Inappropriate ioctl for device" errors after running "ifconfig $if lladdr random" please let me know. Most likely the ioctl handler of the driver needs fixing. ok claudio@, "I only count half an ok for networking" tedu@
2010-05-07Start cleaning up the mess called rtalloc*. Kill rtalloc2, make rtalloc1Claudio Jeker
accept flags for report and nocloning. Move the rtableid into struct route (with a minor twist for now) and make a few more codepathes rdomain aware. Appart from the pf.c and route.c bits the diff is mostly mechanical. More to come... OK michele, henning
2010-05-06Move the net/bpf.h include done and wrap it in the ususal #if NBPFILTER > 0Claudio Jeker
block as done in other drivers. Based on an old diff by Gleydson Soares.
2010-05-06Remove the incorrect if_media code. It is no longer needed to show and trackClaudio Jeker
link states. Additionally do not up the interface when opening the device. Resulting in the same behaviour as on real ethernet interfaces. OK sthen
2010-05-02The line-discipline-specific ioctls return -1 to indicate thatStefan Sperling
the non-line-discipline-specific ioctl handler should be tried. So changing these to return ENOTTY was wrong. Noted on misc@ because of resulting pppd log spam (but it didn't break anything serious): http://marc.info/?l=openbsd-misc&m=127258856501621&w=2 ok sthen@, miod@
2010-05-01incomming -> incomingMichael Knudsen
The ones found in gnu/ left out by intention. ok jmc
2010-04-28Cast 'a' to (void *) in the REASON_SET macro. Makes gcc4 happy.Robert Nagy
ok henning@
2010-04-25Properly adjust group demotion counters when groups are added orMarco Pfatschbacher
removed. Extend carp demote logging to also show the reason for the demote. Return EINVAL instead of ERANGE if a carpdemote request is out range. Requested from otto. OK mcbride, henning.
2010-04-24Make if_ppp and if_sl ioctl handlers return ENOTTY for unsupportedStefan Sperling
ioctls, instead of -1 or EINVAL. ENOTTY audit suggested to me by uwe. ok dlg tedu
2010-04-23Use proper Queen's English in a comment. Drive-by fix, no functional change.Stefan Sperling
2010-04-21Fix validation of div by constant; from Guy Harris; ok deraadt@ miod@Otto Moerbeek
2010-04-21Implement a way to get information about a rtable. Currently only the rtableidClaudio Jeker
and rdomainid are returned. This is necessary to know where L2 information of a table is stored (which will be needed soon by bgpd). Also while there change the errno for non-existing routing tables to ENOENT. 'Fine' deraadt@
2010-04-20remove proc.h include from uvm_map.h. This has far reaching effects, asTed Unangst
sysctl.h was reliant on this particular include, and many drivers included sysctl.h unnecessarily. remove sysctl.h or add proc.h as needed. ok deraadt
2010-04-17When the MAC address changes, change the IPv6 link local addressStefan Sperling
accordingly if one is configured and we're not a router. Else IPv6 will leak the old MAC address after "ifconfig $if lladdr random". Based on an initial diff and idea from Theo. OK deraadt, "makes sense" and help by naddy, silent agreement by claudio
2010-04-17use ifnewlladdr() for trunk lladdr changes, tooTheo de Raadt
ok stsp
2010-04-17split SIOCSIFLLADDR code out into an ifnewlladr() functionTheo de Raadt
ok stsp
2010-04-09encif is a global variable and thus pre-zeroed, don't bother bzero()ingOwain Ainsworth
it after the fact. ok henning@, claudio@
2010-04-09replace pool_get(), memset(,0,) with pool_get(,PR_ZERO) as $DEITYOwain Ainsworth
intended. ok claudio@, henning@
2010-04-06Simple implementation of RFC4941, "Privacy Extensions for StatelessStefan Sperling
Address Autoconfiguration in IPv6". For those among us who are paranoid about broadcasting their MAC address to the IPv6 internet. Man page help from jmc, testing by weerd, arc4random API hints from djm. ok deraadt, claudio
2010-04-03document the first byte of the random MAC addressTheo de Raadt
2010-04-02ugly spacingTheo de Raadt
2010-04-02Special-case SIOCADDMULTI and SIOCDELMULTI ioctls, based on code from if_tun.Stefan Sperling
Makes IPv6 work with if_vether. ok deraadt
2010-04-02allow this to compile in the never-gonna-happen world without INETTheo de Raadt
2010-03-23Fix a crash in pfsync when running IPSEC.Pierre-Yves Ritschard
Found out the hard way by Laurent ``bucky'' Lavaud and myself. Input by claudio@, ok dlg@
2010-03-23Set rtm_mpls on RTM_GET so that we get the correct options on mpls routes.Claudio Jeker
OK michele@
2010-03-23dont maintain a list of vether devices inside the driver if they are neverDavid Gwynne
looked up. can vether get any smaller? ok deraadt@ claudio@
2010-03-20Don't leak memory when resizing routing table arrayBret Lambert
ok claudio@
2010-03-08argh, in del too, simultaneously spotted by kettenis and meHenning Brauer