From patchwork Sat Jan 21 00:05:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Cernekee X-Patchwork-Id: 9532531 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A21C56042D for ; Mon, 23 Jan 2017 13:29:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D0E3282EC for ; Mon, 23 Jan 2017 13:29:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 815B92831B; Mon, 23 Jan 2017 13:29:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from emsm-gh1-uea10.nsa.gov (smtp.nsa.gov [8.44.101.8]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3476228304 for ; Mon, 23 Jan 2017 13:29:46 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.33,274,1477958400"; d="scan'208";a="3056887" IronPort-PHdr: =?us-ascii?q?9a23=3AxxfNghJHCPV4vUT+9NmcpTZWNBhigK39O0sv0rFi?= =?us-ascii?q?tYgQKfj6rarrMEGX3/hxlliBBdydsKMYzbaH+P24EUU7or+5+EgYd5JNUxJXwe?= =?us-ascii?q?43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQviPgRp?= =?us-ascii?q?OOv1BpTSj8Oq3Oyu5pHfeQtFiT6ybL9oIxi7qQrdu8kKjYB/Nqs/1xzFr2dSde?= =?us-ascii?q?9L321oP1WTnxj95se04pFu9jlbtuwi+cBdT6j0Zrw0QrNEAjsoNWA1/9DrugLY?= =?us-ascii?q?TQST/HscU34ZnQRODgPY8Rz1RJbxsi/9tupgxCmXOND9QL4oVTi+6apgVRHniD?= =?us-ascii?q?0DNzUk7m/ZjMJ+h79frB64uhBz34vYbYeIP/R8Y6zdZ8sXS2pfUMhMWSJPAYSy?= =?us-ascii?q?YIkBD+oZP+tUsofwqFQSohWxGwasH/jiyiNKi3LswaE3yfgtHR/A0Qc9H9wOqn?= =?us-ascii?q?PUrNDtOakXT++10qjIzTPeZP5Ixzj98o7IfQ4iof6SQ717bM3cxlUxGAPfiFWf?= =?us-ascii?q?t4/lMC2L2ekWr2eb7/BgVeWqi24mtgFxpyKjxsA2ionGn48YzE3P+yZhwIstON?= =?us-ascii?q?G1R0F2bcSkHZdNrS2WKYR7Tt04T211oCo21KEKtJqhcCUJyJkr3QPTZviZf4SS?= =?us-ascii?q?/x7uVeKcLDFlj3x/Yr2/nQy98U24x+35Ucm7zUhFozJektnJqnANzxvT6tWbSv?= =?us-ascii?q?dl/keuxzKP1wfL5+FYO080j6vbK4M6wrIqipoSsVjMHi/xmEnsiq+Zal4k9fSy?= =?us-ascii?q?5+TiY7XmooeQN45yig7gLqQjgtGzDOs3PwQUX2WX5P6w2KPs8EHnWrlGk+U6kq?= =?us-ascii?q?zDv5DbIcQbqLS5AwhQ0os78BawETOm0NUenXkaI1NJYQmIj4/0O1HIPP/3E+y/?= =?us-ascii?q?jk+wkDZr2//GPrrhDo/LLnjYirjtZ7l960lCyAYr19BQ+4pUCq0dIPL0QkLxtt?= =?us-ascii?q?vYDhkjPAyow+boEtN925gcWWKIBK+ZNbndsUSU5u0xOemMf5UZuDHnK/gq//Tu?= =?us-ascii?q?l2M2mUcBfam12psacHK4HvZ8LEqFYnrsmdABEWELvgogV+HqhlmCUSNcZnmpQq?= =?us-ascii?q?I84C07CJ+8AYfEXICtj6SL3D2nEZ1OemBGFleMHG/wd4qaQPgDdiSSIs59kjwD?= =?us-ascii?q?TrWhSpEu2g+wuwPgzLpnNOXU8DUCtZ3/zNh1+/HTlRYq+DNpCMSd1WeNQHxqkW?= =?us-ascii?q?MMRj87x7pwrlJnyleEy6R4hOZYFdNL7fNTTgg6LYLcz/B9C93qRw3BYs2GSEy9?= =?us-ascii?q?T9q6BjExS84+zMUVY0ZhAdmiiA7M3zayCb8Pi7OLHIA08r7b33XpJsZ9zWrG27?= =?us-ascii?q?clj1Y4R8tAK3GmhrR/9gXIAI7Ji1uWl6CvdasG3S7N8HyMzW2BvU1CVw5wS6rF?= =?us-ascii?q?V2gFZkTKtdT5+l/CT7i2BLUnMwpBzsiCJ7BPat3tlFlGRfHjNM7YY22rgWewBh?= =?us-ascii?q?eIxq2SY4bwfWUSwjndAlAekw8P5XaGKRQ+BiC5rmPQDTxuEVfvbF328eRlpnO0?= =?us-ascii?q?UFI7zwaQb0J7z7q14BkVhf6CRPwPwrIIoiAhqy97HFylxdLZF8KApxZ9fKVbed?= =?us-ascii?q?497k1H2njftwNhP5ygNLtvhlsGcwR2pk/uzBt2Cp5ancgttnMqwxJ4KbiE31NZ?= =?us-ascii?q?azOYwZfwN6XUKmbo/xCvbLPW10rd0NmM+acP7+k4p0/kvAGzGUoo629n3MVN03?= =?us-ascii?q?uA+pXKCxIfXojsXUYt9hh1uavabzIn6IzI0H1gK660siXN29gxHusq1g6gf8tD?= =?us-ascii?q?MKODDAL9D9cVB8ywJ+wxh1iobhUEMftJ9KEoPsOpaf2G2LKqPOl6hj6mi3pI4J?= =?us-ascii?q?xl2EKW6yV8UvLI34oCw/yA3guISTP8jFOmss3snYBEeC0SHm26ySf+HoJRYbdy?= =?us-ascii?q?fYkTA2e0P8K33sl+h4LqW3NA716jCUkG2MiyeRqOdFH9xgtQ1UMZoHyigyS4yS?= =?us-ascii?q?Z4kzc3oaqDxCbO2fjtdAIbOm5XQ2lvlVntLpKwj9AGQkeodRMpmQC75Unk3ahU?= =?us-ascii?q?v7l/L2zJTUdPZSj2IHloUrGsubqaf85P9JQovD1LUOuhfF+aS6Tyox8B3iz/GG?= =?us-ascii?q?tewSw0eCuxupXlhRB6jnySLGprpnrDZc5w3Qvf5MDbRfNJ2DoGRS14iT3JCVin?= =?us-ascii?q?JNSm58ubl43EsuykUGKhTJJTezHxzYycrCu7+XFqARqnkvCtm93oDRQ60Sjh19?= =?us-ascii?q?VwSSrIrBH8Yo/k16mhNeJnf09oC0Xm68p9AI1+lZEwhJ4I03gAmpqV5WYHkXv0?= =?us-ascii?q?MdhD3aL+bWENRSISz97O/gfl3ExjLnSUx4P2TXid2dNhZ9i8YmMXxi099NpGCK?= =?us-ascii?q?GK47xYhSF1uEa3rRrNYfhhmTcQ0eEu6Hkeg+ENpgUt1DmSArccHERDJizsigiH?= =?us-ascii?q?78ukoKVQfmavfqC61FBiktC5ELGCvgZcVW7hepg4AC9w6t9zP0jW3HLo7YHkfM?= =?us-ascii?q?XQbdUVthCPlhfMk+5VKJUtmfYQgypoJ379t2U/y+EnlRxuwY26vI+fJmVu4q25?= =?us-ascii?q?BAVYOyb2Z8wN/DHtlqBekdiK34y1GZVhADoLVoPyTf20CDISqejnNwGWHT0ksH?= =?us-ascii?q?ibBL7fEhGH6Eh8qXLPD46kN2uMKXkE1tVtWgOdJFdFjAAPWzU6g4Q5GRy0y8zv?= =?us-ascii?q?d0d5/D8R6UDiphtK1O1oKwH1Un3Dqwewdjc0VJ+fIQJI7gFE+kjYKtKe7uRuEC?= =?us-ascii?q?FY5JGhqhKCKnCDbQRSEW4JQlCEB0zkPrS2/dnP6fWYBu6lIvTSYLWOtexfW+6G?= =?us-ascii?q?xZ211Itq5TGMNt+APnN6Ff00xlJDXWxlG8TegzgPSCwWlybTYMOAoRe8/SN3rs?= =?us-ascii?q?6h//T3RALv5YyPC75MPtl1/RC5n7uDPfaKhCllMTZYyo8MxXjQxbgRxlESjT1u?= =?us-ascii?q?dz6oEbkbuy7CUr/fmqhNDxEBcyNzLsxI76Ai0QZRJc7XkNT11qR3jvQtEVdKSU?= =?us-ascii?q?Thmt21ZcwNO2yyKVXHC1yQObubIz3E2dv7YaSmSb1flO9UrQG/uS6HE0//OTSO?= =?us-ascii?q?jyPpWA2yPuxXgyGbORNftJu7chlzFWjpVMjmZQGjMN9rkT02xqU5hmnQOW8SKz?= =?us-ascii?q?R8dllCrrmX7SJYmfhwAXBO7n9/IemDgSaZ4PHSKowKvvtzHiR0i+Va7Ww8y7tP?= =?us-ascii?q?9i5EXOR1lTDcrt5vuVGmifWPyjRmUBpIsDlLgp6EvUR4NqXd7JVAXmzE/B0V52?= =?us-ascii?q?WKFxsKv8dlCsHou61I0dfAj6X/KDND89LP4cscHNLYKNmZP3U9KxbpAyDbDA8E?= =?us-ascii?q?TT6tKGHeiFdQn+2S932Ps5g6sYLgmZQURb9HT1w1EfUaBl5iHNwYL5d9Rikknq?= =?us-ascii?q?KDjM4U+Xq+qwHcS95bvpDIUfKSB+7iJyuHgrZfZhsH27X4IZ4UNo3h1ExockN6?= =?us-ascii?q?k5jSG0rMQdBNpTVsYRU7oEpX7nhxUHY+20X9agyz5n8TEOS7nh8yigRlZuQs+y?= =?us-ascii?q?3g41AtJlrFvCEwilU+mc35gTCNdz78NLuwXYZTCyburUgxNZL6TBhzbQKph0xk?= =?us-ascii?q?MynLR7FKgrR8cmBrjRPTtoFUGf5AV6FEZgEfxe2PbfUyzVtcsjmnxVNA5ebdD5?= =?us-ascii?q?ttihElcZq3onJD3AJjd8I1KrbWJKpSzVhQh7iCvim22eAt2AUePVoC8HuOeC4U?= =?us-ascii?q?v0wFLqMmKDSz/uNy8wOCgSdMeGgXWvUxo/Jq7F4yO+OOzyL4yb5MNECwO/aZL6?= =?us-ascii?q?yHp2jKjdSITU8o1kMUi0lF+qB73to5fEqKVkAg0aCRGg8TOsrYMwFVaMRT9GPN?= =?us-ascii?q?cimSrOXN25N1P5m9F+zyS++BqroUiFq+HAk1B4QM8tgBHp603U7FNsfoMqQKyR?= =?us-ascii?q?o35AvxOlWIF+9JdwiIkDcaucGw1oV73Y1AJjEbG2p9Kzy75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0tPjklZUVrarBEddRSypOVRivDOIJgrou8L9ub4p40?= =?us-ascii?q?EuLmzkqNWNmXOjOLxNGc3/KsacIS4pq10Jl5AxWsag2YYAGdq6OtsR9m9xbufG?= =?us-ascii?q?4WOxjyBBu7tHh5bZ4syN9fXXAHigj6meq7qTwTBV0WU3sk8k5dChLP7O4ceGQ/?= =?us-ascii?q?Oy12YeVy1/oRfOXwapqrzHqFAZIUqL0EPQlYwLONFZ2GM01kDg5OgtWtI87h5e?= =?us-ascii?q?FpraZ/MfuT/zJCb0wUyBbN4tUSmeyTRXFErvEVZkAKg8xH7wvMXRmHfV/F0oQJ?= =?us-ascii?q?Vwd0P5ihFsCoU4KFgi6F4JzSofHwkNbgqbDLKzBUj/K4sLS1QDYwyd3LemYqc3?= =?us-ascii?q?wVFzwrS36e/Xdux8AqoAO+1TjgGQgVdbHYgWvrcGQLJmfF9d9rDYqRT+C4T9WP?= =?us-ascii?q?jmj3UwP+WvQs9G6cAZq2ci4gGnShq785hD8awUiJ+Wea5fepXMp9pz71l96j4A?= =?us-ascii?q?aCNNmwJzjxWnXuAAvOrj+MTUsIK06uayU6YgX+cX9xkxB2llipv/nlAirs/N1+?= =?us-ascii?q?ddTI3Vhp7z8AZTLH6WoIzayQVzKfISK4K3e7Zt73QHJikEKH0UIdWbcOI87DFx?= =?us-ascii?q?MDrN+1NOGMQMZckXPMDVgwBbllXpWK1P9srcAlKXEIZzd9sm7mXtyjA18Ic8Uv?= =?us-ascii?q?765z+rIZDS9E1CP/Regypyjt3CufIVwf3ICCcN+3WZbAJ1wiyawZmXF/nw5fmM?= =?us-ascii?q?yM3TV14eBi45SZtdKyaC+Q2pQeq1jpbpXhqP6sDthJI+dUSQRmG+nakeqqZDC/?= =?us-ascii?q?JAhTn73jlQEYD1nfGVv8Cv6GRJrF1HFph87RnfFKVYJJV7NgzyltO3SUhkGiv/?= =?us-ascii?q?ZMbUewIyuOqM2OgM5/9xN03gaoIAPx0Eyr366XtJTgR0U775pEyZXf8L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ggub/q/4EKtiy7hG4mckufd7QgXHWzrCdkDfw5ei?= =?us-ascii?q?TsdIwj1j53vj0o6cpex2HKdLrIF+RlERCGR5Ic6ZtT1ZWHv1wyOqtgy6ByyaKT?= =?us-ascii?q?kUpjERKn8rbOFwmsx2rhfOPv3M80WdtK8s4B+gBByNB7m51bRACtvu0ASlbG9M?= =?us-ascii?q?azr9RMM+kepEiNtHOfBvXoO5GV2Ua1GmAw=3D=3D?= X-IPAS-Result: =?us-ascii?q?A2GqAwBABIZY/wHyM5BdGgEBAQECAQEBAQgBAQEBFAEBAQE?= =?us-ascii?q?BAQEBAQEBBwEBAQEBgxIBAQEBAR+BaY5NqEsih3RXAQEBAQEBAQECAQJgKIIzG?= =?us-ascii?q?4IcBgECFwEMExQgCwMDCQEBFykICAMBLQMBBQELEQcHCwUYBIhrn2I/jW06JgK?= =?us-ascii?q?KIiYSj0QRAYYAAQSJAIcqiyGRXYouJoYnSJBoMoEUWHM3Kgg6hDYDHIICUoVVg?= =?us-ascii?q?i4BAQE?= Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea10.nsa.gov with ESMTP; 23 Jan 2017 13:29:45 +0000 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus [192.168.25.40]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id v0NDTi39009624; Mon, 23 Jan 2017 08:29:44 -0500 Received: from tarius.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id v0L06Z5I040452 for ; Fri, 20 Jan 2017 19:06:35 -0500 Received: from goalie.tycho.ncsc.mil (goalie [144.51.242.250]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id v0L06RNj009764 for ; Fri, 20 Jan 2017 19:06:35 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1BdAQBMpYJYhqnAVdFeGwEBAQMBAQEJAQEBgz0BAQEBAYIItzWIH1cBAgEBAQEBAhMBAQEICwsKHYUaBhoBDFIQUTQBBQEcBxKJBqJmP41tOop6CQEIlVYFiQCHKYsfkVqKLoZNSJBmMoEUgX8qCDqDagFLAxyCAR01iSkBAQE X-IPAS-Result: A1BdAQBMpYJYhqnAVdFeGwEBAQMBAQEJAQEBgz0BAQEBAYIItzWIH1cBAgEBAQEBAhMBAQEICwsKHYUaBhoBDFIQUTQBBQEcBxKJBqJmP41tOop6CQEIlVYFiQCHKYsfkVqKLoZNSJBmMoEUgX8qCDqDagFLAxyCAR01iSkBAQE X-IronPort-AV: E=Sophos;i="5.33,260,1477972800"; d="scan'208";a="5915763" Received: from emsm-gh1-uea10.corp.nsa.gov (HELO emsm-gh1-uea10.nsa.gov) ([10.208.41.36]) by goalie.tycho.ncsc.mil with ESMTP; 20 Jan 2017 19:06:27 -0500 IronPort-PHdr: =?us-ascii?q?9a23=3AejCESxAk1OcA2Jy2eJbyUyQJP3N1i/DPJgcQr6Af?= =?us-ascii?q?oPdwSPT4pMbcNUDSrc9gkEXOFd2CrakV16yK7+u6BSQp2tWoiDg6aptCVhsI24?= =?us-ascii?q?09vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7?= =?us-ascii?q?Ovr6GpLIj8Swyuu+54Dfbx9GiTe5br5+Nhq7oAreusUIjoZpN7o8xAbOrnZUYe?= =?us-ascii?q?pd2HlmJUiUnxby58ew+IBs/iFNsP8/9MBOTLv3cb0gQbNXEDopPWY15Nb2tRbY?= =?us-ascii?q?VguA+mEcUmQNnRVWBQXO8Qz3UY3wsiv+sep9xTWaMMjrRr06RTiu86FmQwLuhS?= =?us-ascii?q?waNTA27XvXh9RwgqxFvRyvqR9xzYnWb4GbL/dyYr/RcMkGSWdbQspdSypMCZ68?= =?us-ascii?q?YYsVCOoBOP5VoYzjqFsQrBu+AxSnCf3xxT9SgH/5w6463Po/Hgrb2wEvA8wBsG?= =?us-ascii?q?7SrNrrN6cdT/66wbLUwjXDdfNW3jL96InVchAku/2MWqhwccXIxEQpCgjLjU2Q?= =?us-ascii?q?pJT7Mz+J0ukBqWuW4up6We6yj2MrtRt9riWuy8oojITCm5gbxUre9SpjxYY4Pd?= =?us-ascii?q?24R1B/Yd6jCJZQsjuVN4pyQs87W2Fotjo2xqQIuZKmfSUHzI4rxxHYa/yAfIiI?= =?us-ascii?q?5gzsWPyNLjd/gXJpYLO/hxCs/ki80uDwSNW43VJQoidGktTArG0B2hjN5sSdV/?= =?us-ascii?q?dw/0Os1S6K1w/J6+FEJU40lbDcK54k2rM/ioQcsV7FHiDom0X5krGZe14r+uiv?= =?us-ascii?q?7OTnbbHmqYGGO4BojQH+N7wimtajDuQgLggOQ2+b9Pyn1LL9+U35QbNKjuA5k6?= =?us-ascii?q?TCrJDbJdgUpq6+AwNP1IYj8AywAy2p0NQfg3lUZG5CLQmbgobnNleII/TxFuyy?= =?us-ascii?q?mUiEizpg2vbLIvvqBZCJZnjOir3sZ6pV5ElaxA0pi9lH7pRdTLYbL7T6Rwu5uN?= =?us-ascii?q?XGAxoRPwWqzuPjD9thkIUTRSbHGqaENIvKuEKMo+coJPOBIoQSvXK1MPQ+z+L/?= =?us-ascii?q?hn8+31kGdO+m2oVTIH2gF+5nOG2BaGDtmc8FGGwH+A0kQ7/EklqHBB1eeXe0F4?= =?us-ascii?q?kx/Dc2C4+rRdPIS5qrjb+M0Q+wHodRY2FbDxaLC3i+JNbMYOsFdC/HepwpqTcD?= =?us-ascii?q?T7X0E4I=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0HgAQBMpYJYhqnAVdFeGwEBAQMBAQEJA?= =?us-ascii?q?QEBFgEBAQMBAQEJAQEBgxIBAQEBAYIItzWIH1cBAQEBAQEBAQIBAhABAQEICws?= =?us-ascii?q?KHTCCMxmCHgYaAQxSEFE0AQUBHAcSiQaiZj+NbTqKegkBCJVWBYkAhymLH5Fai?= =?us-ascii?q?i6GTUiQZjKBFIIAKgg6g2oBSwMcggEdNYkpAQEB?= X-IPAS-Result: =?us-ascii?q?A0HgAQBMpYJYhqnAVdFeGwEBAQMBAQEJAQEBFgEBAQMBAQE?= =?us-ascii?q?JAQEBgxIBAQEBAYIItzWIH1cBAQEBAQEBAQIBAhABAQEICwsKHTCCMxmCHgYaA?= =?us-ascii?q?QxSEFE0AQUBHAcSiQaiZj+NbTqKegkBCJVWBYkAhymLH5Faii6GTUiQZjKBFII?= =?us-ascii?q?AKgg6g2oBSwMcggEdNYkpAQEB?= X-IronPort-AV: E=Sophos;i="5.33,260,1477958400"; d="scan'208";a="3033691" X-IronPort-Outbreak-Status: No, level 0, Unknown - Unknown Received: from mail-pf0-f169.google.com ([209.85.192.169]) by emsm-gh1-uea10.nsa.gov with ESMTP/TLS/AES128-GCM-SHA256; 21 Jan 2017 00:06:26 +0000 Received: by mail-pf0-f169.google.com with SMTP id 189so25929510pfu.3 for ; Fri, 20 Jan 2017 16:06:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=f8YY+f1CeIoo8WP6Y0ubONU2INzr+sLz0zbMZmiszbE=; b=VJ0a7oLOwWg5t5rUK7K09mkZ2fw1FJ5tIE9bKKDHK/73sznXRTRDhU5+AI9nLPl1qa mcLFxYjc/R//sXgwBmMV4N/NSJ2CN58TM80GnYkeoa5ovH9YOURFsREtyiPe9ot1ndR/ 7+rQBGIGMlh0cZ9PaBUR/pDi7qN0KREP2DSSWurVRaUA1IzLGkJ+ToIOvFGqzs34uHMd G0RN2UU/LgF3Be9rmfOFSdgp5aavo01AGMrw8cGkXV+kTvRsxonZxWXI/RSLz9wQ7sdI PNHpilWyyteYARexorb+uGWjZv6NcMKY2lJhsvEAXJZ+6ZoSJNGsBP2ahAIXeWxkEsNp 5RpA== X-Gm-Message-State: AIkVDXLoHyUh0pRIY/LgQ/wYClcECn7srab7jS2lsvfYwvw8/Q+Iu2mnu4RdsyEnhUSLDDZo X-Received: by 10.84.143.34 with SMTP id 31mr25006348ply.81.1484957185118; Fri, 20 Jan 2017 16:06:25 -0800 (PST) Received: from kcl.mtv.corp.google.com ([172.22.66.15]) by smtp.gmail.com with ESMTPSA id 66sm19375359pfx.29.2017.01.20.16.06.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 20 Jan 2017 16:06:24 -0800 (PST) From: Kevin Cernekee To: steffen.klassert@secunet.com, herbert@gondor.apana.org.au, davem@davemloft.net, paul@paul-moore.com, sds@tycho.nsa.gov, eparis@parisplace.org Subject: [PATCH 1/4] xfrm: Constify xfrm_user arguments and xfrm_mgr callback APIs Date: Fri, 20 Jan 2017 16:05:04 -0800 Message-Id: <20170121000507.34381-2-cernekee@chromium.org> X-Mailer: git-send-email 2.11.0.483.g087da7b7c-goog In-Reply-To: <20170121000507.34381-1-cernekee@chromium.org> References: <20170121000507.34381-1-cernekee@chromium.org> X-Mailman-Approved-At: Mon, 23 Jan 2017 08:28:53 -0500 X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: Cc: netdev@vger.kernel.org, fw@strlen.de, dianders@chromium.org, linux-kernel@vger.kernel.org, selinux@tycho.nsa.gov, fan.du@windriver.com, dtor@chromium.org MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP This provides a better sense of the data flow and inputs/outputs. No change to code size or functionality. Signed-off-by: Kevin Cernekee --- include/net/xfrm.h | 36 ++++-- net/key/af_key.c | 34 +++-- net/xfrm/xfrm_policy.c | 8 +- net/xfrm/xfrm_state.c | 2 +- net/xfrm/xfrm_user.c | 342 +++++++++++++++++++++++++++++-------------------- 5 files changed, 253 insertions(+), 169 deletions(-) diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 31947b9c21d6..34298d78ba45 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -228,7 +228,7 @@ struct xfrm_state { void *data; }; -static inline struct net *xs_net(struct xfrm_state *x) +static inline struct net *xs_net(const struct xfrm_state *x) { return read_pnet(&x->xs_net); } @@ -587,12 +587,23 @@ struct xfrm_migrate { struct xfrm_mgr { struct list_head list; char *id; - int (*notify)(struct xfrm_state *x, const struct km_event *c); - int (*acquire)(struct xfrm_state *x, struct xfrm_tmpl *, struct xfrm_policy *xp); - struct xfrm_policy *(*compile_policy)(struct sock *sk, int opt, u8 *data, int len, int *dir); - int (*new_mapping)(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); - int (*notify_policy)(struct xfrm_policy *x, int dir, const struct km_event *c); - int (*report)(struct net *net, u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr); + int (*notify)(const struct xfrm_state *x, + const struct km_event *c); + int (*acquire)(struct xfrm_state *x, + const struct xfrm_tmpl *, + const struct xfrm_policy *xp); + struct xfrm_policy *(*compile_policy)(struct sock *sk, + int opt, u8 *data, + int len, int *dir); + int (*new_mapping)(struct xfrm_state *x, + const xfrm_address_t *ipaddr, + __be16 sport); + int (*notify_policy)(const struct xfrm_policy *x, + int dir, + const struct km_event *c); + int (*report)(struct net *net, u8 proto, + const struct xfrm_selector *sel, + const xfrm_address_t *addr); int (*migrate)(const struct xfrm_selector *sel, u8 dir, u8 type, const struct xfrm_migrate *m, @@ -1432,7 +1443,7 @@ static inline void xfrm_sysctl_fini(struct net *net) void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto, struct xfrm_address_filter *filter); int xfrm_state_walk(struct net *net, struct xfrm_state_walk *walk, - int (*func)(struct xfrm_state *, int, void*), void *); + int (*func)(const struct xfrm_state *, int, void*), void *); void xfrm_state_walk_done(struct xfrm_state_walk *walk, struct net *net); struct xfrm_state *xfrm_state_alloc(struct net *net); struct xfrm_state *xfrm_state_find(const xfrm_address_t *daddr, @@ -1584,13 +1595,13 @@ struct xfrm_policy *xfrm_policy_alloc(struct net *net, gfp_t gfp); void xfrm_policy_walk_init(struct xfrm_policy_walk *walk, u8 type); int xfrm_policy_walk(struct net *net, struct xfrm_policy_walk *walk, - int (*func)(struct xfrm_policy *, int, int, void*), + int (*func)(const struct xfrm_policy *, int, int, void*), void *); void xfrm_policy_walk_done(struct xfrm_policy_walk *walk, struct net *net); int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u32 mark, u8 type, int dir, - struct xfrm_selector *sel, + const struct xfrm_selector *sel, struct xfrm_sec_ctx *ctx, int delete, int *err); struct xfrm_policy *xfrm_policy_byid(struct net *net, u32 mark, u8, int dir, @@ -1695,7 +1706,7 @@ static inline int xfrm_acquire_is_on(struct net *net) } #endif -static inline int aead_len(struct xfrm_algo_aead *alg) +static inline int aead_len(const struct xfrm_algo_aead *alg) { return sizeof(*alg) + ((alg->alg_key_len + 7) / 8); } @@ -1710,7 +1721,8 @@ static inline int xfrm_alg_auth_len(const struct xfrm_algo_auth *alg) return sizeof(*alg) + ((alg->alg_key_len + 7) / 8); } -static inline int xfrm_replay_state_esn_len(struct xfrm_replay_state_esn *replay_esn) +static inline int xfrm_replay_state_esn_len( + const struct xfrm_replay_state_esn *replay_esn) { return sizeof(*replay_esn) + replay_esn->bmp_len * sizeof(__u32); } diff --git a/net/key/af_key.c b/net/key/af_key.c index c6252ed42c1d..b09a48c4c1fb 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c @@ -1433,7 +1433,7 @@ static inline int event2keytype(int event) } /* ADD/UPD/DEL */ -static int key_notify_sa(struct xfrm_state *x, const struct km_event *c) +static int key_notify_sa(const struct xfrm_state *x, const struct km_event *c) { struct sk_buff *skb; struct sadb_msg *hdr; @@ -1744,7 +1744,7 @@ static int pfkey_flush(struct sock *sk, struct sk_buff *skb, const struct sadb_m return 0; } -static int dump_sa(struct xfrm_state *x, int count, void *ptr) +static int dump_sa(const struct xfrm_state *x, int count, void *ptr) { struct pfkey_sock *pfk = ptr; struct sk_buff *out_skb; @@ -1851,7 +1851,8 @@ static int pfkey_promisc(struct sock *sk, struct sk_buff *skb, const struct sadb return 0; } -static int check_reqid(struct xfrm_policy *xp, int dir, int count, void *ptr) +static int check_reqid(const struct xfrm_policy *xp, int dir, int count, + void *ptr) { int i; u32 reqid = *(u32*)ptr; @@ -2157,7 +2158,9 @@ static int pfkey_xfrm_policy2msg(struct sk_buff *skb, const struct xfrm_policy * return 0; } -static int key_notify_policy(struct xfrm_policy *xp, int dir, const struct km_event *c) +static int key_notify_policy(const struct xfrm_policy *xp, + int dir, + const struct km_event *c) { struct sk_buff *out_skb; struct sadb_msg *out_hdr; @@ -2628,7 +2631,7 @@ static int pfkey_spdget(struct sock *sk, struct sk_buff *skb, const struct sadb_ return err; } -static int dump_sp(struct xfrm_policy *xp, int dir, int count, void *ptr) +static int dump_sp(const struct xfrm_policy *xp, int dir, int count, void *ptr) { struct pfkey_sock *pfk = ptr; struct sk_buff *out_skb; @@ -2961,12 +2964,14 @@ static void dump_esp_combs(struct sk_buff *skb, const struct xfrm_tmpl *t) } } -static int key_notify_policy_expire(struct xfrm_policy *xp, const struct km_event *c) +static int key_notify_policy_expire(const struct xfrm_policy *xp, + const struct km_event *c) { return 0; } -static int key_notify_sa_expire(struct xfrm_state *x, const struct km_event *c) +static int key_notify_sa_expire(const struct xfrm_state *x, + const struct km_event *c) { struct sk_buff *out_skb; struct sadb_msg *out_hdr; @@ -2996,7 +3001,8 @@ static int key_notify_sa_expire(struct xfrm_state *x, const struct km_event *c) return 0; } -static int pfkey_send_notify(struct xfrm_state *x, const struct km_event *c) +static int pfkey_send_notify(const struct xfrm_state *x, + const struct km_event *c) { struct net *net = x ? xs_net(x) : c->net; struct netns_pfkey *net_pfkey = net_generic(net, pfkey_net_id); @@ -3023,7 +3029,9 @@ static int pfkey_send_notify(struct xfrm_state *x, const struct km_event *c) return 0; } -static int pfkey_send_policy_notify(struct xfrm_policy *xp, int dir, const struct km_event *c) +static int pfkey_send_policy_notify(const struct xfrm_policy *xp, + int dir, + const struct km_event *c) { if (xp && xp->type != XFRM_POLICY_TYPE_MAIN) return 0; @@ -3076,7 +3084,9 @@ static bool pfkey_is_alive(const struct km_event *c) return is_alive; } -static int pfkey_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *xp) +static int pfkey_send_acquire(struct xfrm_state *x, + const struct xfrm_tmpl *t, + const struct xfrm_policy *xp) { struct sk_buff *skb; struct sadb_msg *hdr; @@ -3273,7 +3283,9 @@ static struct xfrm_policy *pfkey_compile_policy(struct sock *sk, int opt, return NULL; } -static int pfkey_send_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport) +static int pfkey_send_new_mapping(struct xfrm_state *x, + const xfrm_address_t *ipaddr, + __be16 sport) { struct sk_buff *skb; struct sadb_msg *hdr; diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 177e208e8ff5..dc51dec54043 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -709,7 +709,8 @@ static u32 xfrm_gen_index(struct net *net, int dir, u32 index) } } -static inline int selector_cmp(struct xfrm_selector *s1, struct xfrm_selector *s2) +static inline int selector_cmp(const struct xfrm_selector *s1, + const struct xfrm_selector *s2) { u32 *p1 = (u32 *) s1; u32 *p2 = (u32 *) s2; @@ -833,7 +834,8 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl) EXPORT_SYMBOL(xfrm_policy_insert); struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u32 mark, u8 type, - int dir, struct xfrm_selector *sel, + int dir, + const struct xfrm_selector *sel, struct xfrm_sec_ctx *ctx, int delete, int *err) { @@ -1016,7 +1018,7 @@ int xfrm_policy_flush(struct net *net, u8 type, bool task_valid) EXPORT_SYMBOL(xfrm_policy_flush); int xfrm_policy_walk(struct net *net, struct xfrm_policy_walk *walk, - int (*func)(struct xfrm_policy *, int, int, void*), + int (*func)(const struct xfrm_policy *, int, int, void*), void *data) { struct xfrm_policy *pol; diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 64e3c82eedf6..4513a621b0d5 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -1642,7 +1642,7 @@ static bool __xfrm_state_filter_match(struct xfrm_state *x, } int xfrm_state_walk(struct net *net, struct xfrm_state_walk *walk, - int (*func)(struct xfrm_state *, int, void*), + int (*func)(const struct xfrm_state *, int, void*), void *data) { struct xfrm_state *state; diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 9705c279494b..ed389aad4994 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c @@ -115,7 +115,7 @@ static inline int verify_sec_ctx_len(struct nlattr **attrs) return 0; } -static inline int verify_replay(struct xfrm_usersa_info *p, +static inline int verify_replay(const struct xfrm_usersa_info *p, struct nlattr **attrs) { struct nlattr *rt = attrs[XFRMA_REPLAY_ESN_VAL]; @@ -148,7 +148,7 @@ static inline int verify_replay(struct xfrm_usersa_info *p, return 0; } -static int verify_newsa_info(struct xfrm_usersa_info *p, +static int verify_newsa_info(const struct xfrm_usersa_info *p, struct nlattr **attrs) { int err; @@ -264,11 +264,14 @@ static int verify_newsa_info(struct xfrm_usersa_info *p, return err; } -static int attach_one_algo(struct xfrm_algo **algpp, u8 *props, - struct xfrm_algo_desc *(*get_byname)(const char *, int), - struct nlattr *rta) +static int attach_one_algo( + struct xfrm_algo **algpp, + u8 *props, + struct xfrm_algo_desc *(*get_byname)(const char *, int), + const struct nlattr *rta) { - struct xfrm_algo *p, *ualg; + const struct xfrm_algo *ualg; + struct xfrm_algo *p; struct xfrm_algo_desc *algo; if (!rta) @@ -290,9 +293,10 @@ static int attach_one_algo(struct xfrm_algo **algpp, u8 *props, return 0; } -static int attach_crypt(struct xfrm_state *x, struct nlattr *rta) +static int attach_crypt(struct xfrm_state *x, const struct nlattr *rta) { - struct xfrm_algo *p, *ualg; + const struct xfrm_algo *ualg; + struct xfrm_algo *p; struct xfrm_algo_desc *algo; if (!rta) @@ -316,9 +320,9 @@ static int attach_crypt(struct xfrm_state *x, struct nlattr *rta) } static int attach_auth(struct xfrm_algo_auth **algpp, u8 *props, - struct nlattr *rta) + const struct nlattr *rta) { - struct xfrm_algo *ualg; + const struct xfrm_algo *ualg; struct xfrm_algo_auth *p; struct xfrm_algo_desc *algo; @@ -346,9 +350,10 @@ static int attach_auth(struct xfrm_algo_auth **algpp, u8 *props, } static int attach_auth_trunc(struct xfrm_algo_auth **algpp, u8 *props, - struct nlattr *rta) + const struct nlattr *rta) { - struct xfrm_algo_auth *p, *ualg; + const struct xfrm_algo_auth *ualg; + struct xfrm_algo_auth *p; struct xfrm_algo_desc *algo; if (!rta) @@ -375,9 +380,10 @@ static int attach_auth_trunc(struct xfrm_algo_auth **algpp, u8 *props, return 0; } -static int attach_aead(struct xfrm_state *x, struct nlattr *rta) +static int attach_aead(struct xfrm_state *x, const struct nlattr *rta) { - struct xfrm_algo_aead *p, *ualg; + const struct xfrm_algo_aead *ualg; + struct xfrm_algo_aead *p; struct xfrm_algo_desc *algo; if (!rta) @@ -400,10 +406,11 @@ static int attach_aead(struct xfrm_state *x, struct nlattr *rta) return 0; } -static inline int xfrm_replay_verify_len(struct xfrm_replay_state_esn *replay_esn, - struct nlattr *rp) +static inline int xfrm_replay_verify_len( + const struct xfrm_replay_state_esn *replay_esn, + const struct nlattr *rp) { - struct xfrm_replay_state_esn *up; + const struct xfrm_replay_state_esn *up; int ulen; if (!replay_esn || !rp) @@ -418,11 +425,13 @@ static inline int xfrm_replay_verify_len(struct xfrm_replay_state_esn *replay_es return 0; } -static int xfrm_alloc_replay_state_esn(struct xfrm_replay_state_esn **replay_esn, - struct xfrm_replay_state_esn **preplay_esn, - struct nlattr *rta) +static int xfrm_alloc_replay_state_esn( + struct xfrm_replay_state_esn **replay_esn, + struct xfrm_replay_state_esn **preplay_esn, + const struct nlattr *rta) { - struct xfrm_replay_state_esn *p, *pp, *up; + struct xfrm_replay_state_esn *p, *pp; + const struct xfrm_replay_state_esn *up; int klen, ulen; if (!rta) @@ -451,7 +460,7 @@ static int xfrm_alloc_replay_state_esn(struct xfrm_replay_state_esn **replay_esn return 0; } -static inline int xfrm_user_sec_ctx_size(struct xfrm_sec_ctx *xfrm_ctx) +static inline int xfrm_user_sec_ctx_size(const struct xfrm_sec_ctx *xfrm_ctx) { int len = 0; @@ -462,7 +471,8 @@ static inline int xfrm_user_sec_ctx_size(struct xfrm_sec_ctx *xfrm_ctx) return len; } -static void copy_from_user_state(struct xfrm_state *x, struct xfrm_usersa_info *p) +static void copy_from_user_state(struct xfrm_state *x, + const struct xfrm_usersa_info *p) { memcpy(&x->id, &p->id, sizeof(x->id)); memcpy(&x->sel, &p->sel, sizeof(x->sel)); @@ -484,17 +494,19 @@ static void copy_from_user_state(struct xfrm_state *x, struct xfrm_usersa_info * * somehow made shareable and move it to xfrm_state.c - JHS * */ -static void xfrm_update_ae_params(struct xfrm_state *x, struct nlattr **attrs, +static void xfrm_update_ae_params(struct xfrm_state *x, + struct nlattr **attrs, int update_esn) { - struct nlattr *rp = attrs[XFRMA_REPLAY_VAL]; - struct nlattr *re = update_esn ? attrs[XFRMA_REPLAY_ESN_VAL] : NULL; - struct nlattr *lt = attrs[XFRMA_LTIME_VAL]; - struct nlattr *et = attrs[XFRMA_ETIMER_THRESH]; - struct nlattr *rt = attrs[XFRMA_REPLAY_THRESH]; + const struct nlattr *rp = attrs[XFRMA_REPLAY_VAL]; + const struct nlattr *re = + update_esn ? attrs[XFRMA_REPLAY_ESN_VAL] : NULL; + const struct nlattr *lt = attrs[XFRMA_LTIME_VAL]; + const struct nlattr *et = attrs[XFRMA_ETIMER_THRESH]; + const struct nlattr *rt = attrs[XFRMA_REPLAY_THRESH]; if (re) { - struct xfrm_replay_state_esn *replay_esn; + const struct xfrm_replay_state_esn *replay_esn; replay_esn = nla_data(re); memcpy(x->replay_esn, replay_esn, xfrm_replay_state_esn_len(replay_esn)); @@ -503,14 +515,14 @@ static void xfrm_update_ae_params(struct xfrm_state *x, struct nlattr **attrs, } if (rp) { - struct xfrm_replay_state *replay; + const struct xfrm_replay_state *replay; replay = nla_data(rp); memcpy(&x->replay, replay, sizeof(*replay)); memcpy(&x->preplay, replay, sizeof(*replay)); } if (lt) { - struct xfrm_lifetime_cur *ltime; + const struct xfrm_lifetime_cur *ltime; ltime = nla_data(lt); x->curlft.bytes = ltime->bytes; x->curlft.packets = ltime->packets; @@ -526,7 +538,7 @@ static void xfrm_update_ae_params(struct xfrm_state *x, struct nlattr **attrs, } static struct xfrm_state *xfrm_state_construct(struct net *net, - struct xfrm_usersa_info *p, + const struct xfrm_usersa_info *p, struct nlattr **attrs, int *errp) { @@ -613,11 +625,11 @@ static struct xfrm_state *xfrm_state_construct(struct net *net, return NULL; } -static int xfrm_add_sa(struct sk_buff *skb, struct nlmsghdr *nlh, - struct nlattr **attrs) +static int xfrm_add_sa(struct sk_buff *skb, const struct nlmsghdr *nlh, + struct nlattr **attrs) { struct net *net = sock_net(skb->sk); - struct xfrm_usersa_info *p = nlmsg_data(nlh); + const struct xfrm_usersa_info *p = nlmsg_data(nlh); struct xfrm_state *x; int err; struct km_event c; @@ -655,7 +667,7 @@ static int xfrm_add_sa(struct sk_buff *skb, struct nlmsghdr *nlh, } static struct xfrm_state *xfrm_user_state_lookup(struct net *net, - struct xfrm_usersa_id *p, + const struct xfrm_usersa_id *p, struct nlattr **attrs, int *errp) { @@ -688,14 +700,14 @@ static struct xfrm_state *xfrm_user_state_lookup(struct net *net, return x; } -static int xfrm_del_sa(struct sk_buff *skb, struct nlmsghdr *nlh, - struct nlattr **attrs) +static int xfrm_del_sa(struct sk_buff *skb, const struct nlmsghdr *nlh, + struct nlattr **attrs) { struct net *net = sock_net(skb->sk); struct xfrm_state *x; int err = -ESRCH; struct km_event c; - struct xfrm_usersa_id *p = nlmsg_data(nlh); + const struct xfrm_usersa_id *p = nlmsg_data(nlh); x = xfrm_user_state_lookup(net, p, attrs, &err); if (x == NULL) @@ -725,7 +737,8 @@ static int xfrm_del_sa(struct sk_buff *skb, struct nlmsghdr *nlh, return err; } -static void copy_to_user_state(struct xfrm_state *x, struct xfrm_usersa_info *p) +static void copy_to_user_state(const struct xfrm_state *x, + struct xfrm_usersa_info *p) { memset(p, 0, sizeof(*p)); memcpy(&p->id, &x->id, sizeof(p->id)); @@ -751,7 +764,7 @@ struct xfrm_dump_info { u16 nlmsg_flags; }; -static int copy_sec_ctx(struct xfrm_sec_ctx *s, struct sk_buff *skb) +static int copy_sec_ctx(const struct xfrm_sec_ctx *s, struct sk_buff *skb) { struct xfrm_user_sec_ctx *uctx; struct nlattr *attr; @@ -772,7 +785,8 @@ static int copy_sec_ctx(struct xfrm_sec_ctx *s, struct sk_buff *skb) return 0; } -static int copy_to_user_auth(struct xfrm_algo_auth *auth, struct sk_buff *skb) +static int copy_to_user_auth(const struct xfrm_algo_auth *auth, + struct sk_buff *skb) { struct xfrm_algo *algo; struct nlattr *nla; @@ -791,7 +805,7 @@ static int copy_to_user_auth(struct xfrm_algo_auth *auth, struct sk_buff *skb) } /* Don't change this without updating xfrm_sa_len! */ -static int copy_to_user_state_extra(struct xfrm_state *x, +static int copy_to_user_state_extra(const struct xfrm_state *x, struct xfrm_usersa_info *p, struct sk_buff *skb) { @@ -868,7 +882,7 @@ static int copy_to_user_state_extra(struct xfrm_state *x, return ret; } -static int dump_one_state(struct xfrm_state *x, int count, void *ptr) +static int dump_one_state(const struct xfrm_state *x, int count, void *ptr) { struct xfrm_dump_info *sp = ptr; struct sk_buff *in_skb = sp->in_skb; @@ -950,7 +964,8 @@ static int xfrm_dump_sa(struct sk_buff *skb, struct netlink_callback *cb) } static struct sk_buff *xfrm_state_netlink(struct sk_buff *in_skb, - struct xfrm_state *x, u32 seq) + const struct xfrm_state *x, + u32 seq) { struct xfrm_dump_info info; struct sk_buff *skb; @@ -1050,7 +1065,7 @@ static int build_spdinfo(struct sk_buff *skb, struct net *net, return 0; } -static int xfrm_set_spdinfo(struct sk_buff *skb, struct nlmsghdr *nlh, +static int xfrm_set_spdinfo(struct sk_buff *skb, const struct nlmsghdr *nlh, struct nlattr **attrs) { struct net *net = sock_net(skb->sk); @@ -1095,12 +1110,12 @@ static int xfrm_set_spdinfo(struct sk_buff *skb, struct nlmsghdr *nlh, return 0; } -static int xfrm_get_spdinfo(struct sk_buff *skb, struct nlmsghdr *nlh, - struct nlattr **attrs) +static int xfrm_get_spdinfo(struct sk_buff *skb, const struct nlmsghdr *nlh, + struct nlattr **attrs) { struct net *net = sock_net(skb->sk); struct sk_buff *r_skb; - u32 *flags = nlmsg_data(nlh); + const u32 *flags = nlmsg_data(nlh); u32 sportid = NETLINK_CB(skb).portid; u32 seq = nlh->nlmsg_seq; @@ -1153,12 +1168,12 @@ static int build_sadinfo(struct sk_buff *skb, struct net *net, return 0; } -static int xfrm_get_sadinfo(struct sk_buff *skb, struct nlmsghdr *nlh, - struct nlattr **attrs) +static int xfrm_get_sadinfo(struct sk_buff *skb, const struct nlmsghdr *nlh, + struct nlattr **attrs) { struct net *net = sock_net(skb->sk); struct sk_buff *r_skb; - u32 *flags = nlmsg_data(nlh); + const u32 *flags = nlmsg_data(nlh); u32 sportid = NETLINK_CB(skb).portid; u32 seq = nlh->nlmsg_seq; @@ -1172,11 +1187,11 @@ static int xfrm_get_sadinfo(struct sk_buff *skb, struct nlmsghdr *nlh, return nlmsg_unicast(net->xfrm.nlsk, r_skb, sportid); } -static int xfrm_get_sa(struct sk_buff *skb, struct nlmsghdr *nlh, - struct nlattr **attrs) +static int xfrm_get_sa(struct sk_buff *skb, const struct nlmsghdr *nlh, + struct nlattr **attrs) { struct net *net = sock_net(skb->sk); - struct xfrm_usersa_id *p = nlmsg_data(nlh); + const struct xfrm_usersa_id *p = nlmsg_data(nlh); struct xfrm_state *x; struct sk_buff *resp_skb; int err = -ESRCH; @@ -1196,14 +1211,14 @@ static int xfrm_get_sa(struct sk_buff *skb, struct nlmsghdr *nlh, return err; } -static int xfrm_alloc_userspi(struct sk_buff *skb, struct nlmsghdr *nlh, - struct nlattr **attrs) +static int xfrm_alloc_userspi(struct sk_buff *skb, const struct nlmsghdr *nlh, + struct nlattr **attrs) { struct net *net = sock_net(skb->sk); struct xfrm_state *x; - struct xfrm_userspi_info *p; + const struct xfrm_userspi_info *p; struct sk_buff *resp_skb; - xfrm_address_t *daddr; + const xfrm_address_t *daddr; int family; int err; u32 mark; @@ -1286,7 +1301,7 @@ static int verify_policy_type(u8 type) return 0; } -static int verify_newpolicy_info(struct xfrm_userpolicy_info *p) +static int verify_newpolicy_info(const struct xfrm_userpolicy_info *p) { int ret; @@ -1346,7 +1361,8 @@ static int copy_from_user_sec_ctx(struct xfrm_policy *pol, struct nlattr **attrs return security_xfrm_policy_alloc(&pol->security, uctx, GFP_KERNEL); } -static void copy_templates(struct xfrm_policy *xp, struct xfrm_user_tmpl *ut, +static void copy_templates(struct xfrm_policy *xp, + const struct xfrm_user_tmpl *ut, int nr) { int i; @@ -1444,7 +1460,8 @@ static int copy_from_user_policy_type(u8 *tp, struct nlattr **attrs) return 0; } -static void copy_from_user_policy(struct xfrm_policy *xp, struct xfrm_userpolicy_info *p) +static void copy_from_user_policy(struct xfrm_policy *xp, + const struct xfrm_userpolicy_info *p) { xp->priority = p->priority; xp->index = p->index; @@ -1456,7 +1473,9 @@ static void copy_from_user_policy(struct xfrm_policy *xp, struct xfrm_userpolicy /* XXX xp->share = p->share; */ } -static void copy_to_user_policy(struct xfrm_policy *xp, struct xfrm_userpolicy_info *p, int dir) +static void copy_to_user_policy(const struct xfrm_policy *xp, + struct xfrm_userpolicy_info *p, + int dir) { memset(p, 0, sizeof(*p)); memcpy(&p->sel, &xp->selector, sizeof(p->sel)); @@ -1471,7 +1490,11 @@ static void copy_to_user_policy(struct xfrm_policy *xp, struct xfrm_userpolicy_i p->share = XFRM_SHARE_ANY; /* XXX xp->share */ } -static struct xfrm_policy *xfrm_policy_construct(struct net *net, struct xfrm_userpolicy_info *p, struct nlattr **attrs, int *errp) +static struct xfrm_policy *xfrm_policy_construct( + struct net *net, + const struct xfrm_userpolicy_info *p, + struct nlattr **attrs, + int *errp) { struct xfrm_policy *xp = xfrm_policy_alloc(net, GFP_KERNEL); int err; @@ -1502,11 +1525,11 @@ static struct xfrm_policy *xfrm_policy_construct(struct net *net, struct xfrm_us return NULL; } -static int xfrm_add_policy(struct sk_buff *skb, struct nlmsghdr *nlh, - struct nlattr **attrs) +static int xfrm_add_policy(struct sk_buff *skb, const struct nlmsghdr *nlh, + struct nlattr **attrs) { struct net *net = sock_net(skb->sk); - struct xfrm_userpolicy_info *p = nlmsg_data(nlh); + const struct xfrm_userpolicy_info *p = nlmsg_data(nlh); struct xfrm_policy *xp; struct km_event c; int err; @@ -1547,7 +1570,7 @@ static int xfrm_add_policy(struct sk_buff *skb, struct nlmsghdr *nlh, return 0; } -static int copy_to_user_tmpl(struct xfrm_policy *xp, struct sk_buff *skb) +static int copy_to_user_tmpl(const struct xfrm_policy *xp, struct sk_buff *skb) { struct xfrm_user_tmpl vec[XFRM_MAX_DEPTH]; int i; @@ -1557,7 +1580,7 @@ static int copy_to_user_tmpl(struct xfrm_policy *xp, struct sk_buff *skb) for (i = 0; i < xp->xfrm_nr; i++) { struct xfrm_user_tmpl *up = &vec[i]; - struct xfrm_tmpl *kp = &xp->xfrm_vec[i]; + const struct xfrm_tmpl *kp = &xp->xfrm_vec[i]; memset(up, 0, sizeof(*up)); memcpy(&up->id, &kp->id, sizeof(up->id)); @@ -1576,7 +1599,8 @@ static int copy_to_user_tmpl(struct xfrm_policy *xp, struct sk_buff *skb) sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr, vec); } -static inline int copy_to_user_state_sec_ctx(struct xfrm_state *x, struct sk_buff *skb) +static inline int copy_to_user_state_sec_ctx(const struct xfrm_state *x, + struct sk_buff *skb) { if (x->security) { return copy_sec_ctx(x->security, skb); @@ -1584,7 +1608,8 @@ static inline int copy_to_user_state_sec_ctx(struct xfrm_state *x, struct sk_buf return 0; } -static inline int copy_to_user_sec_ctx(struct xfrm_policy *xp, struct sk_buff *skb) +static inline int copy_to_user_sec_ctx(const struct xfrm_policy *xp, + struct sk_buff *skb) { if (xp->security) return copy_sec_ctx(xp->security, skb); @@ -1616,7 +1641,10 @@ static inline int copy_to_user_policy_type(u8 type, struct sk_buff *skb) } #endif -static int dump_one_policy(struct xfrm_policy *xp, int dir, int count, void *ptr) +static int dump_one_policy(const struct xfrm_policy *xp, + int dir, + int count, + void *ptr) { struct xfrm_dump_info *sp = ptr; struct xfrm_userpolicy_info *p; @@ -1681,8 +1709,9 @@ static int xfrm_dump_policy(struct sk_buff *skb, struct netlink_callback *cb) } static struct sk_buff *xfrm_policy_netlink(struct sk_buff *in_skb, - struct xfrm_policy *xp, - int dir, u32 seq) + const struct xfrm_policy *xp, + int dir, + u32 seq) { struct xfrm_dump_info info; struct sk_buff *skb; @@ -1706,12 +1735,12 @@ static struct sk_buff *xfrm_policy_netlink(struct sk_buff *in_skb, return skb; } -static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh, - struct nlattr **attrs) +static int xfrm_get_policy(struct sk_buff *skb, const struct nlmsghdr *nlh, + struct nlattr **attrs) { struct net *net = sock_net(skb->sk); struct xfrm_policy *xp; - struct xfrm_userpolicy_id *p; + const struct xfrm_userpolicy_id *p; u8 type = XFRM_POLICY_TYPE_MAIN; int err; struct km_event c; @@ -1785,12 +1814,12 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh, return err; } -static int xfrm_flush_sa(struct sk_buff *skb, struct nlmsghdr *nlh, - struct nlattr **attrs) +static int xfrm_flush_sa(struct sk_buff *skb, const struct nlmsghdr *nlh, + struct nlattr **attrs) { struct net *net = sock_net(skb->sk); struct km_event c; - struct xfrm_usersa_flush *p = nlmsg_data(nlh); + const struct xfrm_usersa_flush *p = nlmsg_data(nlh); int err; err = xfrm_state_flush(net, p->proto, true); @@ -1809,7 +1838,7 @@ static int xfrm_flush_sa(struct sk_buff *skb, struct nlmsghdr *nlh, return 0; } -static inline size_t xfrm_aevent_msgsize(struct xfrm_state *x) +static inline size_t xfrm_aevent_msgsize(const struct xfrm_state *x) { size_t replay_size = x->replay_esn ? xfrm_replay_state_esn_len(x->replay_esn) : @@ -1823,7 +1852,9 @@ static inline size_t xfrm_aevent_msgsize(struct xfrm_state *x) + nla_total_size(4); /* XFRM_AE_ETHR */ } -static int build_aevent(struct sk_buff *skb, struct xfrm_state *x, const struct km_event *c) +static int build_aevent(struct sk_buff *skb, + const struct xfrm_state *x, + const struct km_event *c) { struct xfrm_aevent_id *id; struct nlmsghdr *nlh; @@ -1880,8 +1911,8 @@ static int build_aevent(struct sk_buff *skb, struct xfrm_state *x, const struct return err; } -static int xfrm_get_ae(struct sk_buff *skb, struct nlmsghdr *nlh, - struct nlattr **attrs) +static int xfrm_get_ae(struct sk_buff *skb, const struct nlmsghdr *nlh, + struct nlattr **attrs) { struct net *net = sock_net(skb->sk); struct xfrm_state *x; @@ -1890,8 +1921,8 @@ static int xfrm_get_ae(struct sk_buff *skb, struct nlmsghdr *nlh, struct km_event c; u32 mark; struct xfrm_mark m; - struct xfrm_aevent_id *p = nlmsg_data(nlh); - struct xfrm_usersa_id *id = &p->sa_id; + const struct xfrm_aevent_id *p = nlmsg_data(nlh); + const struct xfrm_usersa_id *id = &p->sa_id; mark = xfrm_mark_get(attrs, &m); @@ -1923,8 +1954,8 @@ static int xfrm_get_ae(struct sk_buff *skb, struct nlmsghdr *nlh, return err; } -static int xfrm_new_ae(struct sk_buff *skb, struct nlmsghdr *nlh, - struct nlattr **attrs) +static int xfrm_new_ae(struct sk_buff *skb, const struct nlmsghdr *nlh, + struct nlattr **attrs) { struct net *net = sock_net(skb->sk); struct xfrm_state *x; @@ -1932,12 +1963,12 @@ static int xfrm_new_ae(struct sk_buff *skb, struct nlmsghdr *nlh, int err = -EINVAL; u32 mark = 0; struct xfrm_mark m; - struct xfrm_aevent_id *p = nlmsg_data(nlh); - struct nlattr *rp = attrs[XFRMA_REPLAY_VAL]; - struct nlattr *re = attrs[XFRMA_REPLAY_ESN_VAL]; - struct nlattr *lt = attrs[XFRMA_LTIME_VAL]; - struct nlattr *et = attrs[XFRMA_ETIMER_THRESH]; - struct nlattr *rt = attrs[XFRMA_REPLAY_THRESH]; + const struct xfrm_aevent_id *p = nlmsg_data(nlh); + const struct nlattr *rp = attrs[XFRMA_REPLAY_VAL]; + const struct nlattr *re = attrs[XFRMA_REPLAY_ESN_VAL]; + const struct nlattr *lt = attrs[XFRMA_LTIME_VAL]; + const struct nlattr *et = attrs[XFRMA_ETIMER_THRESH]; + const struct nlattr *rt = attrs[XFRMA_REPLAY_THRESH]; if (!lt && !rp && !re && !et && !rt) return err; @@ -1974,8 +2005,8 @@ static int xfrm_new_ae(struct sk_buff *skb, struct nlmsghdr *nlh, return err; } -static int xfrm_flush_policy(struct sk_buff *skb, struct nlmsghdr *nlh, - struct nlattr **attrs) +static int xfrm_flush_policy(struct sk_buff *skb, const struct nlmsghdr *nlh, + struct nlattr **attrs) { struct net *net = sock_net(skb->sk); struct km_event c; @@ -2002,13 +2033,13 @@ static int xfrm_flush_policy(struct sk_buff *skb, struct nlmsghdr *nlh, return 0; } -static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh, - struct nlattr **attrs) +static int xfrm_add_pol_expire(struct sk_buff *skb, const struct nlmsghdr *nlh, + struct nlattr **attrs) { struct net *net = sock_net(skb->sk); struct xfrm_policy *xp; - struct xfrm_user_polexpire *up = nlmsg_data(nlh); - struct xfrm_userpolicy_info *p = &up->pol; + const struct xfrm_user_polexpire *up = nlmsg_data(nlh); + const struct xfrm_userpolicy_info *p = &up->pol; u8 type = XFRM_POLICY_TYPE_MAIN; int err = -ENOENT; struct xfrm_mark m; @@ -2062,14 +2093,14 @@ static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh, return err; } -static int xfrm_add_sa_expire(struct sk_buff *skb, struct nlmsghdr *nlh, - struct nlattr **attrs) +static int xfrm_add_sa_expire(struct sk_buff *skb, const struct nlmsghdr *nlh, + struct nlattr **attrs) { struct net *net = sock_net(skb->sk); struct xfrm_state *x; int err; - struct xfrm_user_expire *ue = nlmsg_data(nlh); - struct xfrm_usersa_info *p = &ue->state; + const struct xfrm_user_expire *ue = nlmsg_data(nlh); + const struct xfrm_usersa_info *p = &ue->state; struct xfrm_mark m; u32 mark = xfrm_mark_get(attrs, &m); @@ -2096,8 +2127,8 @@ static int xfrm_add_sa_expire(struct sk_buff *skb, struct nlmsghdr *nlh, return err; } -static int xfrm_add_acquire(struct sk_buff *skb, struct nlmsghdr *nlh, - struct nlattr **attrs) +static int xfrm_add_acquire(struct sk_buff *skb, const struct nlmsghdr *nlh, + struct nlattr **attrs) { struct net *net = sock_net(skb->sk); struct xfrm_policy *xp; @@ -2106,7 +2137,7 @@ static int xfrm_add_acquire(struct sk_buff *skb, struct nlmsghdr *nlh, struct nlattr *rt = attrs[XFRMA_TMPL]; struct xfrm_mark mark; - struct xfrm_user_acquire *ua = nlmsg_data(nlh); + const struct xfrm_user_acquire *ua = nlmsg_data(nlh); struct xfrm_state *x = xfrm_state_alloc(net); int err = -ENOMEM; @@ -2160,12 +2191,12 @@ static int copy_from_user_migrate(struct xfrm_migrate *ma, struct xfrm_kmaddress *k, struct nlattr **attrs, int *num) { - struct nlattr *rt = attrs[XFRMA_MIGRATE]; - struct xfrm_user_migrate *um; + const struct nlattr *rt = attrs[XFRMA_MIGRATE]; + const struct xfrm_user_migrate *um; int i, num_migrate; if (k != NULL) { - struct xfrm_user_kmaddress *uk; + const struct xfrm_user_kmaddress *uk; uk = nla_data(attrs[XFRMA_KMADDRESS]); memcpy(&k->local, &uk->local, sizeof(k->local)); @@ -2198,10 +2229,10 @@ static int copy_from_user_migrate(struct xfrm_migrate *ma, return 0; } -static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh, +static int xfrm_do_migrate(struct sk_buff *skb, const struct nlmsghdr *nlh, struct nlattr **attrs) { - struct xfrm_userpolicy_id *pi = nlmsg_data(nlh); + const struct xfrm_userpolicy_id *pi = nlmsg_data(nlh); struct xfrm_migrate m[XFRM_MAX_DEPTH]; struct xfrm_kmaddress km, *kmp; u8 type; @@ -2230,7 +2261,7 @@ static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh, return 0; } #else -static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh, +static int xfrm_do_migrate(struct sk_buff *skb, const struct nlmsghdr *nlh, struct nlattr **attrs) { return -ENOPROTOOPT; @@ -2238,7 +2269,8 @@ static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh, #endif #ifdef CONFIG_XFRM_MIGRATE -static int copy_to_user_migrate(const struct xfrm_migrate *m, struct sk_buff *skb) +static int copy_to_user_migrate(const struct xfrm_migrate *m, + struct sk_buff *skb) { struct xfrm_user_migrate um; @@ -2256,7 +2288,8 @@ static int copy_to_user_migrate(const struct xfrm_migrate *m, struct sk_buff *sk return nla_put(skb, XFRMA_MIGRATE, sizeof(um), &um); } -static int copy_to_user_kmaddress(const struct xfrm_kmaddress *k, struct sk_buff *skb) +static int copy_to_user_kmaddress(const struct xfrm_kmaddress *k, + struct sk_buff *skb) { struct xfrm_user_kmaddress uk; @@ -2407,7 +2440,9 @@ static const struct nla_policy xfrma_spd_policy[XFRMA_SPD_MAX+1] = { }; static const struct xfrm_link { - int (*doit)(struct sk_buff *, struct nlmsghdr *, struct nlattr **); + int (*doit)(struct sk_buff *, + const struct nlmsghdr *, + struct nlattr **); int (*dump)(struct sk_buff *, struct netlink_callback *); int (*done)(struct netlink_callback *); const struct nla_policy *nla_pol; @@ -2506,7 +2541,9 @@ static inline size_t xfrm_expire_msgsize(void) + nla_total_size(sizeof(struct xfrm_mark)); } -static int build_expire(struct sk_buff *skb, struct xfrm_state *x, const struct km_event *c) +static int build_expire(struct sk_buff *skb, + const struct xfrm_state *x, + const struct km_event *c) { struct xfrm_user_expire *ue; struct nlmsghdr *nlh; @@ -2528,7 +2565,8 @@ static int build_expire(struct sk_buff *skb, struct xfrm_state *x, const struct return 0; } -static int xfrm_exp_state_notify(struct xfrm_state *x, const struct km_event *c) +static int xfrm_exp_state_notify(const struct xfrm_state *x, + const struct km_event *c) { struct net *net = xs_net(x); struct sk_buff *skb; @@ -2545,7 +2583,8 @@ static int xfrm_exp_state_notify(struct xfrm_state *x, const struct km_event *c) return xfrm_nlmsg_multicast(net, skb, 0, XFRMNLGRP_EXPIRE); } -static int xfrm_aevent_state_notify(struct xfrm_state *x, const struct km_event *c) +static int xfrm_aevent_state_notify(const struct xfrm_state *x, + const struct km_event *c) { struct net *net = xs_net(x); struct sk_buff *skb; @@ -2586,7 +2625,7 @@ static int xfrm_notify_sa_flush(const struct km_event *c) return xfrm_nlmsg_multicast(net, skb, 0, XFRMNLGRP_SA); } -static inline size_t xfrm_sa_len(struct xfrm_state *x) +static inline size_t xfrm_sa_len(const struct xfrm_state *x) { size_t l = 0; if (x->aead) @@ -2622,7 +2661,7 @@ static inline size_t xfrm_sa_len(struct xfrm_state *x) return l; } -static int xfrm_notify_sa(struct xfrm_state *x, const struct km_event *c) +static int xfrm_notify_sa(const struct xfrm_state *x, const struct km_event *c) { struct net *net = xs_net(x); struct xfrm_usersa_info *p; @@ -2679,7 +2718,8 @@ static int xfrm_notify_sa(struct xfrm_state *x, const struct km_event *c) return err; } -static int xfrm_send_state_notify(struct xfrm_state *x, const struct km_event *c) +static int xfrm_send_state_notify(const struct xfrm_state *x, + const struct km_event *c) { switch (c->event) { @@ -2703,8 +2743,8 @@ static int xfrm_send_state_notify(struct xfrm_state *x, const struct km_event *c } -static inline size_t xfrm_acquire_msgsize(struct xfrm_state *x, - struct xfrm_policy *xp) +static inline size_t xfrm_acquire_msgsize(const struct xfrm_state *x, + const struct xfrm_policy *xp) { return NLMSG_ALIGN(sizeof(struct xfrm_user_acquire)) + nla_total_size(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr) @@ -2713,8 +2753,10 @@ static inline size_t xfrm_acquire_msgsize(struct xfrm_state *x, + userpolicy_type_attrsize(); } -static int build_acquire(struct sk_buff *skb, struct xfrm_state *x, - struct xfrm_tmpl *xt, struct xfrm_policy *xp) +static int build_acquire(struct sk_buff *skb, + struct xfrm_state *x, + const struct xfrm_tmpl *xt, + const struct xfrm_policy *xp) { __u32 seq = xfrm_get_acqseq(); struct xfrm_user_acquire *ua; @@ -2751,8 +2793,9 @@ static int build_acquire(struct sk_buff *skb, struct xfrm_state *x, return 0; } -static int xfrm_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *xt, - struct xfrm_policy *xp) +static int xfrm_send_acquire(struct xfrm_state *x, + const struct xfrm_tmpl *xt, + const struct xfrm_policy *xp) { struct net *net = xs_net(x); struct sk_buff *skb; @@ -2774,7 +2817,8 @@ static struct xfrm_policy *xfrm_compile_policy(struct sock *sk, int opt, u8 *data, int len, int *dir) { struct net *net = sock_net(sk); - struct xfrm_userpolicy_info *p = (struct xfrm_userpolicy_info *)data; + const struct xfrm_userpolicy_info *p = + (struct xfrm_userpolicy_info *)data; struct xfrm_user_tmpl *ut = (struct xfrm_user_tmpl *) (p + 1); struct xfrm_policy *xp; int nr; @@ -2827,7 +2871,7 @@ static struct xfrm_policy *xfrm_compile_policy(struct sock *sk, int opt, return xp; } -static inline size_t xfrm_polexpire_msgsize(struct xfrm_policy *xp) +static inline size_t xfrm_polexpire_msgsize(const struct xfrm_policy *xp) { return NLMSG_ALIGN(sizeof(struct xfrm_user_polexpire)) + nla_total_size(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr) @@ -2836,8 +2880,10 @@ static inline size_t xfrm_polexpire_msgsize(struct xfrm_policy *xp) + userpolicy_type_attrsize(); } -static int build_polexpire(struct sk_buff *skb, struct xfrm_policy *xp, - int dir, const struct km_event *c) +static int build_polexpire(struct sk_buff *skb, + const struct xfrm_policy *xp, + int dir, + const struct km_event *c) { struct xfrm_user_polexpire *upe; int hard = c->data.hard; @@ -2867,7 +2913,9 @@ static int build_polexpire(struct sk_buff *skb, struct xfrm_policy *xp, return 0; } -static int xfrm_exp_policy_notify(struct xfrm_policy *xp, int dir, const struct km_event *c) +static int xfrm_exp_policy_notify(const struct xfrm_policy *xp, + int dir, + const struct km_event *c) { struct net *net = xp_net(xp); struct sk_buff *skb; @@ -2882,7 +2930,9 @@ static int xfrm_exp_policy_notify(struct xfrm_policy *xp, int dir, const struct return xfrm_nlmsg_multicast(net, skb, 0, XFRMNLGRP_EXPIRE); } -static int xfrm_notify_policy(struct xfrm_policy *xp, int dir, const struct km_event *c) +static int xfrm_notify_policy(const struct xfrm_policy *xp, + int dir, + const struct km_event *c) { int len = nla_total_size(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr); struct net *net = xp_net(xp); @@ -2976,7 +3026,9 @@ static int xfrm_notify_policy_flush(const struct km_event *c) return err; } -static int xfrm_send_policy_notify(struct xfrm_policy *xp, int dir, const struct km_event *c) +static int xfrm_send_policy_notify(const struct xfrm_policy *xp, + int dir, + const struct km_event *c) { switch (c->event) { @@ -3003,7 +3055,8 @@ static inline size_t xfrm_report_msgsize(void) } static int build_report(struct sk_buff *skb, u8 proto, - struct xfrm_selector *sel, xfrm_address_t *addr) + const struct xfrm_selector *sel, + const xfrm_address_t *addr) { struct xfrm_user_report *ur; struct nlmsghdr *nlh; @@ -3027,8 +3080,10 @@ static int build_report(struct sk_buff *skb, u8 proto, return 0; } -static int xfrm_send_report(struct net *net, u8 proto, - struct xfrm_selector *sel, xfrm_address_t *addr) +static int xfrm_send_report(struct net *net, + u8 proto, + const struct xfrm_selector *sel, + const xfrm_address_t *addr) { struct sk_buff *skb; @@ -3047,8 +3102,10 @@ static inline size_t xfrm_mapping_msgsize(void) return NLMSG_ALIGN(sizeof(struct xfrm_user_mapping)); } -static int build_mapping(struct sk_buff *skb, struct xfrm_state *x, - xfrm_address_t *new_saddr, __be16 new_sport) +static int build_mapping(struct sk_buff *skb, + const struct xfrm_state *x, + const xfrm_address_t *new_saddr, + __be16 new_sport) { struct xfrm_user_mapping *um; struct nlmsghdr *nlh; @@ -3073,7 +3130,8 @@ static int build_mapping(struct sk_buff *skb, struct xfrm_state *x, return 0; } -static int xfrm_send_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, +static int xfrm_send_mapping(struct xfrm_state *x, + const xfrm_address_t *ipaddr, __be16 sport) { struct net *net = xs_net(x);