ipv6.c (f6549bd37b927655c6fecad88428a731cd8a4a34) ipv6.c (9e47df005cab63e545671dba8dfd6852fff1c2cf)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/* SCTP kernel implementation
3 * (C) Copyright IBM Corp. 2002, 2004
4 * Copyright (c) 2001 Nokia, Inc.
5 * Copyright (c) 2001 La Monte H.P. Yarroll
6 * Copyright (c) 2002-2003 Intel Corp.
7 *
8 * This file is part of the SCTP kernel implementation

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

183 }
184
185 sctp_v6_err_handle(transport, skb, type, code, ntohl(info));
186 sctp_err_finish(sk, transport);
187
188 return 0;
189}
190
1// SPDX-License-Identifier: GPL-2.0-or-later
2/* SCTP kernel implementation
3 * (C) Copyright IBM Corp. 2002, 2004
4 * Copyright (c) 2001 Nokia, Inc.
5 * Copyright (c) 2001 La Monte H.P. Yarroll
6 * Copyright (c) 2002-2003 Intel Corp.
7 *
8 * This file is part of the SCTP kernel implementation

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

183 }
184
185 sctp_v6_err_handle(transport, skb, type, code, ntohl(info));
186 sctp_err_finish(sk, transport);
187
188 return 0;
189}
190
191int sctp_udp_v6_err(struct sock *sk, struct sk_buff *skb)
192{
193 struct net *net = dev_net(skb->dev);
194 struct sctp_association *asoc;
195 struct sctp_transport *t;
196 struct icmp6hdr *hdr;
197 __u32 info = 0;
198
199 skb->transport_header += sizeof(struct udphdr);
200 sk = sctp_err_lookup(net, AF_INET6, skb, sctp_hdr(skb), &asoc, &t);
201 if (!sk) {
202 __ICMP6_INC_STATS(net, __in6_dev_get(skb->dev), ICMP6_MIB_INERRORS);
203 return -ENOENT;
204 }
205
206 skb->transport_header -= sizeof(struct udphdr);
207 hdr = (struct icmp6hdr *)(skb_network_header(skb) - sizeof(struct icmp6hdr));
208 if (hdr->icmp6_type == NDISC_REDIRECT) {
209 /* can't be handled without outer ip6hdr known, leave it to udpv6_err */
210 sctp_err_finish(sk, t);
211 return 0;
212 }
213 if (hdr->icmp6_type == ICMPV6_PKT_TOOBIG)
214 info = ntohl(hdr->icmp6_mtu);
215 sctp_v6_err_handle(t, skb, hdr->icmp6_type, hdr->icmp6_code, info);
216
217 sctp_err_finish(sk, t);
218 return 1;
219}
220
191static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *t)
192{
193 struct dst_entry *dst = dst_clone(t->dst);
194 struct flowi6 *fl6 = &t->fl.u.ip6;
195 struct sock *sk = skb->sk;
196 struct ipv6_pinfo *np = inet6_sk(sk);
197 __u8 tclass = np->tclass;
198 __be32 label;

--- 983 unchanged lines hidden ---
221static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *t)
222{
223 struct dst_entry *dst = dst_clone(t->dst);
224 struct flowi6 *fl6 = &t->fl.u.ip6;
225 struct sock *sk = skb->sk;
226 struct ipv6_pinfo *np = inet6_sk(sk);
227 __u8 tclass = np->tclass;
228 __be32 label;

--- 983 unchanged lines hidden ---