summaryrefslogtreecommitdiff
path: root/sys/net
AgeCommit message (Collapse)Author
2015-05-14Allocate the input packet handler as part of the trunk_port structureMartin Pieuchot
since they have the same lifetime. Requested by and ok dlg@
2015-05-13test mbuf pointers against NULL not 0Jonathan Gray
ok krw@ miod@
2015-05-13Get rid of the last "#if NTRUNK" by overwriting trunk ports' outputMartin Pieuchot
function. ok claudio@, reyk@
2015-05-12This file is only compiled when "pseudo-device bridge" is included inMartin Pieuchot
your kernel configuration, no need for a #if NBRIDGE > 0 dance.
2015-05-11fix a potential use-after-free in pf_state_rm_src_nodeHenning Brauer
found by jsg; ok jsg mikeb
2015-05-11Take trunk(4) out of ether_input().Martin Pieuchot
Each physical interface of a trunk now gets a specific ifih (interface input handler) that runs before ether_input(). Tested by sthen@, dlg@, Theo Buehler and <mxb AT alumni.chalmers DOT se> ok sthen@, dlg@
2015-05-07fix indentationJonathan Gray
ok miod@
2015-05-05Eliminate rabid semicolonChris Cappuccio
2015-05-05Flag user specified routes with an AF_LINK gateway as RTF_LLINFO.Martin Pieuchot
This makes ND6 and ARP layers happy since they both check for this flag, but is was redundant to provide route(8)'s "-llinfo" option when adding a l2 route. RTF_LLINFO is clearly redundant for userland tools, so only allow the kernel to set it. ok benno@, claudio@
2015-05-04Use ether_input() as default input packet handler and do the necessaryMartin Pieuchot
m_adj(9) to keep bridge(4) working while other pseudo-drivers are converted to if_input(). Tested by mxb <mxb AT alumni DOT chalmers DOT se>, thanks! ok henning@
2015-04-30Do not free & reallocate a new chunk of memory for the interfaceMartin Pieuchot
descriptor during SIOCSIFFLAGS. This prevent a use after free, triggered by the pool/malloc damage finder being currently cooked by dlg@ and deraadt@. ok deraadt@
2015-04-29In most cases, IP fragments do not have an Ethernet padding. SoAlexander Bluhm
add a condition to save a useless call to m_adj() and have a paranoid length check in the other cases. OK henning@
2015-04-29Use if_get() after every tsleep(), in case the bottom half of the driverTheo de Raadt
has destroyed or damaged the interface clone. with mpi
2015-04-23replace the use of struct ifqueue in pipex with mbuf_queues.David Gwynne
this has a slight semantic change. previously pipex would only process up to 128 packets on the input and output queues at a time and would reschedule the softint if there were any left. now it mq_delists the current set of pending packets and only processes them. if anything is added to the queues later they'll cause the softint to run again. this in turn lets us deprecate sysctl_ifq since nothing uses it anymore. because niqueues are mostly wrappers around mbuf_queues, we can provide sysctl_mq and just #define sysctl_niq to it. pipex bits are ok yasuoka@
2015-04-22Add missing header for NBRIDGE chunk, found the hardway and diff fromMartin Pieuchot
Rafael Zalamena.
2015-04-20Remove a bad typo introduced in rev 1.185 and found by jsg@.Martin Pieuchot
Because of this semicolon, a local route was *always* created. This should have no impact except for IPv6 addresses on loopback interfaces for which the IPv6 code was trying to create a route to "::1" twice. This should now be fixed so we can fix the bug that was hidding a bug who was hidding a bug... lalala... ok henning@
2015-04-18replace the hand rolled lists of mbufs in hfsc_classq with anDavid Gwynne
mbuf_list. hfsc lists are very clever because they manage a fifo with a single pointer by abusing the m_next pointer of the tail mbuf to point to the head. clever but hard to read. mbuf_lists are slightly bigger because they explicitely track the head mbuf, but i got us that space back by inlining hfsc_classq into hfsc_class and removing the unnecessary classq field. ok henning@
2015-04-17On Ethernet packets have a minimal length, so very short packetsAlexander Bluhm
get padding appended to them. This padding is not stripped off in ip6_input() (due to support for IPv6 Jumbograms, RFC2675). That means PF needs to be careful when reassembling fragmented packets to not include the padding in the reassembled packet. from FreeBSD; via Kristof Provost; OK henning@
2015-04-17Stubs and support code for NIC-enabled IPsec bite the dust.Mike Belopuhov
No objection from reyk@, OK markus, hshoexer
2015-04-17Remove unsupported SADB_X_IDENTTYPE_CONNECTION; OK markus, hshoexerMike Belopuhov
2015-04-16remove unfinished/unused support for socket-attached ipsec-policiesMarkus Friedl
ok mikeb
2015-04-16change {import,export}_identity so it can be used for policies; ok mikebMarkus Friedl
(fixes sadb_ident_type conversion for policies)
2015-04-15Fix a typo introduced in the niq_enqueue() conversion.Martin Pieuchot
Should fix a panic reported by many on bugs@ and misc@. ok dlg@
2015-04-15Add the necessary glue to keep vlan(4) working while other pseudo-driversMartin Pieuchot
are converted to if_input(). Reviewed by Rafael Zalamena. ok claudio@, dlg@
2015-04-14Remove support for storing credentials and auth information in the kernel.Mike Belopuhov
This code is largely unfinished and is not used for anything. The change leaves identities as only objects referenced by ipsec_ref structure and their handling requires some changes to support more advanced matching of IPsec connections. No objections from reyk and hshoexer, with and OK markus.
2015-04-13Move one "#ifdef NVLAN" chunk needed only if you're running bridge(4) onMartin Pieuchot
to of vlan(4) from ether_input() to bridge_input(). One of the goal of the if_input() plumbing is to stop doing all possible pseudo-drivers checks on every packets. There's no reason that even if you're not running a bridge(4) you've to run this code. This change also will also makes it easier to convert vlan(4) to if_input(). Reviewed by Rafael Zalamena and mikeb@, ok markus@
2015-04-13Now that if_input() set the receiving interface pointer on mbufs for usMartin Pieuchot
there's no need to do it in m_devget(9). Stop passing an ``ifp'' will help for upcoming interface pointer -> index conversion. While here remove unused ``ifp'' argument from m_clget(9) and kill two birds^W layer violations in one commit. ok henning@
2015-04-13ether_input() should not longer be called directly so convert toMartin Pieuchot
if_input(). Needed for the upcoming pseudo-driver integration work. ok dlg@
2015-04-12hfsc_classq has a type member which is never set or read, except to reportDavid Gwynne
its value to userland which will always be 0. drop the member. lie to userland. ok henning@
2015-04-12there's a 1:1 correlation between hfsc_class instances and hfsc_classqDavid Gwynne
instances, so maintaining separate pools for them and pointing between them is overhead. this drops the hfsc_classq pool and inlines it into hfsc_class. ok henning@
2015-04-12pull structs and macros that are only used in hfsc.c out of the headerDavid Gwynne
and into the .c file. ok henning@
2015-04-12dont rely on hfsc.h via pfvar.h to include sys/timeout.h.David Gwynne
2015-04-11the hfsc pools are only used in hfsc.c, so move the init of themDavid Gwynne
there instead of pf_ioctl.c. ok henning@
2015-04-10replace the use of ifqueues for most input queues serviced by netisrDavid Gwynne
with niqueues. this change is so big because there's a lot of code that takes pointers to different input queues (eg, ether_input picks between ipv4, ipv6, pppoe, arp, and mpls input queues) and falls through to code to enqueue packets against the pointer. if i changed only one of the input queues id have to add sepearate code paths, one for ifqueues and one for niqueues in each of these places by flipping all these input queues at once i can keep the currently common code common. testing by mpi@ sthen@ and rafael zalamena ok mpi@ sthen@ claudio@ henning@
2015-04-10mpi@ introduced a ph_cookie in mbuf packet headers that can be usedDavid Gwynne
by a subsystem to stash some state while the mbuf gets queued. eg, net80211 uses it to keep track of the wireless node associated with a packet before submitting it to a drivers snd queue for transmission. this makes pipex use ph_cookie to keep track of the pipex session associated with a packet before submitting it to the softint queues. this lets us get rid of an mbuf tag type, and avoids the cost of tag allocation. ok yasuoka@
2015-04-10Run detach hook and similar before cleaning up any other resource whenMartin Pieuchot
an interface is destroyed/removed. This way we can ensure pseudo-driver changes done after attaching an interface are undone before detaching it. Note: it is safe to call if_deactivate() multiple times as the interface should not have any attached pseudo-interface after the first call. ok deraadt@, dlg@
2015-04-10dont inherit the parent interfaces hardmtu as the vlan interfacesDavid Gwynne
mtu when it gets set up. instead, allow the vlan interfaces mtu to be raised to the parents hardmtu in SIOCSIFMTU handling. pointed out by claudio@
2015-04-09Plug a memory leak in pfr_destroy_kentryMike Belopuhov
pfi_kif objects allocated for table entries created by route-to or by specifying weight weren't garbage collected when the table entry was destroyed. Spotted by Alexandr Nedvedicky <alexandr ! nedvedicky at oracle ! com>, thanks! Ok henning, florian
2015-04-08Table flags are not looked at when a table entry is created.Mike Belopuhov
Spotted by Alexandr Nedvedicky <alexandr ! nedvedicky at oracle ! com>, thanks!
2015-04-08Destination table needs it's own negation flag passed to the pfr_update_stats.Mike Belopuhov
Spotted by Alexandr Nedvedicky <alexandr ! nedvedicky at oracle ! com>, thanks a lot! Ok florian
2015-04-07Do not pass an `ifp' argument to interface input handlers since itMartin Pieuchot
might be overwritten by pseudo-drivers. ok dlg@, henning@
2015-04-02Grab the kernel lock around the bpf_mtap_ether() call in if_input(). ThisMark Kettenis
allows drivers to start calling if_input() without holding the kernel lock while others work on make the bpf code mpsafe. ok dlg@, mpi@
2015-04-01Kill useless comments talking about ether_input().Martin Pieuchot
2015-04-01create a taskq for network tasks to run in. cut ether_input_mbufDavid Gwynne
and if_input up so the work ether_input does gets run on the task instead of directly from hardware receive handlers. this is a step toward letting hardware drivers run without biglock by shoving the work the stack does which needs that lock sideways. general agreement at s2k15 ok mpi@ kettenis@ claudio@
2015-03-31let vlan(4) mtu be limited by the parents hardmtu, not current mtu.David Gwynne
this lets you have networks on the "native" (untagged) vlan on an interface at 1500, while setting a child vlan interfaces mtu to jumbos. ok sthen@ henning@ chris@
2015-03-29if_detached start dequeues mbufs on the start list and immediatelyDavid Gwynne
frees them. IFQ_PURGE does that too, so let's reuse it here.
2015-03-26Remove bits of unfinished IPsec proxy support. DNS' KX records, anyone?Mike Belopuhov
ok markus, hshoexer
2015-03-26Use rt_ifa_add(9) and rt_ifa_del(9) to configure MPLS labels.Martin Pieuchot
Since the removal of the link-layer ifa from "struct ifnet" it was impossible to configure MPLS routes on mpe(4). Because just like enc(4), mpe(4) was abusing the link-layer ifa to attach its route entries. So explicitly pass a "glue" ifa to the routing layer. From Rafael Zalamena who discovered this the hardway, thanks! ok claudio@
2015-03-25introduce code for network input queues. these are to replace theDavid Gwynne
use of struct ifqueue for things handled by softnet. they instead use an mbuf_queue (yay mpsafe) and wrap up the schednetisr and if_congestion handling. ok mpi@
2015-03-18remove the congestion handling from struct ifqueue.David Gwynne
its only used for the ip and ip6 network stack input queues, so it seems unfair that every instance of ifqueue has to carry a pointer around for this specific use case. this moves the congestion marker to a kernel global. if we detect that we're congested, we assume the whole system is busy and punish all input queues. marking a system as congested is done by setting the global to the current value of ticks. as the system moves away from that value, it moves away from being congested until the comparison fails. written at s2k15 ok henning@ beck@ bluhm@ claudio@