@@ -250,15 +250,15 @@ static bool opt_unrec(struct sk_buff *skb, __u32 offset)
250
250
return (* op & 0xC0 ) == 0x80 ;
251
251
}
252
252
253
- int icmpv6_push_pending_frames (struct sock * sk , struct flowi6 * fl6 ,
254
- struct icmp6hdr * thdr , int len )
253
+ void icmpv6_push_pending_frames (struct sock * sk , struct flowi6 * fl6 ,
254
+ struct icmp6hdr * thdr , int len )
255
255
{
256
256
struct sk_buff * skb ;
257
257
struct icmp6hdr * icmp6h ;
258
258
259
259
skb = skb_peek (& sk -> sk_write_queue );
260
260
if (!skb )
261
- goto out ;
261
+ return ;
262
262
263
263
icmp6h = icmp6_hdr (skb );
264
264
memcpy (icmp6h , thdr , sizeof (struct icmp6hdr ));
@@ -286,8 +286,6 @@ int icmpv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6,
286
286
tmp_csum );
287
287
}
288
288
ip6_push_pending_frames (sk );
289
- out :
290
- return 0 ;
291
289
}
292
290
293
291
struct icmpv6_msg {
@@ -437,7 +435,6 @@ static void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info,
437
435
int iif = 0 ;
438
436
int addr_type = 0 ;
439
437
int len ;
440
- int err = 0 ;
441
438
u32 mark = IP6_REPLY_MARK (net , skb -> mark );
442
439
443
440
if ((u8 * )hdr < skb -> head ||
@@ -574,17 +571,16 @@ static void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info,
574
571
rcu_read_lock ();
575
572
idev = __in6_dev_get (skb -> dev );
576
573
577
- err = ip6_append_data (sk , icmpv6_getfrag , & msg ,
578
- len + sizeof (struct icmp6hdr ),
579
- sizeof (struct icmp6hdr ),
580
- & ipc6 , & fl6 , (struct rt6_info * )dst ,
581
- MSG_DONTWAIT , & sockc_unused );
582
- if (err ) {
574
+ if (ip6_append_data (sk , icmpv6_getfrag , & msg ,
575
+ len + sizeof (struct icmp6hdr ),
576
+ sizeof (struct icmp6hdr ),
577
+ & ipc6 , & fl6 , (struct rt6_info * )dst ,
578
+ MSG_DONTWAIT , & sockc_unused )) {
583
579
ICMP6_INC_STATS (net , idev , ICMP6_MIB_OUTERRORS );
584
580
ip6_flush_pending_frames (sk );
585
581
} else {
586
- err = icmpv6_push_pending_frames (sk , & fl6 , & tmp_hdr ,
587
- len + sizeof (struct icmp6hdr ));
582
+ icmpv6_push_pending_frames (sk , & fl6 , & tmp_hdr ,
583
+ len + sizeof (struct icmp6hdr ));
588
584
}
589
585
rcu_read_unlock ();
590
586
out_dst_release :
@@ -681,7 +677,6 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
681
677
struct icmpv6_msg msg ;
682
678
struct dst_entry * dst ;
683
679
struct ipcm6_cookie ipc6 ;
684
- int err = 0 ;
685
680
u32 mark = IP6_REPLY_MARK (net , skb -> mark );
686
681
struct sockcm_cookie sockc_unused = {0 };
687
682
@@ -718,8 +713,7 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
718
713
else if (!fl6 .flowi6_oif )
719
714
fl6 .flowi6_oif = np -> ucast_oif ;
720
715
721
- err = ip6_dst_lookup (net , sk , & dst , & fl6 );
722
- if (err )
716
+ if (ip6_dst_lookup (net , sk , & dst , & fl6 ))
723
717
goto out ;
724
718
dst = xfrm_lookup (net , dst , flowi6_to_flowi (& fl6 ), sk , 0 );
725
719
if (IS_ERR (dst ))
@@ -736,17 +730,16 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
736
730
ipc6 .dontfrag = np -> dontfrag ;
737
731
ipc6 .opt = NULL ;
738
732
739
- err = ip6_append_data (sk , icmpv6_getfrag , & msg , skb -> len + sizeof (struct icmp6hdr ),
740
- sizeof (struct icmp6hdr ), & ipc6 , & fl6 ,
741
- (struct rt6_info * )dst , MSG_DONTWAIT ,
742
- & sockc_unused );
743
-
744
- if (err ) {
733
+ if (ip6_append_data (sk , icmpv6_getfrag , & msg ,
734
+ skb -> len + sizeof (struct icmp6hdr ),
735
+ sizeof (struct icmp6hdr ), & ipc6 , & fl6 ,
736
+ (struct rt6_info * )dst , MSG_DONTWAIT ,
737
+ & sockc_unused )) {
745
738
__ICMP6_INC_STATS (net , idev , ICMP6_MIB_OUTERRORS );
746
739
ip6_flush_pending_frames (sk );
747
740
} else {
748
- err = icmpv6_push_pending_frames (sk , & fl6 , & tmp_hdr ,
749
- skb -> len + sizeof (struct icmp6hdr ));
741
+ icmpv6_push_pending_frames (sk , & fl6 , & tmp_hdr ,
742
+ skb -> len + sizeof (struct icmp6hdr ));
750
743
}
751
744
dst_release (dst );
752
745
out :
0 commit comments