Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9443
b: refs/heads/master
c: 64233bf
h: refs/heads/master
i:
  9441: 2961d6d
  9439: 181fe58
v: v3
  • Loading branch information
Oliver Dawid authored and David S. Miller committed Sep 27, 2005
1 parent 6f1356c commit 37da2d8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 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: ba645c16026ed733a51f904df34756f61bc155fc
refs/heads/master: 64233bffbb50f12e576c61d1698a573c8033004a
31 changes: 22 additions & 9 deletions trunk/net/appletalk/ddp.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ static struct sock *atalk_search_socket(struct sockaddr_at *to,
continue;

if (to->sat_addr.s_net == ATADDR_ANYNET &&
to->sat_addr.s_node == ATADDR_BCAST &&
at->src_net == atif->address.s_net)
to->sat_addr.s_node == ATADDR_BCAST)
goto found;

if (to->sat_addr.s_net == at->src_net &&
Expand Down Expand Up @@ -1443,8 +1442,10 @@ static int atalk_rcv(struct sk_buff *skb, struct net_device *dev,
else
atif = atalk_find_interface(ddp->deh_dnet, ddp->deh_dnode);

/* Not ours, so we route the packet via the correct AppleTalk iface */
if (!atif) {
/* Not ours, so we route the packet via the correct
* AppleTalk iface
*/
atalk_route_packet(skb, dev, ddp, &ddphv, origlen);
goto out;
}
Expand Down Expand Up @@ -1592,9 +1593,6 @@ static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr

if (usat->sat_addr.s_net || usat->sat_addr.s_node == ATADDR_ANYNODE) {
rt = atrtr_find(&usat->sat_addr);
if (!rt)
return -ENETUNREACH;

dev = rt->dev;
} else {
struct atalk_addr at_hint;
Expand All @@ -1603,11 +1601,12 @@ static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr
at_hint.s_net = at->src_net;

rt = atrtr_find(&at_hint);
if (!rt)
return -ENETUNREACH;

dev = rt->dev;
}
if (!rt)
return -ENETUNREACH;

dev = rt->dev;

SOCK_DEBUG(sk, "SK %p: Size needed %d, device %s\n",
sk, size, dev->name);
Expand Down Expand Up @@ -1677,6 +1676,20 @@ static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr
SOCK_DEBUG(sk, "SK %p: Loop back.\n", sk);
/* loop back */
skb_orphan(skb);
if (ddp->deh_dnode == ATADDR_BCAST) {
struct atalk_addr at_lo;

at_lo.s_node = 0;
at_lo.s_net = 0;

rt = atrtr_find(&at_lo);
if (!rt) {
kfree_skb(skb);
return -ENETUNREACH;
}
dev = rt->dev;
skb->dev = dev;
}
ddp_dl->request(ddp_dl, skb, dev->dev_addr);
} else {
SOCK_DEBUG(sk, "SK %p: send out.\n", sk);
Expand Down

0 comments on commit 37da2d8

Please sign in to comment.