ip6_output.c (102291) | ip6_output.c (105194) |
---|---|
1/* $FreeBSD: head/sys/netinet6/ip6_output.c 102291 2002-08-22 21:24:01Z archie $ */ | 1/* $FreeBSD: head/sys/netinet6/ip6_output.c 105194 2002-10-16 01:54:46Z sam $ */ |
2/* $KAME: ip6_output.c,v 1.279 2002/01/26 06:12:30 jinmei Exp $ */ 3 4/* 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 128 unchanged lines hidden (view full) --- 138 * The mbuf chain containing the packet will be freed. 139 * The mbuf opt, if present, will not be freed. 140 * 141 * type of "mtu": rt_rmx.rmx_mtu is u_long, ifnet.ifr_mtu is int, and 142 * nd_ifinfo.linkmtu is u_int32_t. so we use u_long to hold largest one, 143 * which is rt_rmx.rmx_mtu. 144 */ 145int | 2/* $KAME: ip6_output.c,v 1.279 2002/01/26 06:12:30 jinmei Exp $ */ 3 4/* 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 128 unchanged lines hidden (view full) --- 138 * The mbuf chain containing the packet will be freed. 139 * The mbuf opt, if present, will not be freed. 140 * 141 * type of "mtu": rt_rmx.rmx_mtu is u_long, ifnet.ifr_mtu is int, and 142 * nd_ifinfo.linkmtu is u_int32_t. so we use u_long to hold largest one, 143 * which is rt_rmx.rmx_mtu. 144 */ 145int |
146ip6_output(m0, opt, ro, flags, im6o, ifpp) | 146ip6_output(m0, opt, ro, flags, im6o, ifpp, inp) |
147 struct mbuf *m0; 148 struct ip6_pktopts *opt; 149 struct route_in6 *ro; 150 int flags; 151 struct ip6_moptions *im6o; 152 struct ifnet **ifpp; /* XXX: just for statistics */ | 147 struct mbuf *m0; 148 struct ip6_pktopts *opt; 149 struct route_in6 *ro; 150 int flags; 151 struct ip6_moptions *im6o; 152 struct ifnet **ifpp; /* XXX: just for statistics */ |
153 struct inpcb *inp; |
|
153{ 154 struct ip6_hdr *ip6, *mhip6; 155 struct ifnet *ifp, *origifp; 156 struct mbuf *m = m0; 157 int hlen, tlen, len, off; 158 struct route_in6 ip6route; 159 struct sockaddr_in6 *dst; 160 int error = 0; --- 7 unchanged lines hidden (view full) --- 168 int needipsec = 0; 169#ifdef PFIL_HOOKS 170 struct packet_filter_hook *pfh; 171 struct mbuf *m1; 172 int rv; 173#endif /* PFIL_HOOKS */ 174#ifdef IPSEC 175 int needipsectun = 0; | 154{ 155 struct ip6_hdr *ip6, *mhip6; 156 struct ifnet *ifp, *origifp; 157 struct mbuf *m = m0; 158 int hlen, tlen, len, off; 159 struct route_in6 ip6route; 160 struct sockaddr_in6 *dst; 161 int error = 0; --- 7 unchanged lines hidden (view full) --- 169 int needipsec = 0; 170#ifdef PFIL_HOOKS 171 struct packet_filter_hook *pfh; 172 struct mbuf *m1; 173 int rv; 174#endif /* PFIL_HOOKS */ 175#ifdef IPSEC 176 int needipsectun = 0; |
176 struct socket *so; | |
177 struct secpolicy *sp = NULL; | 177 struct secpolicy *sp = NULL; |
178 struct socket *so = inp ? inp->inp_socket : NULL; |
|
178 | 179 |
179 /* for AH processing. stupid to have "socket" variable in IP layer... */ 180 so = ipsec_getsocket(m); 181 (void)ipsec_setsocket(m, NULL); | |
182 ip6 = mtod(m, struct ip6_hdr *); 183#endif /* IPSEC */ 184 185#define MAKE_EXTHDR(hp, mp) \ 186 do { \ 187 if (hp) { \ 188 struct ip6_ext *eh = (struct ip6_ext *)(hp); \ 189 error = ip6_copyexthdr((mp), (caddr_t)(hp), \ --- 2369 unchanged lines hidden --- | 180 ip6 = mtod(m, struct ip6_hdr *); 181#endif /* IPSEC */ 182 183#define MAKE_EXTHDR(hp, mp) \ 184 do { \ 185 if (hp) { \ 186 struct ip6_ext *eh = (struct ip6_ext *)(hp); \ 187 error = ip6_copyexthdr((mp), (caddr_t)(hp), \ --- 2369 unchanged lines hidden --- |