aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv6/raw.c14
-rw-r--r--net/ipv6/udp.c5
2 files changed, 8 insertions, 11 deletions
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 088b80b4ce74..059298baa1dd 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -805,15 +805,6 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
805 fl.fl6_flowlabel = np->flow_label; 805 fl.fl6_flowlabel = np->flow_label;
806 } 806 }
807 807
808 if (ipv6_addr_any(daddr)) {
809 /*
810 * unspecified destination address
811 * treated as error... is this correct ?
812 */
813 fl6_sock_release(flowlabel);
814 return(-EINVAL);
815 }
816
817 if (fl.oif == 0) 808 if (fl.oif == 0)
818 fl.oif = sk->sk_bound_dev_if; 809 fl.oif = sk->sk_bound_dev_if;
819 810
@@ -846,7 +837,10 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
846 if (err) 837 if (err)
847 goto out; 838 goto out;
848 839
849 ipv6_addr_copy(&fl.fl6_dst, daddr); 840 if (!ipv6_addr_any(daddr))
841 ipv6_addr_copy(&fl.fl6_dst, daddr);
842 else
843 fl.fl6_dst.s6_addr[15] = 0x1; /* :: means loopback (BSD'ism) */
850 if (ipv6_addr_any(&fl.fl6_src) && !ipv6_addr_any(&np->saddr)) 844 if (ipv6_addr_any(&fl.fl6_src) && !ipv6_addr_any(&np->saddr))
851 ipv6_addr_copy(&fl.fl6_src, &np->saddr); 845 ipv6_addr_copy(&fl.fl6_src, &np->saddr);
852 846
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 30ef7dc5d403..1fd784f3e2ec 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -752,7 +752,10 @@ do_udp_sendmsg:
752 opt = ipv6_fixup_options(&opt_space, opt); 752 opt = ipv6_fixup_options(&opt_space, opt);
753 753
754 fl.proto = sk->sk_protocol; 754 fl.proto = sk->sk_protocol;
755 ipv6_addr_copy(&fl.fl6_dst, daddr); 755 if (!ipv6_addr_any(daddr))
756 ipv6_addr_copy(&fl.fl6_dst, daddr);
757 else
758 fl.fl6_dst.s6_addr[15] = 0x1; /* :: means loopback (BSD'ism) */
756 if (ipv6_addr_any(&fl.fl6_src) && !ipv6_addr_any(&np->saddr)) 759 if (ipv6_addr_any(&fl.fl6_src) && !ipv6_addr_any(&np->saddr))
757 ipv6_addr_copy(&fl.fl6_src, &np->saddr); 760 ipv6_addr_copy(&fl.fl6_src, &np->saddr);
758 fl.fl_ip_sport = inet->sport; 761 fl.fl_ip_sport = inet->sport;