lkml.org 
[lkml]   [2019]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.18 048/134] net: Add __icmp_send helper.
    Date
    3.18-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Nazarov Sergey <s-nazarov@yandex.ru>

    [ Upstream commit 9ef6b42ad6fd7929dd1b6092cb02014e382c6a91 ]

    Add __icmp_send function having ip_options struct parameter

    Signed-off-by: Sergey Nazarov <s-nazarov@yandex.ru>
    Reviewed-by: Paul Moore <paul@paul-moore.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    include/net/icmp.h | 9 ++++++++-
    net/ipv4/icmp.c | 7 ++++---
    2 files changed, 12 insertions(+), 4 deletions(-)

    --- a/include/net/icmp.h
    +++ b/include/net/icmp.h
    @@ -22,6 +22,7 @@

    #include <net/inet_sock.h>
    #include <net/snmp.h>
    +#include <net/ip.h>

    struct icmp_err {
    int errno;
    @@ -39,7 +40,13 @@ struct net_proto_family;
    struct sk_buff;
    struct net;

    -void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info);
    +void __icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info,
    + const struct ip_options *opt);
    +static inline void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
    +{
    + __icmp_send(skb_in, type, code, info, &IPCB(skb_in)->opt);
    +}
    +
    int icmp_rcv(struct sk_buff *skb);
    void icmp_err(struct sk_buff *skb, u32 info);
    int icmp_init(void);
    --- a/net/ipv4/icmp.c
    +++ b/net/ipv4/icmp.c
    @@ -541,7 +541,8 @@ relookup_failed:
    * MUST reply to only the first fragment.
    */

    -void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
    +void __icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info,
    + const struct ip_options *opt)
    {
    struct iphdr *iph;
    int room;
    @@ -655,7 +656,7 @@ void icmp_send(struct sk_buff *skb_in, i
    iph->tos;
    mark = IP4_REPLY_MARK(net, skb_in->mark);

    - if (ip_options_echo(&icmp_param->replyopts.opt.opt, skb_in))
    + if (__ip_options_echo(&icmp_param->replyopts.opt.opt, skb_in, opt))
    goto out_unlock;


    @@ -707,7 +708,7 @@ out_free:
    kfree(icmp_param);
    out:;
    }
    -EXPORT_SYMBOL(icmp_send);
    +EXPORT_SYMBOL(__icmp_send);


    static void icmp_socket_deliver(struct sk_buff *skb, u32 info)

    \
     
     \ /
      Last update: 2019-03-22 12:22    [W:4.200 / U:0.096 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site