ip_divert.c (133517) | ip_divert.c (133920) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1988, 1993 3 * The Regents of the University of California. 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 --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * | 1/* 2 * Copyright (c) 1982, 1986, 1988, 1993 3 * The Regents of the University of California. 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 --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * |
29 * $FreeBSD: head/sys/netinet/ip_divert.c 133517 2004-08-11 20:30:08Z andre $ | 29 * $FreeBSD: head/sys/netinet/ip_divert.c 133920 2004-08-17 22:05:54Z andre $ |
30 */ 31 32#include "opt_inet.h" 33#include "opt_ipfw.h" 34#include "opt_ipdivert.h" 35#include "opt_ipsec.h" 36#include "opt_mac.h" 37 --- 330 unchanged lines hidden (view full) --- 368 369 return error; 370 371cantsend: 372 m_freem(m); 373 return error; 374} 375 | 30 */ 31 32#include "opt_inet.h" 33#include "opt_ipfw.h" 34#include "opt_ipdivert.h" 35#include "opt_ipsec.h" 36#include "opt_mac.h" 37 --- 330 unchanged lines hidden (view full) --- 368 369 return error; 370 371cantsend: 372 m_freem(m); 373 return error; 374} 375 |
376/* 377 * Return a copy of the specified packet, but without 378 * the divert tag. This is used when packets are ``tee'd'' 379 * and we want the cloned copy to not have divert processing. 380 */ 381struct mbuf * 382divert_clone(struct mbuf *m) 383{ 384 struct mbuf *clone; 385 struct m_tag *mtag; 386 387 clone = m_dup(m, M_DONTWAIT); 388 if (clone != NULL) { 389 /* strip divert tag from copy */ 390 mtag = m_tag_find(clone, PACKET_TAG_DIVERT, NULL); 391 if (mtag != NULL) 392 m_tag_delete(clone, mtag); 393 } 394 return clone; 395} 396 | |
397static int 398div_attach(struct socket *so, int proto, struct thread *td) 399{ 400 struct inpcb *inp; 401 int error; 402 403 INP_INFO_WLOCK(&divcbinfo); 404 inp = sotoinpcb(so); --- 276 unchanged lines hidden --- | 376static int 377div_attach(struct socket *so, int proto, struct thread *td) 378{ 379 struct inpcb *inp; 380 int error; 381 382 INP_INFO_WLOCK(&divcbinfo); 383 inp = sotoinpcb(so); --- 276 unchanged lines hidden --- |