Commit Graph

255802 Commits

Author SHA1 Message Date
christos
243229af21 avoid passing literal string to unconst. 2018-01-15 14:38:06 +00:00
maxv
ac53d0edb7 Style, and fix a bug in the AppleTalk path: we're doing
M_PREPEND(M_DONTWAIT), but we forgot to NULL-check the mbuf afterwards.
2018-01-15 14:00:34 +00:00
maxv
9cdd75561f Fix two bugs in altq_etherclassify. When scanning the mbuf chain we need
to make sure that m_next is not NULL, otherwise NULL deref. After that,
we must not touch m->m_pkthdr, given that 'm' may not be the first mbuf
of the chain anymore.

Declare mtop, and add a KASSERT to make sure it has M_PKTHDR set.
2018-01-15 13:14:18 +00:00
maxv
6bf2c882fe Add a KASSERT in IFQ_CLASSIFY, we really need to make sure the given
mbuf is the top of the chain.
2018-01-15 13:05:40 +00:00
maya
b1d2a77c44 indent to magic logic 2018-01-15 12:58:06 +00:00
maya
a0a89e758a malloc+memset zero to malloc(, |M_ZERO);
ok rkujawa
2018-01-15 12:43:42 +00:00
sborrill
3610eeec38 Explain what suffixes are accepted when specifying a size. 2018-01-15 12:20:47 +00:00
maxv
5a476cc8db Fix a bug in the VLAN path: there's an inverted logic, the mbuf needs to
be bigger than struct ether_vlan_header, not smaller.

Meanwhile add a KASSERT in the LLC path.
2018-01-15 12:17:05 +00:00
maxv
35a7dddc87 Style, make the code more readable, and add a KASSERT (we expect the mbuf
to have M_PKTHDR set).
2018-01-15 11:57:27 +00:00
kre
d4d1419421 Paul Goyette suggested improvements to parts of the description of
LINENO ... this is what resulted (with thanks for the grammar lessons,
and sundry references provided!)

No date (Dd) bump - there is no change of substance here, just (hopefully)
a clearer way of saying the same thing.
2018-01-15 11:27:39 +00:00
maxv
aa30280623 Mmh, fix a weird mistake: the guy who added #if NVLAN > 0 forgot to
actually include vlan.h, so the branches are never compiled.

They don't compile, by the way, so fix that too, by reproducing the vlan
input path of ether_input().
2018-01-15 11:16:04 +00:00
maxv
6cc48dd1f8 Several fixes:
- Style and typos
 - Use kmem_zalloc, in case there is a padding between the fields of
   the structures
 - Use ETHER_ADDR_LEN instead of a hard-coded '6'
 - kmem_alloc(KM_SLEEP) can't fail
 - Simplify ether_aton_r
 - Use mutex_obj_free, not to leak memory
2018-01-15 10:27:51 +00:00
martin
1ea7c03869 Redo previous: apply the alignement to the whole struct fpstate - everything
in there is properly aligned, and we need to have fs_queue double aligned
as well.
2018-01-15 10:06:49 +00:00
maxv
1de7a25c8c If the bridge is not running, don't call bridge_stop. Otherwise the
following commands will crash the kernel:

	ifconfig bridge0 create
	ifconfig bridge0 destroy
2018-01-15 09:49:16 +00:00
martin
f0cd174eaf Enable DIAGNOSTIC 2018-01-15 09:48:28 +00:00
maxv
3a2cefcb6b Fix spl leak.
ifconfig gif0 create
	ifconfig gif0 destroy
	WARNING: SPL NOT LOWERED ON ...
2018-01-15 09:26:21 +00:00
maxv
157251fdf3 Style, improve comment, and add KASSERTs on the assumptions. 2018-01-15 08:45:19 +00:00
ozaki-r
4090a5f5a5 Remove extra pserialize_perform from in_purgeaddr
It's already performed in ifa_remove. Note so there (in in6_unlink_ifa too).
2018-01-15 08:17:34 +00:00
msaitoh
16a4147c62 Add IA32_SPEC_CTRL MSR and IA32_PRED_CMD MSR. 2018-01-15 08:17:20 +00:00
maxv
0c81f027ad Fix the net.ether.multicast sysctl. If there is no multicast address
don't kmem_alloc(0) (which panics the kernel), and if the number of
multicast addresses has decreased don't copyout uninitialized kernel
data.
2018-01-15 07:59:48 +00:00
mrg
fd2d59769f note that COMPAT_X implies all COMPAT_X+N. 2018-01-15 07:20:10 +00:00
msaitoh
a84034cb25 Add MSR_IA32_ARCH_CAPABILITIES definition. 2018-01-15 07:19:00 +00:00
msaitoh
797180d078 - Add Intel cpuid 7 %edx bit 29 IA32_ARCH_CAPABILITIES supported bit.
- Add comment.
2018-01-15 06:08:40 +00:00
maya
ad64aeb5f5 Move spammy debug message to debug2.
Similarly spammy messages exist in this debug level.

Requested by gson in PR bin/52898:
ssh -v prints debug message on every keystroke
2018-01-15 05:04:58 +00:00
knakahara
c79da2be88 improve comments 2018-01-15 04:25:48 +00:00
knakahara
6f6ff3733c Fix legacy Tx descriptors printing when WM_DEBUG is enabled. 2018-01-15 04:09:58 +00:00
knakahara
42796cd760 Fix PR kern/52920. Pointed out by David Binderman, thanks. 2018-01-15 02:39:53 +00:00
christos
651232dac7 sprinkle unconst 2018-01-15 00:46:16 +00:00
christos
19e9df2ac8 remove Documents before import. 2018-01-14 22:51:12 +00:00
christos
2207b661f9 add mount_autofs 2018-01-14 22:46:09 +00:00
christos
5e79a1598d Add mount_autofs 2018-01-14 22:44:04 +00:00
christos
87d09387b3 support getargs, fix flush, fix mutex_destroy 2018-01-14 22:43:18 +00:00
christos
5d4f18293e Add -I 2018-01-14 20:16:04 +00:00
christos
9c0fa57d3a new mdnsresponder 2018-01-14 20:07:02 +00:00
christos
8307bba0ea resolve conflicts 2018-01-14 20:04:55 +00:00
martin
87d689fb73 Sync sparc with sparc64 2018-01-14 19:59:51 +00:00
christos
18d6f1d293 import latest version 2018-01-14 19:40:50 +00:00
christos
a7f8f91557 merge conflicts 2018-01-14 19:37:35 +00:00
christos
1ea71b3ac3 import latest mDNSResponder 2018-01-14 18:43:01 +00:00
maxv
f51eb6f270 Fix awful use of m_defrag, this code just can't work. And don't forget to
return the updated pointer, because otherwise use-after-free.

I couldn't test this change because I don't have the hardware.
2018-01-14 18:23:03 +00:00
maxv
bbc9c10413 Dedup. m_defrag is already a common function, no need to reimplement it
there. Meanwhile this should fix two bugs (that I couldn't investigate
more than that since I don't have this hardware): the mbuf passed to
vge_m_defrag was leaked, and the tags were not copied in the returned
mbuf.
2018-01-14 17:43:55 +00:00
maxv
7392e5ed60 KDASSERT -> KASSERT. This code is fast and useful. 2018-01-14 17:16:58 +00:00
maxv
b0e949ed8f style 2018-01-14 16:59:37 +00:00
maxv
29306dbc58 If cnt == 0, don't kmem_alloc(0). Found by Mootja.
Looking at the code, I also find it suspicious that we read
ifv->ifv_mib->ifvm_p directly without making sure ifv_mib != NULL.
2018-01-14 16:50:37 +00:00
maxv
6b75392d29 typos 2018-01-14 16:43:03 +00:00
maxv
d989a87626 Fix use-after-free. There is a path where the mbuf gets pulled up without
a proper mtod afterwards:

218     ipo = mtod(m, struct ip *);
281     m = m_pullup(m, hlen);
232     ipo->ip_src.s_addr

Found by Mootja.

Meanwhile it seems to me that 'ipo' should be set to NULL if the inner
packet is IPv6, but I'll revisit that later.
2018-01-14 16:36:04 +00:00
maxv
8ab6c3b562 Fix memory leak, found by Mootja. 2018-01-14 16:18:11 +00:00
martin
77225cc41e Force explicit alignment for fpstate in the kernel, to match what our
asm code assumes.
We use a stack variable at least once (in fpu_init).
2018-01-14 11:55:33 +00:00
uwe
eff95422ee Copy-paste a .Dx macro for DragonFly (from .Ox) and add a couple of
FreeBSD versions to make autofs(5) man pages cleanly format with groff.
2018-01-14 03:33:10 +00:00
uwe
252235664d .An -nosplit 2018-01-14 03:17:28 +00:00