summaryrefslogtreecommitdiff
path: root/sys/net
AgeCommit message (Collapse)Author
2015-10-30Add m_resethdr() to clear any state (pf, tags, flags) of an mbuf packet.Reyk Floeter
Start using it in pair(4) to clear state on the receiving interface; m_resethdr() will also be used in other parts of the stack. OK bluhm@ mikeb@
2015-10-30Clean up handling of 'clear states' pfsync packets.Mike Belopuhov
If interface was specified in the packet only if-bound states attached to this interface must be purged. ok mpi, looked at by sasha@
2015-10-30Rename rtrequest1() to rtrequest().Alexander Bluhm
OK mpi@
2015-10-28Remove linkmtu and maxmtu from struct nd_ifinfo. IN6_LINKMTU can nowFlorian Obser
die and ifp->if_mtu is the one true mtu. Suggested by and OK mpi@
2015-10-27Use rt_ifidx rather than rt_ifp.Martin Pieuchot
ok bluhm@
2015-10-25unbreak tree for ramdisks without INET6Theo de Raadt
2015-10-25I should not have committed this chunk. Spotted by krw@Martin Pieuchot
2015-10-25Simple sizes for free(9).Martin Pieuchot
ok claudio@
2015-10-25Merge rtable_mpath_conflict() into rtable_insert().Martin Pieuchot
ok claudio@
2015-10-25Be more consisten with rtmsgs. Always set rtm_index (even in the RTM_GETClaudio Jeker
case) and always set rtm_pid to the pid of the requestor (even in the sysctl code path). OK mpi@
2015-10-25Do not overwrite if_rtrequest() if the driver specified it *before*Martin Pieuchot
calling if_attach().
2015-10-25ifa is no longer used.Martin Pieuchot
2015-10-25arp_ifinit() is no longer required.Martin Pieuchot
2015-10-25Introduce if_rtrequest() the successor of ifa_rtrequest().Martin Pieuchot
L2 resolution depends on the protocol (encoded in the route entry) and an ``ifp''. Not having to care about an ``ifa'' makes our life easier in our MP effort. Fewer dependencies between data structures implies fewer headaches. Discussed with bluhm@, ok claudio@
2015-10-25Introduce if_rtrequest() the successor of ifa_rtrequest().Martin Pieuchot
L2 resolution depends on the protocol (encoded in the route entry) and an ``ifp''. Not having to care about an ``ifa'' makes our life easier in our MP effort. Fewer dependencies between data structures implies fewer headaches. Discussed with bluhm@, ok claudio@
2015-10-25Instead of doing the the if_get() dance for rt_missmsg(), change theAlexander Bluhm
function to take an interface index. discussed with mpi@; OK claudio@
2015-10-24Some rt_ifp to rt_ifidx conversions.Martin Pieuchot
ok bluhm@
2015-10-24Define ``rt_ifidx'' as rt_ifp->if_index to ease the transtion towardsMartin Pieuchot
getting rid of interface pointers in route entries. ok bluhm@
2015-10-24Remove superfluous assignment.Reyk Floeter
Pointed out by and OK mikeb@
2015-10-24Add pair(4), a vether-based virtual Ethernet driver to interconnectReyk Floeter
rdomains and bridges on the local system. This can be used to route through local rdomains, to create L2 devices (like trunks) between them, and many other things. Discussed with many, with input from mpi@ OK sthen@ phessler@ yasuoka@ mikeb@
2015-10-24lookup tap devices in tapkqfilter, not tun devices.David Gwynne
libevent likes this more.
2015-10-23Split up tun(4) into tun(4) & tap(4). Killing the link0 magic to switchClaudio Jeker
between modes. The two drivers still share most of the code but the mode switcher is gone. OK dlg@ mpi@
2015-10-23Update route entries reference counters atomically.Martin Pieuchot
This allows us to only grab the KERNEL_LOCK when the last reference of an entry has been dropped. For symmetry also grab the KERNEL_LOCK inside rtalloc(9). ok dlg@, bluhm@
2015-10-23It was possible to create a gateway route pointing to another gatewayAlexander Bluhm
route by changing the gateway. Despite the error message when doing so, the route did actually change. The gateway is modified by rt_setgate(), the error is created by rt_getifa(). Do these operations the other way around. OK mpi@
2015-10-23Introduce a new sysctl NET_RT_IFNAMES that returns only ifnames to ifindexClaudio Jeker
mappings. This will be used by if_nameindex(3), if_nametoindex(3) and if_indextoname(3) soon to fix the issues in pledge because of inet6 link local addressing. OK mpi@ benno@ deraadt@ The libc version will follow soon so better start updating your kernels
2015-10-23pass the right sizes to free.David Gwynne
2015-10-23inline the hfsc_active TAILQ.David Gwynne
make cl_actc in hfsc_class a TAILQ rather than a pointer to a TAILQ that gets allocated seaprately.
2015-10-23inline the hif_eligible TAILQ.David Gwynne
make hif_eligible in hfsc_if a TAILQ rather than a pointer to a TAILQ that gets allocated separately. "look ma, i saved 4 or 8 bytes"
2015-10-23counting packets in hif_packets in hfsc_if is redundant.David Gwynne
the ifqueue struct has the same information, and hif_packets is never read separately. trim it.
2015-10-23tweak the vnetid so it can be optional and therefore cleared/deleted.David Gwynne
the abstract vnetid is promoted to a uin32_t, and adds a SIOCDVNETID ioctl so it can be cleared. this is all because i set an assignment on implementing a virtual network interface and the students got confused when vnetid 0 didnt show up in ifconfig output. the vnetid in the vxlan(4) protocol is optional, but the current code confuses 0 with no vnetid being set. this makes it clear. ok reyk@ who also simplified my diff
2015-10-23remove the pointer from hfsc_class structs back to hfsc_if.David Gwynne
you get to hfsc_class via a hfsc_if, so just pass the hfsc_if around on the stack when we need it rather than following the pointer back. most of this change is passing the hif on the stack. ok mpi@ henning@
2015-10-22Kill link_rtrequest(), introduce in 1990 to "fix" the resultMartin Pieuchot
of rt_getifa() when adding link level route from outside the kernel. ok claudio@
2015-10-22Use only one refcounting mechanism for route entries.Martin Pieuchot
ok bluhm@, dlg@, claudio@
2015-10-22Only check for rt_ifp now that it is alays the same as rt_ifa->ifa_ifp.Martin Pieuchot
ok millert@, bluhm@
2015-10-22Make sure that the address matching the key (destination) of a routeMartin Pieuchot
entry is attached to this entry. ok phessler@, bluhm@
2015-10-22Kill dead code, ifa is specified and won't change.Martin Pieuchot
ok bluhm@
2015-10-22Inspired by satosin(), use inline functions to convert sockaddr dl.Alexander Bluhm
Instead of casts they check wether the incoming object has the expected type. So introduce satosdl() and sdltosa() in the kernel. OK mpi@
2015-10-22Do not dereference ``ifa_ifp'' when we already have an ``ifp'' pointer.Martin Pieuchot
2015-10-21Return the correct error code when a table already exists.Martin Pieuchot
2015-10-21u_short -> unsigned int for rtableid.Martin Pieuchot
2015-10-17Fix build with IFMEDIA_DEBUG defined; ok sthen@Stefan Sperling
2015-10-16If a DOWN route entry is passed to a L2 output function, be dumb andMartin Pieuchot
simply use it. In most of the cases doing a route lookup at this point is a noop as it will return you the same DOWN entry you already have. The exception is the case where the route has been removed from tree since your kernel looked for it. So what? It's just a blue packet. Note that this "exception" can only happen if your sending path does not run under the KERNEL_LOCK. ok mikeb@
2015-10-15When using a pf rule with both nat-to and rdr-to, it could happenAlexander Bluhm
that the nated source port was reused as destination port. Do not initialize nport at the beginning of the function, but where it is needed. OK sashan@
2015-10-15Fix previous. The port number is not included in sc_src and it isYASUOKA Masahiko
checked already at beginning of the loop. ok reyk
2015-10-14Reset the RTF_CONNECTED flag when cloning an entry.Martin Pieuchot
While here check for RTF_CLONED insted of RTM_RESOLVE when adding an entry. Found while debugging naddy@'s NFS vs em(4) vs rtisvalid(9) issue.
2015-10-14Rewrite the logic around the dymanic array of routing tables to helpMartin Pieuchot
turning rtable_get(9) MP-safe. Use only one per-AF array, as suggested by claudio@, pointing to an array of pointers to the routing table heads. Routing tables are now allocated/initialized per-AF. This will let us allocate routing table on-demand instead of always having an AF_INET, AF_MPLS and AF_INET table as soon as a new rtableID is used. This also get rid of the "void ***" madness. ok dlg@, jmatthew@
2015-10-13- pf_insert_src_node(): global argument (arg6) is useless, functionAlexandr Nedvedicky
always gets pointer to rule. - pf_remove_src_node(): function should always remove matching src node, regardless the sn->rule.ptr being NULL or valid rule - sn->rule.ptr is never NULL, spotted by mpi and Richard Procter _von_ gmail.com OK mpi@, OK mikeb@
2015-10-13Make sure RTF_LOCAL route entries are UP when added to the tree.Martin Pieuchot
This is required to maintain the original BSD behavior of locally configured addresses being always reacheable. Some interfaces are^w^W^Wem(4) is special and generally has a DOWN link state when configured by netstart(8). As a result all the route entries cloned/added before its link state goes to UP are also marked as DOWN. Note that this problem was not present when local addresses were attached to lo0. ok mikeb@
2015-10-12the pattr argument to IFQ_ENQUEUE is unused, so let's get rid of it.David Gwynne
also the comment above IFQ_ENQUEUE that says the pattr argument is unused. ok mpi@
2015-10-12Unify link state change notification.Martin Pieuchot
ok mikeb@