ip6_input.c (338343) | ip6_input.c (338617) |
---|---|
1/*- 2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 3 * 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 --- 47 unchanged lines hidden (view full) --- 56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 58 * SUCH DAMAGE. 59 * 60 * @(#)ip_input.c 8.2 (Berkeley) 1/4/94 61 */ 62 63#include <sys/cdefs.h> | 1/*- 2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 3 * 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 --- 47 unchanged lines hidden (view full) --- 56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 58 * SUCH DAMAGE. 59 * 60 * @(#)ip_input.c 8.2 (Berkeley) 1/4/94 61 */ 62 63#include <sys/cdefs.h> |
64__FBSDID("$FreeBSD: stable/11/sys/netinet6/ip6_input.c 338343 2018-08-28 07:24:09Z ae $"); | 64__FBSDID("$FreeBSD: stable/11/sys/netinet6/ip6_input.c 338617 2018-09-12 18:52:18Z sobomax $"); |
65 66#include "opt_inet.h" 67#include "opt_inet6.h" 68#include "opt_ipsec.h" 69#include "opt_route.h" 70#include "opt_rss.h" 71 72#include <sys/param.h> --- 1135 unchanged lines hidden (view full) --- 1208struct mbuf ** 1209ip6_savecontrol_v4(struct inpcb *inp, struct mbuf *m, struct mbuf **mp, 1210 int *v4only) 1211{ 1212 struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); 1213 1214#ifdef SO_TIMESTAMP 1215 if ((inp->inp_socket->so_options & SO_TIMESTAMP) != 0) { | 65 66#include "opt_inet.h" 67#include "opt_inet6.h" 68#include "opt_ipsec.h" 69#include "opt_route.h" 70#include "opt_rss.h" 71 72#include <sys/param.h> --- 1135 unchanged lines hidden (view full) --- 1208struct mbuf ** 1209ip6_savecontrol_v4(struct inpcb *inp, struct mbuf *m, struct mbuf **mp, 1210 int *v4only) 1211{ 1212 struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); 1213 1214#ifdef SO_TIMESTAMP 1215 if ((inp->inp_socket->so_options & SO_TIMESTAMP) != 0) { |
1216 struct timeval tv; | 1216 union { 1217 struct timeval tv; 1218 struct bintime bt; 1219 struct timespec ts; 1220 } t; |
1217 | 1221 |
1218 microtime(&tv); 1219 *mp = sbcreatecontrol((caddr_t) &tv, sizeof(tv), 1220 SCM_TIMESTAMP, SOL_SOCKET); 1221 if (*mp) 1222 mp = &(*mp)->m_next; | 1222 switch (inp->inp_socket->so_ts_clock) { 1223 case SO_TS_REALTIME_MICRO: 1224 microtime(&t.tv); 1225 *mp = sbcreatecontrol((caddr_t) &t.tv, sizeof(t.tv), 1226 SCM_TIMESTAMP, SOL_SOCKET); 1227 if (*mp) 1228 mp = &(*mp)->m_next; 1229 break; 1230 1231 case SO_TS_BINTIME: 1232 bintime(&t.bt); 1233 *mp = sbcreatecontrol((caddr_t)&t.bt, sizeof(t.bt), 1234 SCM_BINTIME, SOL_SOCKET); 1235 if (*mp) 1236 mp = &(*mp)->m_next; 1237 break; 1238 1239 case SO_TS_REALTIME: 1240 nanotime(&t.ts); 1241 *mp = sbcreatecontrol((caddr_t)&t.ts, sizeof(t.ts), 1242 SCM_REALTIME, SOL_SOCKET); 1243 if (*mp) 1244 mp = &(*mp)->m_next; 1245 break; 1246 1247 case SO_TS_MONOTONIC: 1248 nanouptime(&t.ts); 1249 *mp = sbcreatecontrol((caddr_t)&t.ts, sizeof(t.ts), 1250 SCM_MONOTONIC, SOL_SOCKET); 1251 if (*mp) 1252 mp = &(*mp)->m_next; 1253 break; 1254 1255 default: 1256 panic("unknown (corrupted) so_ts_clock"); 1257 } |
1223 } 1224#endif 1225 1226#define IS2292(inp, x, y) (((inp)->inp_flags & IN6P_RFC2292) ? (x) : (y)) 1227 /* RFC 2292 sec. 5 */ 1228 if ((inp->inp_flags & IN6P_PKTINFO) != 0) { 1229 struct in6_pktinfo pi6; 1230 --- 543 unchanged lines hidden --- | 1258 } 1259#endif 1260 1261#define IS2292(inp, x, y) (((inp)->inp_flags & IN6P_RFC2292) ? (x) : (y)) 1262 /* RFC 2292 sec. 5 */ 1263 if ((inp->inp_flags & IN6P_PKTINFO) != 0) { 1264 struct in6_pktinfo pi6; 1265 --- 543 unchanged lines hidden --- |