ubsec.c (109595) | ubsec.c (109623) |
---|---|
1/* $FreeBSD: head/sys/dev/ubsec/ubsec.c 109595 2003-01-20 21:07:30Z sam $ */ | 1/* $FreeBSD: head/sys/dev/ubsec/ubsec.c 109623 2003-01-21 08:56:16Z alfred $ */ |
2/* $OpenBSD: ubsec.c,v 1.115 2002/09/24 18:33:26 jason Exp $ */ 3 4/* 5 * Copyright (c) 2000 Jason L. Wright (jason@thought.net) 6 * Copyright (c) 2000 Theo de Raadt (deraadt@openbsd.org) 7 * Copyright (c) 2001 Patrik Lindergren (patrik@ipunplugged.com) 8 * 9 * All rights reserved. --- 1313 unchanged lines hidden (view full) --- 1323 } else { 1324 int totlen, len; 1325 struct mbuf *m, *top, **mp; 1326 1327 ubsecstats.hst_unaligned++; 1328 totlen = q->q_src_mapsize; 1329 if (q->q_src_m->m_flags & M_PKTHDR) { 1330 len = MHLEN; | 2/* $OpenBSD: ubsec.c,v 1.115 2002/09/24 18:33:26 jason Exp $ */ 3 4/* 5 * Copyright (c) 2000 Jason L. Wright (jason@thought.net) 6 * Copyright (c) 2000 Theo de Raadt (deraadt@openbsd.org) 7 * Copyright (c) 2001 Patrik Lindergren (patrik@ipunplugged.com) 8 * 9 * All rights reserved. --- 1313 unchanged lines hidden (view full) --- 1323 } else { 1324 int totlen, len; 1325 struct mbuf *m, *top, **mp; 1326 1327 ubsecstats.hst_unaligned++; 1328 totlen = q->q_src_mapsize; 1329 if (q->q_src_m->m_flags & M_PKTHDR) { 1330 len = MHLEN; |
1331 MGETHDR(m, M_DONTWAIT, MT_DATA); 1332 if (m && !m_dup_pkthdr(m, q->q_src_m, M_DONTWAIT)) { | 1331 MGETHDR(m, M_NOWAIT, MT_DATA); 1332 if (m && !m_dup_pkthdr(m, q->q_src_m, M_NOWAIT)) { |
1333 m_free(m); 1334 m = NULL; 1335 } 1336 } else { 1337 len = MLEN; | 1333 m_free(m); 1334 m = NULL; 1335 } 1336 } else { 1337 len = MLEN; |
1338 MGET(m, M_DONTWAIT, MT_DATA); | 1338 MGET(m, M_NOWAIT, MT_DATA); |
1339 } 1340 if (m == NULL) { 1341 ubsecstats.hst_nombuf++; 1342 err = sc->sc_nqueue ? ERESTART : ENOMEM; 1343 goto errout; 1344 } 1345 if (totlen >= MINCLSIZE) { | 1339 } 1340 if (m == NULL) { 1341 ubsecstats.hst_nombuf++; 1342 err = sc->sc_nqueue ? ERESTART : ENOMEM; 1343 goto errout; 1344 } 1345 if (totlen >= MINCLSIZE) { |
1346 MCLGET(m, M_DONTWAIT); | 1346 MCLGET(m, M_NOWAIT); |
1347 if ((m->m_flags & M_EXT) == 0) { 1348 m_free(m); 1349 ubsecstats.hst_nomcl++; 1350 err = sc->sc_nqueue ? ERESTART : ENOMEM; 1351 goto errout; 1352 } 1353 len = MCLBYTES; 1354 } 1355 m->m_len = len; 1356 top = NULL; 1357 mp = ⊤ 1358 1359 while (totlen > 0) { 1360 if (top) { | 1347 if ((m->m_flags & M_EXT) == 0) { 1348 m_free(m); 1349 ubsecstats.hst_nomcl++; 1350 err = sc->sc_nqueue ? ERESTART : ENOMEM; 1351 goto errout; 1352 } 1353 len = MCLBYTES; 1354 } 1355 m->m_len = len; 1356 top = NULL; 1357 mp = ⊤ 1358 1359 while (totlen > 0) { 1360 if (top) { |
1361 MGET(m, M_DONTWAIT, MT_DATA); | 1361 MGET(m, M_NOWAIT, MT_DATA); |
1362 if (m == NULL) { 1363 m_freem(top); 1364 ubsecstats.hst_nombuf++; 1365 err = sc->sc_nqueue ? ERESTART : ENOMEM; 1366 goto errout; 1367 } 1368 len = MLEN; 1369 } 1370 if (top && totlen >= MINCLSIZE) { | 1362 if (m == NULL) { 1363 m_freem(top); 1364 ubsecstats.hst_nombuf++; 1365 err = sc->sc_nqueue ? ERESTART : ENOMEM; 1366 goto errout; 1367 } 1368 len = MLEN; 1369 } 1370 if (top && totlen >= MINCLSIZE) { |
1371 MCLGET(m, M_DONTWAIT); | 1371 MCLGET(m, M_NOWAIT); |
1372 if ((m->m_flags & M_EXT) == 0) { 1373 *mp = m; 1374 m_freem(top); 1375 ubsecstats.hst_nomcl++; 1376 err = sc->sc_nqueue ? ERESTART : ENOMEM; 1377 goto errout; 1378 } 1379 len = MCLBYTES; --- 1470 unchanged lines hidden --- | 1372 if ((m->m_flags & M_EXT) == 0) { 1373 *mp = m; 1374 m_freem(top); 1375 ubsecstats.hst_nomcl++; 1376 err = sc->sc_nqueue ? ERESTART : ENOMEM; 1377 goto errout; 1378 } 1379 len = MCLBYTES; --- 1470 unchanged lines hidden --- |