Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9068
b: refs/heads/master
c: 987905d
h: refs/heads/master
v: v3
  • Loading branch information
Mitsuru KANDA authored and David S. Miller committed Sep 18, 2005
1 parent 71d957b commit 82adfbf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 40abc27066c49b2c13c817154d438431b0303b96
refs/heads/master: 987905ded3d19c196dae25cac46c569cac9594b8
10 changes: 8 additions & 2 deletions trunk/net/ipv6/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,7 @@ static int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk,
int tclass = -1;
int corkreq = up->corkflag || msg->msg_flags&MSG_MORE;
int err;
int connected = 0;

/* destination address check */
if (sin6) {
Expand Down Expand Up @@ -748,6 +749,7 @@ static int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk,
fl->fl_ip_dport = inet->dport;
daddr = &np->daddr;
fl->fl6_flowlabel = np->flow_label;
connected = 1;
}

if (!fl->oif)
Expand All @@ -770,6 +772,7 @@ static int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk,
}
if (!(opt->opt_nflen|opt->opt_flen))
opt = NULL;
connected = 0;
}
if (opt == NULL)
opt = np->opt;
Expand All @@ -787,10 +790,13 @@ static int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk,
ipv6_addr_copy(&final, &fl->fl6_dst);
ipv6_addr_copy(&fl->fl6_dst, rt0->addr);
final_p = &final;
connected = 0;
}

if (!fl->oif && ipv6_addr_is_multicast(&fl->fl6_dst))
if (!fl->oif && ipv6_addr_is_multicast(&fl->fl6_dst)) {
fl->oif = np->mcast_oif;
connected = 0;
}

err = ip6_dst_lookup(sk, &dst, fl);
if (err)
Expand Down Expand Up @@ -846,7 +852,7 @@ static int udpv6_sendmsg(struct kiocb *iocb, struct sock *sk,
else if (!corkreq)
err = udp_v6_push_pending_frames(sk, up);

if (dst)
if (dst && connected)
ip6_dst_store(sk, dst,
ipv6_addr_equal(&fl->fl6_dst, &np->daddr) ?
&np->daddr : NULL);
Expand Down

0 comments on commit 82adfbf

Please sign in to comment.