Commit 26ab3fca authored by Matt Johnston's avatar Matt Johnston Committed by David S. Miller

mctp: Add dest neighbour lladdr to route output

Now that we have a neighbour implementation, hook it up to the output
path to set the dest hardware address for outgoing packets.
Signed-off-by: default avatarMatt Johnston <matt@codeconstruct.com.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4a992bbd
...@@ -376,6 +376,9 @@ static unsigned int mctp_route_mtu(struct mctp_route *rt) ...@@ -376,6 +376,9 @@ static unsigned int mctp_route_mtu(struct mctp_route *rt)
static int mctp_route_output(struct mctp_route *route, struct sk_buff *skb) static int mctp_route_output(struct mctp_route *route, struct sk_buff *skb)
{ {
struct mctp_hdr *hdr = mctp_hdr(skb);
char daddr_buf[MAX_ADDR_LEN];
char *daddr = NULL;
unsigned int mtu; unsigned int mtu;
int rc; int rc;
...@@ -387,9 +390,12 @@ static int mctp_route_output(struct mctp_route *route, struct sk_buff *skb) ...@@ -387,9 +390,12 @@ static int mctp_route_output(struct mctp_route *route, struct sk_buff *skb)
return -EMSGSIZE; return -EMSGSIZE;
} }
/* TODO: daddr (from rt->neigh), saddr (from device?) */ /* If lookup fails let the device handle daddr==NULL */
if (mctp_neigh_lookup(route->dev, hdr->dest, daddr_buf) == 0)
daddr = daddr_buf;
rc = dev_hard_header(skb, skb->dev, ntohs(skb->protocol), rc = dev_hard_header(skb, skb->dev, ntohs(skb->protocol),
NULL, NULL, skb->len); daddr, skb->dev->dev_addr, skb->len);
if (rc) { if (rc) {
kfree_skb(skb); kfree_skb(skb);
return -EHOSTUNREACH; return -EHOSTUNREACH;
......
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