1/* 2 * Copyright (C) 1999-2000 by Maksim Yevmenkin <m_evmenkin@yahoo.com> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * BASED ON: 27 * ------------------------------------------------------------------------- 28 * 29 * Copyright (c) 1988, Julian Onions <jpo@cs.nott.ac.uk> 30 * Nottingham University 1987. 31 */ 32 33/* |
34 * $FreeBSD: head/sys/net/if_tap.c 111741 2003-03-02 15:50:23Z des $ |
35 * $Id: if_tap.c,v 0.21 2000/07/23 21:46:02 max Exp $ 36 */ 37 38#include "opt_inet.h" 39 40#include <sys/param.h> 41#include <sys/conf.h> 42#include <sys/filedesc.h> --- 746 unchanged lines hidden (view full) --- 789 BPF_MTAP(ifp, m); 790 791 /* xfer packet to user space */ 792 while ((m != NULL) && (uio->uio_resid > 0) && (error == 0)) { 793 len = min(uio->uio_resid, m->m_len); 794 if (len == 0) 795 break; 796 |
797 error = uiomove(mtod(m, void *), len, uio); |
798 m = m_free(m); 799 } 800 801 if (m != NULL) { 802 TAPDEBUG("%s%d dropping mbuf, minor = %#x\n", ifp->if_name, 803 ifp->if_unit, minor(dev)); 804 m_freem(m); 805 } --- 37 unchanged lines hidden (view full) --- 843 if (m == NULL) 844 return (ENOBUFS); 845 mlen = MHLEN; 846 847 top = 0; 848 mp = ⊤ 849 while ((error == 0) && (uio->uio_resid > 0)) { 850 m->m_len = min(mlen, uio->uio_resid); |
851 error = uiomove(mtod(m, void *), m->m_len, uio); |
852 *mp = m; 853 mp = &m->m_next; 854 if (uio->uio_resid > 0) { 855 MGET(m, M_DONTWAIT, MT_DATA); 856 if (m == NULL) { 857 error = ENOBUFS; 858 break; 859 } --- 63 unchanged lines hidden --- |