ip_divert.c (257241) | ip_divert.c (269699) |
---|---|
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 --- 14 unchanged lines hidden (view full) --- 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 30#include <sys/cdefs.h> | 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 --- 14 unchanged lines hidden (view full) --- 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 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/netinet/ip_divert.c 257241 2013-10-28 07:29:16Z glebius $"); | 31__FBSDID("$FreeBSD: head/sys/netinet/ip_divert.c 269699 2014-08-08 01:57:15Z kevlo $"); |
32 33#include "opt_inet.h" 34#include "opt_inet6.h" 35#include "opt_sctp.h" 36#ifndef INET 37#error "IPDIVERT requires INET" 38#endif 39 --- 128 unchanged lines hidden (view full) --- 168 169 in_pcbinfo_destroy(&V_divcbinfo); 170} 171 172/* 173 * IPPROTO_DIVERT is not in the real IP protocol number space; this 174 * function should never be called. Just in case, drop any packets. 175 */ | 32 33#include "opt_inet.h" 34#include "opt_inet6.h" 35#include "opt_sctp.h" 36#ifndef INET 37#error "IPDIVERT requires INET" 38#endif 39 --- 128 unchanged lines hidden (view full) --- 168 169 in_pcbinfo_destroy(&V_divcbinfo); 170} 171 172/* 173 * IPPROTO_DIVERT is not in the real IP protocol number space; this 174 * function should never be called. Just in case, drop any packets. 175 */ |
176static void 177div_input(struct mbuf *m, int off) | 176static int 177div_input(struct mbuf **mp, int *offp, int proto) |
178{ | 178{ |
179 struct mbuf *m = *mp; |
|
179 180 KMOD_IPSTAT_INC(ips_noproto); 181 m_freem(m); | 180 181 KMOD_IPSTAT_INC(ips_noproto); 182 m_freem(m); |
183 return (IPPROTO_DONE); |
|
182} 183 184/* 185 * Divert a packet by passing it up to the divert socket at port 'port'. 186 * 187 * Setup generic address and protocol structures for div_input routine, 188 * then pass them along with mbuf chain. 189 */ --- 649 unchanged lines hidden --- | 184} 185 186/* 187 * Divert a packet by passing it up to the divert socket at port 'port'. 188 * 189 * Setup generic address and protocol structures for div_input routine, 190 * then pass them along with mbuf chain. 191 */ --- 649 unchanged lines hidden --- |