in_pcb.c (a7df09e8c908fe5417610c0f05579ae45b830b8c) | in_pcb.c (97021c246444967a8f441a90076fb4f7ef22fb3a) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1991, 1993, 1995 3 * The Regents of the University of California. 4 * Copyright (c) 2007 Robert N. M. Watson 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 106 unchanged lines hidden (view full) --- 115 116#define RANGECHK(var, min, max) \ 117 if ((var) < (min)) { (var) = (min); } \ 118 else if ((var) > (max)) { (var) = (max); } 119 120static int 121sysctl_net_ipport_check(SYSCTL_HANDLER_ARGS) 122{ | 1/*- 2 * Copyright (c) 1982, 1986, 1991, 1993, 1995 3 * The Regents of the University of California. 4 * Copyright (c) 2007 Robert N. M. Watson 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 106 unchanged lines hidden (view full) --- 115 116#define RANGECHK(var, min, max) \ 117 if ((var) < (min)) { (var) = (min); } \ 118 else if ((var) > (max)) { (var) = (max); } 119 120static int 121sysctl_net_ipport_check(SYSCTL_HANDLER_ARGS) 122{ |
123 INIT_VNET_INET(curvnet); |
|
123 int error; 124 125 error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); 126 if (error == 0) { 127 RANGECHK(V_ipport_lowfirstauto, 1, IPPORT_RESERVED - 1); 128 RANGECHK(V_ipport_lowlastauto, 1, IPPORT_RESERVED - 1); 129 RANGECHK(V_ipport_firstauto, IPPORT_RESERVED, IPPORT_MAX); 130 RANGECHK(V_ipport_lastauto, IPPORT_RESERVED, IPPORT_MAX); --- 1338 unchanged lines hidden (view full) --- 1469 1470void 1471inp_apply_all(void (*func)(struct inpcb *, void *), void *arg) 1472{ 1473 INIT_VNET_INET(curvnet); 1474 struct inpcb *inp; 1475 1476 INP_INFO_RLOCK(&V_tcbinfo); | 124 int error; 125 126 error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); 127 if (error == 0) { 128 RANGECHK(V_ipport_lowfirstauto, 1, IPPORT_RESERVED - 1); 129 RANGECHK(V_ipport_lowlastauto, 1, IPPORT_RESERVED - 1); 130 RANGECHK(V_ipport_firstauto, IPPORT_RESERVED, IPPORT_MAX); 131 RANGECHK(V_ipport_lastauto, IPPORT_RESERVED, IPPORT_MAX); --- 1338 unchanged lines hidden (view full) --- 1470 1471void 1472inp_apply_all(void (*func)(struct inpcb *, void *), void *arg) 1473{ 1474 INIT_VNET_INET(curvnet); 1475 struct inpcb *inp; 1476 1477 INP_INFO_RLOCK(&V_tcbinfo); |
1477 LIST_FOREACH(inp, tcbinfo.ipi_listhead, inp_list) { | 1478 LIST_FOREACH(inp, V_tcbinfo.ipi_listhead, inp_list) { |
1478 INP_WLOCK(inp); 1479 func(inp, arg); 1480 INP_WUNLOCK(inp); 1481 } 1482 INP_INFO_RUNLOCK(&V_tcbinfo); 1483} 1484 1485struct socket * --- 301 unchanged lines hidden --- | 1479 INP_WLOCK(inp); 1480 func(inp, arg); 1481 INP_WUNLOCK(inp); 1482 } 1483 INP_INFO_RUNLOCK(&V_tcbinfo); 1484} 1485 1486struct socket * --- 301 unchanged lines hidden --- |