| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C)2002 USAGI/WIDE Project |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 5 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 6 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 7 | | - * (at your option) any later version. |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 10 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 11 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 12 | | - * GNU General Public License for more details. |
|---|
| 13 | | - * |
|---|
| 14 | | - * You should have received a copy of the GNU General Public License |
|---|
| 15 | | - * along with this program; if not, see <http://www.gnu.org/licenses/>. |
|---|
| 16 | 4 | * |
|---|
| 17 | 5 | * Authors |
|---|
| 18 | 6 | * |
|---|
| .. | .. |
|---|
| 48 | 36 | struct in6_addr saddr; |
|---|
| 49 | 37 | #endif |
|---|
| 50 | 38 | struct in6_addr daddr; |
|---|
| 51 | | - char hdrs[0]; |
|---|
| 39 | + char hdrs[]; |
|---|
| 52 | 40 | }; |
|---|
| 53 | 41 | |
|---|
| 54 | 42 | struct ah_skb_cb { |
|---|
| .. | .. |
|---|
| 271 | 259 | case NEXTHDR_DEST: |
|---|
| 272 | 260 | if (dir == XFRM_POLICY_OUT) |
|---|
| 273 | 261 | ipv6_rearrange_destopt(iph, exthdr.opth); |
|---|
| 274 | | - /* fall through */ |
|---|
| 262 | + fallthrough; |
|---|
| 275 | 263 | case NEXTHDR_HOP: |
|---|
| 276 | 264 | if (!zero_out_mutable_opts(exthdr.opth)) { |
|---|
| 277 | 265 | net_dbg_ratelimited("overrun %sopts\n", |
|---|
| .. | .. |
|---|
| 476 | 464 | struct ah_data *ahp = x->data; |
|---|
| 477 | 465 | struct ip_auth_hdr *ah = ip_auth_hdr(skb); |
|---|
| 478 | 466 | int hdr_len = skb_network_header_len(skb); |
|---|
| 479 | | - int ah_hlen = (ah->hdrlen + 2) << 2; |
|---|
| 467 | + int ah_hlen = ipv6_authlen(ah); |
|---|
| 480 | 468 | |
|---|
| 481 | 469 | if (err) |
|---|
| 482 | 470 | goto out; |
|---|
| .. | .. |
|---|
| 558 | 546 | ahash = ahp->ahash; |
|---|
| 559 | 547 | |
|---|
| 560 | 548 | nexthdr = ah->nexthdr; |
|---|
| 561 | | - ah_hlen = (ah->hdrlen + 2) << 2; |
|---|
| 549 | + ah_hlen = ipv6_authlen(ah); |
|---|
| 562 | 550 | |
|---|
| 563 | 551 | if (ah_hlen != XFRM_ALIGN8(sizeof(*ah) + ahp->icv_full_len) && |
|---|
| 564 | 552 | ah_hlen != XFRM_ALIGN8(sizeof(*ah) + ahp->icv_trunc_len)) |
|---|
| .. | .. |
|---|
| 780 | 768 | |
|---|
| 781 | 769 | static struct xfrm6_protocol ah6_protocol = { |
|---|
| 782 | 770 | .handler = xfrm6_rcv, |
|---|
| 771 | + .input_handler = xfrm_input, |
|---|
| 783 | 772 | .cb_handler = ah6_rcv_cb, |
|---|
| 784 | 773 | .err_handler = ah6_err, |
|---|
| 785 | 774 | .priority = 0, |
|---|
| .. | .. |
|---|
| 806 | 795 | if (xfrm6_protocol_deregister(&ah6_protocol, IPPROTO_AH) < 0) |
|---|
| 807 | 796 | pr_info("%s: can't remove protocol\n", __func__); |
|---|
| 808 | 797 | |
|---|
| 809 | | - if (xfrm_unregister_type(&ah6_type, AF_INET6) < 0) |
|---|
| 810 | | - pr_info("%s: can't remove xfrm type\n", __func__); |
|---|
| 811 | | - |
|---|
| 798 | + xfrm_unregister_type(&ah6_type, AF_INET6); |
|---|
| 812 | 799 | } |
|---|
| 813 | 800 | |
|---|
| 814 | 801 | module_init(ah6_init); |
|---|