summaryrefslogtreecommitdiff
path: root/sys/net
AgeCommit message (Collapse)Author
2014-04-23Don't attempt to deal with link types supported by no drivers in theJeremie Courreges-Anglas
tree. ok henning@
2014-04-23You don't want to use ifa_ifwithroute(), it exists for to the routingMartin Pieuchot
crazyness only.
2014-04-22Remove some altq tentacles.Martin Pieuchot
ok pelikan@, henning@
2014-04-22ifa_ifwithroute() is the only magic place where an AF_LINK sockaddrMartin Pieuchot
can be given to ifa_ifwithnet(). Handle this specific case directly and let ifa_ifwithnet() do only one thing: iterate on all the addresses of all the interfaces in a given routing domain to return the most specific matching address. ok mikeb@
2014-04-22NULL is cooler than 0 when pointers are concernedHenning Brauer
ok gcc & md5 (aka no binary change)
2014-04-22we used to handle the vlan tag etc insertion very very very late,Henning Brauer
on al already ass embed ethernet frame, which meant: -copy (most of) the existing ethernet header into a ether_vlan_header on the stack -fill the extra fields in ether_vlan_header -set the ether type -m_adj() to make room for the extra space ether_vlan_header needs -m_copyback the ether_vlan_header into the mbuf that involves moving data around, which isn't all that cheap. cleaner & easier to have ether_output prepend the ether_vlan_header instead of the regular ethernet header, which makes the vlan tagging essentially free in most cases. help & ok reyk, naddy; waste of time bikeshedding tech@
2014-04-21g/c hdrcmplt var, we can just set the esrc ptr earlier and re-set it inHenning Brauer
the pseudo_AF_HDRCMPLT case, ok claudio reyk
2014-04-21__inline -> inlineHenning Brauer
2014-04-21ip_output() using varargs always struck me as bizarre, esp since it's onlyHenning Brauer
ever used to pass on uint32 (for ipsec). stop that madness and just pass the uint32, 0 in all cases but the two that pass the ipsec flowinfo. ok deraadt reyk guenther
2014-04-21we'll do fine without casting NULL to struct foo * / void *Henning Brauer
ok gcc & md5 (alas, no binary change)
2014-04-20factor our ether_addheader for readability; there's more to come thereHenning Brauer
ok claudio reyk
2014-04-20ether_output: instead of assembling the ethernet header and then callingHenning Brauer
carp_rewrite_lladdr to overwrite the src lladdr, get the intended src lladdr before assembling the ethernet header. carp_rewrite_lladdr -> carp_get_srclladdr ok reyk claudio
2014-04-20ether_output: instead of using an esrc buffer in which we copy the intendedHenning Brauer
src lladdr just to copy it from the esrc buffer into the ethernet header a few lines later, use an esrc pointer to figure out where to copy the src lladdr from. ok claudio reyk
2014-04-20When switching rdomains the sadl needs to be removed and re-added from theClaudio Jeker
RB lookup tree because the rdomain id is part of the lookup key. Without this the RB tree gets corrupted and in the worst case a use after free can happen when the interface is destroyed. Why the sadl addresses are added to the tree in the first place is something to reconsider. OK henning@, mpi@, sthen@
2014-04-19disgusting altq compat hack goes awayHenning Brauer
2014-04-19now that if_snd is a proper ifqueue, this cast diesHenning Brauer
2014-04-19ifnet's if_snd becomes a regular ifqueue instead of ifaltq, the need toHenning Brauer
keep ifqueue and ifaltq in sync is gone and thus the comment obsolete, and finally there is no more need to include if_altq.h either
2014-04-19minus altq tentacles, plus missing IF_DROP here as wellHenning Brauer
2014-04-19kill altq bits here as wellHenning Brauer
2014-04-19shrink pf by 445 lines.Henning Brauer
while there, get rid of the altq ioctls and assciated now obsolete code
2014-04-19remove the altq enable/attach and disable/detach bitsHenning Brauer
2014-04-19remove very questionable altq "optimization" - claudio and I can'tHenning Brauer
convince ourselves that that was right to begin with. anyway, begone.
2014-04-19all I wanted to do is removing the altq special casing, but then it turnedHenning Brauer
out the entire codepath is unreachable. glad I'm not our ppp maintainer, he has work to do. kill that unreachable code, with & ok claudio
2014-04-19remove altq special casing.Henning Brauer
big WTF regarding the fastq use there while verifying w/ claudio, but that's for the ppp maintainer and unrelated
2014-04-19the altq versions of the IFQ_* macros can finally go. chances of thisHenning Brauer
file becoming readable increase.
2014-04-19 /*Henning Brauer
* altq for loop is just for debugging. * only used when called for loop interface (not for * a simplex interface). */ bye bye!
2014-04-18There is no need to initialize globals to 0.Claudio Jeker
2014-04-18reaching into altq outside #ifdef ALTQ is bad, mmkay? ok claudioHenning Brauer
2014-04-18pf_send_tcp: ask the stack to do the cksum instead of doing it manuallyHenning Brauer
ok benno lteo naddy (back in january)
2014-04-14"struct pkthdr" holds a routing table ID, not a routing domain one.Martin Pieuchot
Avoid the confusion by using an appropriate name for the variable. Note that since routing domain IDs are a subset of the set of routing table IDs, the following idiom is correct: rtableid = rdomain But to get the routing domain ID corresponding to a given routing table ID, you must call rtable_l2(9). claudio@ likes it, ok mikeb@
2014-04-11Interfaces are associated to rdomains, make it clear by renamingMartin Pieuchot
`sc_rtableid' into `sc_rdomain'. No functional change. ok reyk@
2014-04-11Fix tree breakage.Kenneth R Westerback
With r1.160 route.c needs #include <net/if_dl.h> because bsd.rd and friends don't pull in netmpls/mpls.h which is how bsd[.mp] get it. ok deraadt@ guenther@
2014-04-10Don't use ifa_ifwithnet() with obvious sockaddr_dl argument. ThisMartin Pieuchot
function should not deal with link-layer addresses and here there's no reason to do it. ok mikeb@
2014-04-10Retire rtinit() an use rt_ifa_add(9) and rt_ifa_del(9) to manageMartin Pieuchot
connected routes to prefixes/hosts. Since the introduction of rt_ifa_addloop(9) and rt_ifa_delloop(9), rtinit() was just a wrapper, so use the underlying functions directly and document them. Inputs from and ok mikeb@, manpage tweaks from jmc@
2014-04-08Revert 1.27 and 1.28, but make sure to initialize the pxd_unit field correctlyMiod Vallat
in pppxopen(). ok dlg@ yasuoka@
2014-04-05Be sure to release rwlock when returning error in pppxclose().Miod Vallat
2014-04-04Paul B. Henson discovered it was possible to hit a kernelJonathan Gray
panic with pppx when using npppd with multiple pppx devices. This is triggered when pppxclose() is called on device that hasn't been opened causing a NULL dereference and panic. Avoid this by returning ENXIO if the device has not been opened. ok yasuoka@
2014-04-03Introduce rt_ifa_{add,del}loop() to replace in6_{add,rem}loop().Martin Pieuchot
Move these functions to a more generic place and make them reuse existing code, they'll be soon used in IPv4 too. Tested by André Lucas, Vigdis and sthen@, thanks! ok sthen@
2014-04-03It cannot be assumed the top of the mbuf chain has required length here.YASUOKA Masahiko
Actually, since packets from Octeon's cnmac(4) don't have enough size, pppoe(4) is unable to connect. ok claudio
2014-03-30Eliminates struct pcred by moving the real and saved ugids intoPhilip Guenther
struct ucred; struct process then directly links to the ucred Based on a discussion at c2k10 or so before noting that FreeBSD and NetBSD did this too. ok matthew@
2014-03-29Kill pflowproto 9, it's unfixable post 2038, a better, standardizedFlorian Obser
option is pflowproto 10. Also it duplicates a lot of code from pflowproto 10 and will get in the way in the future. OK benno@
2014-03-27When enforcing TOS (Traffic Class), preserve the ECN bits, just as we doJeremie Courreges-Anglas
with IPv4 packets. ok mikeb@
2014-03-27Stop mixing interface address flags with routing entry ones.Martin Pieuchot
Instead of always copying ifa_flags to the routing entry flags when creating a route by calling rtinit(), explicitly pass the RTF_CLONING flag when required. This means ifa_flags are now *only* used to check if an address has an associated route that was created by the kernel auto-magically. ok benno@
2014-03-26bcmp -> memcmpMartin Pieuchot
2014-03-26No need to check here if the destination address is ours, because inMartin Pieuchot
such case loouput() is called not ether_output(). ok claudio@, mikeb@
2014-03-21rt_timer* spring cleanup.Martin Pieuchot
Rename and document rt_timer_count() into rt_timer_queue_count() to be consistent with the other functions. Remove unused argument from rt_timer_queue_destroy(), clean the definitions and finally use the same order in NAME and DESCRIPTION as requested by jmc@. ok henning@
2014-03-20Do not pull <sys/tree.h> unconditionally in <net/if.h>, only the addressMartin Pieuchot
tree and the 80211 nodes need it. ok henning@, mikeb@
2014-03-19Since in{,6}_ifdetach() take care of removing the IPv4/6 addressesMartin Pieuchot
from the per-ifp list when an interface is destroyed/removed the only address left on the list at this point is the link-layer one. So remove the custom loop and its associated hack for the link-layer address and simply call if_free_sadl(). As a side effect, this should fix any scenario where if_alloc_sadl() is called multiple time since the first link-layer address allocated was never removed from the per-ifp list.
2014-03-18Rename rt_gettable() into rtable_get(), swap its arguments to beMartin Pieuchot
coherent with the existing rtable_* functions and document it. While here fix some other manpage glitches pointed out by jmc@.
2014-03-17Remove pre-rt_getifa() code to find the address descriptor (ifa) relatedMartin Pieuchot
to a route entry, no need to do the work twice. This chunk should have been deleted when post-4.4BSD changes from BSD/OS 4.2 were merged more than 10 years ago. While here properly indent the following block. tested by chris@, ok krw@