Deleted Added
full compact
ip_output.c (148903) ip_output.c (149371)
1/*-
2 * Copyright (c) 1982, 1986, 1988, 1990, 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

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

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 * @(#)ip_output.c 8.3 (Berkeley) 1/21/94
1/*-
2 * Copyright (c) 1982, 1986, 1988, 1990, 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

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

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 * @(#)ip_output.c 8.3 (Berkeley) 1/21/94
30 * $FreeBSD: head/sys/netinet/ip_output.c 148903 2005-08-09 17:19:21Z rwatson $
30 * $FreeBSD: head/sys/netinet/ip_output.c 149371 2005-08-22 16:13:08Z andre $
31 */
32
33#include "opt_ipfw.h"
34#include "opt_ipsec.h"
35#include "opt_mac.h"
36#include "opt_mbuf_stress_test.h"
37
38#include <sys/param.h>

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

1184 INP_LOCK(inp);
1185 error = ip_pcbopts(inp, sopt->sopt_name, m);
1186 INP_UNLOCK(inp);
1187 return (error);
1188 }
1189
1190 case IP_TOS:
1191 case IP_TTL:
31 */
32
33#include "opt_ipfw.h"
34#include "opt_ipsec.h"
35#include "opt_mac.h"
36#include "opt_mbuf_stress_test.h"
37
38#include <sys/param.h>

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

1184 INP_LOCK(inp);
1185 error = ip_pcbopts(inp, sopt->sopt_name, m);
1186 INP_UNLOCK(inp);
1187 return (error);
1188 }
1189
1190 case IP_TOS:
1191 case IP_TTL:
1192 case IP_MINTTL:
1192 case IP_RECVOPTS:
1193 case IP_RECVRETOPTS:
1194 case IP_RECVDSTADDR:
1195 case IP_RECVTTL:
1196 case IP_RECVIF:
1197 case IP_FAITH:
1198 case IP_ONESBCAST:
1199 error = sooptcopyin(sopt, &optval, sizeof optval,

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

1204 switch (sopt->sopt_name) {
1205 case IP_TOS:
1206 inp->inp_ip_tos = optval;
1207 break;
1208
1209 case IP_TTL:
1210 inp->inp_ip_ttl = optval;
1211 break;
1193 case IP_RECVOPTS:
1194 case IP_RECVRETOPTS:
1195 case IP_RECVDSTADDR:
1196 case IP_RECVTTL:
1197 case IP_RECVIF:
1198 case IP_FAITH:
1199 case IP_ONESBCAST:
1200 error = sooptcopyin(sopt, &optval, sizeof optval,

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

1205 switch (sopt->sopt_name) {
1206 case IP_TOS:
1207 inp->inp_ip_tos = optval;
1208 break;
1209
1210 case IP_TTL:
1211 inp->inp_ip_ttl = optval;
1212 break;
1213
1214 case IP_MINTTL:
1215 if (optval > 0 && optval <= MAXTTL)
1216 inp->inp_ip_minttl = optval;
1217 else
1218 error = EINVAL;
1219 break;
1220
1212#define OPTSET(bit) do { \
1213 INP_LOCK(inp); \
1214 if (optval) \
1215 inp->inp_flags |= bit; \
1216 else \
1217 inp->inp_flags &= ~bit; \
1218 INP_UNLOCK(inp); \
1219} while (0)

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

1328 char *),
1329 inp->inp_options->m_len);
1330 else
1331 sopt->sopt_valsize = 0;
1332 break;
1333
1334 case IP_TOS:
1335 case IP_TTL:
1221#define OPTSET(bit) do { \
1222 INP_LOCK(inp); \
1223 if (optval) \
1224 inp->inp_flags |= bit; \
1225 else \
1226 inp->inp_flags &= ~bit; \
1227 INP_UNLOCK(inp); \
1228} while (0)

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

1337 char *),
1338 inp->inp_options->m_len);
1339 else
1340 sopt->sopt_valsize = 0;
1341 break;
1342
1343 case IP_TOS:
1344 case IP_TTL:
1345 case IP_MINTTL:
1336 case IP_RECVOPTS:
1337 case IP_RECVRETOPTS:
1338 case IP_RECVDSTADDR:
1339 case IP_RECVTTL:
1340 case IP_RECVIF:
1341 case IP_PORTRANGE:
1342 case IP_FAITH:
1343 case IP_ONESBCAST:
1344 switch (sopt->sopt_name) {
1345
1346 case IP_TOS:
1347 optval = inp->inp_ip_tos;
1348 break;
1349
1350 case IP_TTL:
1351 optval = inp->inp_ip_ttl;
1352 break;
1353
1346 case IP_RECVOPTS:
1347 case IP_RECVRETOPTS:
1348 case IP_RECVDSTADDR:
1349 case IP_RECVTTL:
1350 case IP_RECVIF:
1351 case IP_PORTRANGE:
1352 case IP_FAITH:
1353 case IP_ONESBCAST:
1354 switch (sopt->sopt_name) {
1355
1356 case IP_TOS:
1357 optval = inp->inp_ip_tos;
1358 break;
1359
1360 case IP_TTL:
1361 optval = inp->inp_ip_ttl;
1362 break;
1363
1364 case IP_MINTTL:
1365 optval = inp->inp_ip_minttl;
1366 break;
1367
1354#define OPTBIT(bit) (inp->inp_flags & bit ? 1 : 0)
1355
1356 case IP_RECVOPTS:
1357 optval = OPTBIT(INP_RECVOPTS);
1358 break;
1359
1360 case IP_RECVRETOPTS:
1361 optval = OPTBIT(INP_RECVRETOPTS);

--- 687 unchanged lines hidden ---
1368#define OPTBIT(bit) (inp->inp_flags & bit ? 1 : 0)
1369
1370 case IP_RECVOPTS:
1371 optval = OPTBIT(INP_RECVOPTS);
1372 break;
1373
1374 case IP_RECVRETOPTS:
1375 optval = OPTBIT(INP_RECVRETOPTS);

--- 687 unchanged lines hidden ---