Commit 4e64b1ed authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

net/ipv6: Convert icmpv6_push_pending_frames to void

commit cc71b7b0 ("net/ipv6: remove unused err variable on
icmpv6_push_pending_frames") exposed icmpv6_push_pending_frames
return value not being used.

Remove now unnecessary int err declarations and uses.

Miscellanea:

o Remove unnecessary goto and out: labels
o Realign arguments
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cc71b7b0
...@@ -300,8 +300,8 @@ static inline void fl6_sock_release(struct ip6_flowlabel *fl) ...@@ -300,8 +300,8 @@ static inline void fl6_sock_release(struct ip6_flowlabel *fl)
void icmpv6_notify(struct sk_buff *skb, u8 type, u8 code, __be32 info); void icmpv6_notify(struct sk_buff *skb, u8 type, u8 code, __be32 info);
int icmpv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6, void icmpv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6,
struct icmp6hdr *thdr, int len); struct icmp6hdr *thdr, int len);
int ip6_ra_control(struct sock *sk, int sel); int ip6_ra_control(struct sock *sk, int sel);
......
...@@ -250,15 +250,15 @@ static bool opt_unrec(struct sk_buff *skb, __u32 offset) ...@@ -250,15 +250,15 @@ static bool opt_unrec(struct sk_buff *skb, __u32 offset)
return (*op & 0xC0) == 0x80; return (*op & 0xC0) == 0x80;
} }
int icmpv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6, void icmpv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6,
struct icmp6hdr *thdr, int len) struct icmp6hdr *thdr, int len)
{ {
struct sk_buff *skb; struct sk_buff *skb;
struct icmp6hdr *icmp6h; struct icmp6hdr *icmp6h;
skb = skb_peek(&sk->sk_write_queue); skb = skb_peek(&sk->sk_write_queue);
if (!skb) if (!skb)
goto out; return;
icmp6h = icmp6_hdr(skb); icmp6h = icmp6_hdr(skb);
memcpy(icmp6h, thdr, sizeof(struct icmp6hdr)); memcpy(icmp6h, thdr, sizeof(struct icmp6hdr));
...@@ -286,8 +286,6 @@ int icmpv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6, ...@@ -286,8 +286,6 @@ int icmpv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6,
tmp_csum); tmp_csum);
} }
ip6_push_pending_frames(sk); ip6_push_pending_frames(sk);
out:
return 0;
} }
struct icmpv6_msg { struct icmpv6_msg {
...@@ -437,7 +435,6 @@ static void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info, ...@@ -437,7 +435,6 @@ static void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info,
int iif = 0; int iif = 0;
int addr_type = 0; int addr_type = 0;
int len; int len;
int err = 0;
u32 mark = IP6_REPLY_MARK(net, skb->mark); u32 mark = IP6_REPLY_MARK(net, skb->mark);
if ((u8 *)hdr < skb->head || if ((u8 *)hdr < skb->head ||
...@@ -574,17 +571,16 @@ static void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info, ...@@ -574,17 +571,16 @@ static void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info,
rcu_read_lock(); rcu_read_lock();
idev = __in6_dev_get(skb->dev); idev = __in6_dev_get(skb->dev);
err = ip6_append_data(sk, icmpv6_getfrag, &msg, if (ip6_append_data(sk, icmpv6_getfrag, &msg,
len + sizeof(struct icmp6hdr), len + sizeof(struct icmp6hdr),
sizeof(struct icmp6hdr), sizeof(struct icmp6hdr),
&ipc6, &fl6, (struct rt6_info *)dst, &ipc6, &fl6, (struct rt6_info *)dst,
MSG_DONTWAIT, &sockc_unused); MSG_DONTWAIT, &sockc_unused)) {
if (err) {
ICMP6_INC_STATS(net, idev, ICMP6_MIB_OUTERRORS); ICMP6_INC_STATS(net, idev, ICMP6_MIB_OUTERRORS);
ip6_flush_pending_frames(sk); ip6_flush_pending_frames(sk);
} else { } else {
err = icmpv6_push_pending_frames(sk, &fl6, &tmp_hdr, icmpv6_push_pending_frames(sk, &fl6, &tmp_hdr,
len + sizeof(struct icmp6hdr)); len + sizeof(struct icmp6hdr));
} }
rcu_read_unlock(); rcu_read_unlock();
out_dst_release: out_dst_release:
...@@ -681,7 +677,6 @@ static void icmpv6_echo_reply(struct sk_buff *skb) ...@@ -681,7 +677,6 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
struct icmpv6_msg msg; struct icmpv6_msg msg;
struct dst_entry *dst; struct dst_entry *dst;
struct ipcm6_cookie ipc6; struct ipcm6_cookie ipc6;
int err = 0;
u32 mark = IP6_REPLY_MARK(net, skb->mark); u32 mark = IP6_REPLY_MARK(net, skb->mark);
struct sockcm_cookie sockc_unused = {0}; struct sockcm_cookie sockc_unused = {0};
...@@ -718,8 +713,7 @@ static void icmpv6_echo_reply(struct sk_buff *skb) ...@@ -718,8 +713,7 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
else if (!fl6.flowi6_oif) else if (!fl6.flowi6_oif)
fl6.flowi6_oif = np->ucast_oif; fl6.flowi6_oif = np->ucast_oif;
err = ip6_dst_lookup(net, sk, &dst, &fl6); if (ip6_dst_lookup(net, sk, &dst, &fl6))
if (err)
goto out; goto out;
dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), sk, 0); dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), sk, 0);
if (IS_ERR(dst)) if (IS_ERR(dst))
...@@ -736,17 +730,16 @@ static void icmpv6_echo_reply(struct sk_buff *skb) ...@@ -736,17 +730,16 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
ipc6.dontfrag = np->dontfrag; ipc6.dontfrag = np->dontfrag;
ipc6.opt = NULL; ipc6.opt = NULL;
err = ip6_append_data(sk, icmpv6_getfrag, &msg, skb->len + sizeof(struct icmp6hdr), if (ip6_append_data(sk, icmpv6_getfrag, &msg,
sizeof(struct icmp6hdr), &ipc6, &fl6, skb->len + sizeof(struct icmp6hdr),
(struct rt6_info *)dst, MSG_DONTWAIT, sizeof(struct icmp6hdr), &ipc6, &fl6,
&sockc_unused); (struct rt6_info *)dst, MSG_DONTWAIT,
&sockc_unused)) {
if (err) {
__ICMP6_INC_STATS(net, idev, ICMP6_MIB_OUTERRORS); __ICMP6_INC_STATS(net, idev, ICMP6_MIB_OUTERRORS);
ip6_flush_pending_frames(sk); ip6_flush_pending_frames(sk);
} else { } else {
err = icmpv6_push_pending_frames(sk, &fl6, &tmp_hdr, icmpv6_push_pending_frames(sk, &fl6, &tmp_hdr,
skb->len + sizeof(struct icmp6hdr)); skb->len + sizeof(struct icmp6hdr));
} }
dst_release(dst); dst_release(dst);
out: out:
......
...@@ -154,9 +154,8 @@ static int ping_v6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) ...@@ -154,9 +154,8 @@ static int ping_v6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
ICMP6_MIB_OUTERRORS); ICMP6_MIB_OUTERRORS);
ip6_flush_pending_frames(sk); ip6_flush_pending_frames(sk);
} else { } else {
err = icmpv6_push_pending_frames(sk, &fl6, icmpv6_push_pending_frames(sk, &fl6,
(struct icmp6hdr *) &pfh.icmph, (struct icmp6hdr *)&pfh.icmph, len);
len);
} }
release_sock(sk); release_sock(sk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment