@@ -571,7 +571,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
571
571
{
572
572
struct iphdr * iph ;
573
573
int room ;
574
- struct icmp_bxm * icmp_param ;
574
+ struct icmp_bxm icmp_param ;
575
575
struct rtable * rt = skb_rtable (skb_in );
576
576
struct ipcm_cookie ipc ;
577
577
struct flowi4 fl4 ;
@@ -648,13 +648,9 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
648
648
}
649
649
}
650
650
651
- icmp_param = kmalloc (sizeof (* icmp_param ), GFP_ATOMIC );
652
- if (!icmp_param )
653
- return ;
654
-
655
651
sk = icmp_xmit_lock (net );
656
652
if (!sk )
657
- goto out_free ;
653
+ return ;
658
654
659
655
/*
660
656
* Construct source address and options.
@@ -681,30 +677,30 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
681
677
iph -> tos ;
682
678
mark = IP4_REPLY_MARK (net , skb_in -> mark );
683
679
684
- if (ip_options_echo (& icmp_param -> replyopts .opt .opt , skb_in ))
680
+ if (ip_options_echo (& icmp_param . replyopts .opt .opt , skb_in ))
685
681
goto out_unlock ;
686
682
687
683
688
684
/*
689
685
* Prepare data for ICMP header.
690
686
*/
691
687
692
- icmp_param -> data .icmph .type = type ;
693
- icmp_param -> data .icmph .code = code ;
694
- icmp_param -> data .icmph .un .gateway = info ;
695
- icmp_param -> data .icmph .checksum = 0 ;
696
- icmp_param -> skb = skb_in ;
697
- icmp_param -> offset = skb_network_offset (skb_in );
688
+ icmp_param . data .icmph .type = type ;
689
+ icmp_param . data .icmph .code = code ;
690
+ icmp_param . data .icmph .un .gateway = info ;
691
+ icmp_param . data .icmph .checksum = 0 ;
692
+ icmp_param . skb = skb_in ;
693
+ icmp_param . offset = skb_network_offset (skb_in );
698
694
inet_sk (sk )-> tos = tos ;
699
695
sk -> sk_mark = mark ;
700
696
ipc .addr = iph -> saddr ;
701
- ipc .opt = & icmp_param -> replyopts .opt ;
697
+ ipc .opt = & icmp_param . replyopts .opt ;
702
698
ipc .tx_flags = 0 ;
703
699
ipc .ttl = 0 ;
704
700
ipc .tos = -1 ;
705
701
706
702
rt = icmp_route_lookup (net , & fl4 , skb_in , iph , saddr , tos , mark ,
707
- type , code , icmp_param );
703
+ type , code , & icmp_param );
708
704
if (IS_ERR (rt ))
709
705
goto out_unlock ;
710
706
@@ -716,21 +712,19 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
716
712
room = dst_mtu (& rt -> dst );
717
713
if (room > 576 )
718
714
room = 576 ;
719
- room -= sizeof (struct iphdr ) + icmp_param -> replyopts .opt .opt .optlen ;
715
+ room -= sizeof (struct iphdr ) + icmp_param . replyopts .opt .opt .optlen ;
720
716
room -= sizeof (struct icmphdr );
721
717
722
- icmp_param -> data_len = skb_in -> len - icmp_param -> offset ;
723
- if (icmp_param -> data_len > room )
724
- icmp_param -> data_len = room ;
725
- icmp_param -> head_len = sizeof (struct icmphdr );
718
+ icmp_param . data_len = skb_in -> len - icmp_param . offset ;
719
+ if (icmp_param . data_len > room )
720
+ icmp_param . data_len = room ;
721
+ icmp_param . head_len = sizeof (struct icmphdr );
726
722
727
- icmp_push_reply (icmp_param , & fl4 , & ipc , & rt );
723
+ icmp_push_reply (& icmp_param , & fl4 , & ipc , & rt );
728
724
ende :
729
725
ip_rt_put (rt );
730
726
out_unlock :
731
727
icmp_xmit_unlock (sk );
732
- out_free :
733
- kfree (icmp_param );
734
728
out :;
735
729
}
736
730
EXPORT_SYMBOL (icmp_send );
0 commit comments