Deleted Added
full compact
ip_divert.c (217554) ip_divert.c (222488)
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 217554 2011-01-18 21:14:13Z mdf $");
31__FBSDID("$FreeBSD: head/sys/netinet/ip_divert.c 222488 2011-05-30 09:43:55Z rwatson $");
32
33#if !defined(KLD_MODULE)
34#include "opt_inet.h"
35#include "opt_sctp.h"
36#ifndef INET
37#error "IPDIVERT requires INET."
38#endif
39#endif

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

654 INP_RUNLOCK(inp);
655 error = SYSCTL_OUT(req, &xi, sizeof xi);
656 } else
657 INP_RUNLOCK(inp);
658 }
659 INP_INFO_WLOCK(&V_divcbinfo);
660 for (i = 0; i < n; i++) {
661 inp = inp_list[i];
32
33#if !defined(KLD_MODULE)
34#include "opt_inet.h"
35#include "opt_sctp.h"
36#ifndef INET
37#error "IPDIVERT requires INET."
38#endif
39#endif

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

654 INP_RUNLOCK(inp);
655 error = SYSCTL_OUT(req, &xi, sizeof xi);
656 } else
657 INP_RUNLOCK(inp);
658 }
659 INP_INFO_WLOCK(&V_divcbinfo);
660 for (i = 0; i < n; i++) {
661 inp = inp_list[i];
662 INP_WLOCK(inp);
663 if (!in_pcbrele(inp))
664 INP_WUNLOCK(inp);
662 INP_RLOCK(inp);
663 if (!in_pcbrele_rlocked(inp))
664 INP_RUNLOCK(inp);
665 }
666 INP_INFO_WUNLOCK(&V_divcbinfo);
667
668 if (!error) {
669 /*
670 * Give the user an updated idea of our state.
671 * If the generation differs from what we told
672 * her before, she knows that something happened

--- 122 unchanged lines hidden ---
665 }
666 INP_INFO_WUNLOCK(&V_divcbinfo);
667
668 if (!error) {
669 /*
670 * Give the user an updated idea of our state.
671 * If the generation differs from what we told
672 * her before, she knows that something happened

--- 122 unchanged lines hidden ---