tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Porting umb(4) from OpenBSD



Le 03/05/2018 à 04:46, Pierre Pronchery a écrit :
You can obtain the fix(es) and follow my changes as I go here:
https://git.edgebsd.org/gitweb/?p=src.git;a=shortlog;h=refs/heads/khorben/umb

	int		 umb_match(device_t, cfdata_t, void *);
	[etc]

please make all of that static, global symbols are bad

	uint8_t umb_qmi_alloc_cid[] = {
	[etc]

if that's not supposed to move it should be const (and static too), also
take care of the functions that use that, they should use const too

	ifp->if_mtu = 1500;		/* use a common default */
	ifp->if_mtu = sc->sc_maxpktlen;

this doesn't look nice

	sc->sc_resp_buf = kmem_alloc(sc->sc_ctrl_len, M_NOWAIT);

that's the wrong flag

	#if 0
			if ((error = suser(p)) != 0)
				break;
	#endif

kauth, no?

		error = copyout(&sc->sc_info, ifr->ifr_data,
		    sizeof (sc->sc_info));

maybe we should explicitly zero out sc_info in umb_attach, perhaps it
already is though

	m_copydata(m, 0, len, ptr + 1);

can you add a KASSERT please, to make sure 'len' is smaller than the area
on ptr+1

	all the sizeof (x)

please remove the whitespace, sizeof(x)

Thanks,
Maxime


Home | Main Index | Thread Index | Old Index