Deleted Added
full compact
frag6.c (95023) frag6.c (109623)
1/* $FreeBSD: head/sys/netinet6/frag6.c 95023 2002-04-19 04:46:24Z suz $ */
1/* $FreeBSD: head/sys/netinet6/frag6.c 109623 2003-01-21 08:56:16Z alfred $ */
2/* $KAME: frag6.c,v 1.33 2002/01/07 11:34:48 kjc Exp $ */
3
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

--- 218 unchanged lines hidden (view full) ---

228 * If maxfrag is -1, accept all fragments without limitation.
229 */
230 if (ip6_maxfragpackets < 0)
231 ;
232 else if (frag6_nfragpackets >= (u_int)ip6_maxfragpackets)
233 goto dropfrag;
234 frag6_nfragpackets++;
235 q6 = (struct ip6q *)malloc(sizeof(struct ip6q), M_FTABLE,
2/* $KAME: frag6.c,v 1.33 2002/01/07 11:34:48 kjc Exp $ */
3
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

--- 218 unchanged lines hidden (view full) ---

228 * If maxfrag is -1, accept all fragments without limitation.
229 */
230 if (ip6_maxfragpackets < 0)
231 ;
232 else if (frag6_nfragpackets >= (u_int)ip6_maxfragpackets)
233 goto dropfrag;
234 frag6_nfragpackets++;
235 q6 = (struct ip6q *)malloc(sizeof(struct ip6q), M_FTABLE,
236 M_DONTWAIT);
236 M_NOWAIT);
237 if (q6 == NULL)
238 goto dropfrag;
239 bzero(q6, sizeof(*q6));
240
241 frag6_insque(q6, &ip6q);
242
243 /* ip6q_nxt will be filled afterwards, from 1st fragment */
244 q6->ip6q_down = q6->ip6q_up = (struct ip6asfrag *)q6;

--- 75 unchanged lines hidden (view full) ---

320 ICMP6_PARAMPROB_HEADER,
321 erroff - sizeof(struct ip6_frag) +
322 offsetof(struct ip6_frag, ip6f_offlg));
323 }
324 }
325 }
326
327 ip6af = (struct ip6asfrag *)malloc(sizeof(struct ip6asfrag), M_FTABLE,
237 if (q6 == NULL)
238 goto dropfrag;
239 bzero(q6, sizeof(*q6));
240
241 frag6_insque(q6, &ip6q);
242
243 /* ip6q_nxt will be filled afterwards, from 1st fragment */
244 q6->ip6q_down = q6->ip6q_up = (struct ip6asfrag *)q6;

--- 75 unchanged lines hidden (view full) ---

320 ICMP6_PARAMPROB_HEADER,
321 erroff - sizeof(struct ip6_frag) +
322 offsetof(struct ip6_frag, ip6f_offlg));
323 }
324 }
325 }
326
327 ip6af = (struct ip6asfrag *)malloc(sizeof(struct ip6asfrag), M_FTABLE,
328 M_DONTWAIT);
328 M_NOWAIT);
329 if (ip6af == NULL)
330 goto dropfrag;
331 bzero(ip6af, sizeof(*ip6af));
332 ip6af->ip6af_head = ip6->ip6_flow;
333 ip6af->ip6af_len = ip6->ip6_plen;
334 ip6af->ip6af_nxt = ip6->ip6_nxt;
335 ip6af->ip6af_hlim = ip6->ip6_hlim;
336 ip6af->ip6af_mff = ip6f->ip6f_offlg & IP6F_MORE_FRAG;

--- 147 unchanged lines hidden (view full) ---

484 */
485 if (offset < m->m_len) {
486 ovbcopy((caddr_t)ip6, (caddr_t)ip6 + sizeof(struct ip6_frag),
487 offset);
488 m->m_data += sizeof(struct ip6_frag);
489 m->m_len -= sizeof(struct ip6_frag);
490 } else {
491 /* this comes with no copy if the boundary is on cluster */
329 if (ip6af == NULL)
330 goto dropfrag;
331 bzero(ip6af, sizeof(*ip6af));
332 ip6af->ip6af_head = ip6->ip6_flow;
333 ip6af->ip6af_len = ip6->ip6_plen;
334 ip6af->ip6af_nxt = ip6->ip6_nxt;
335 ip6af->ip6af_hlim = ip6->ip6_hlim;
336 ip6af->ip6af_mff = ip6f->ip6f_offlg & IP6F_MORE_FRAG;

--- 147 unchanged lines hidden (view full) ---

484 */
485 if (offset < m->m_len) {
486 ovbcopy((caddr_t)ip6, (caddr_t)ip6 + sizeof(struct ip6_frag),
487 offset);
488 m->m_data += sizeof(struct ip6_frag);
489 m->m_len -= sizeof(struct ip6_frag);
490 } else {
491 /* this comes with no copy if the boundary is on cluster */
492 if ((t = m_split(m, offset, M_DONTWAIT)) == NULL) {
492 if ((t = m_split(m, offset, M_NOWAIT)) == NULL) {
493 frag6_remque(q6);
494 free(q6, M_FTABLE);
495 frag6_nfragpackets--;
496 goto dropfrag;
497 }
498 m_adj(t, sizeof(struct ip6_frag));
499 m_cat(m, t);
500 }

--- 195 unchanged lines hidden ---
493 frag6_remque(q6);
494 free(q6, M_FTABLE);
495 frag6_nfragpackets--;
496 goto dropfrag;
497 }
498 m_adj(t, sizeof(struct ip6_frag));
499 m_cat(m, t);
500 }

--- 195 unchanged lines hidden ---