Commit 16f3fd6b authored by Jon Grimm's avatar Jon Grimm

[SCTP] Handle "no route" case for output handler (jgrimm)

parent e025484e
...@@ -429,6 +429,8 @@ int sctp_packet_transmit(sctp_packet_t *packet) ...@@ -429,6 +429,8 @@ int sctp_packet_transmit(sctp_packet_t *packet)
} }
nskb->dst = dst_clone(transport->dst); nskb->dst = dst_clone(transport->dst);
if (!nskb->dst)
goto no_route;
SCTP_DEBUG_PRINTK("***sctp_transmit_packet*** skb length %d\n", SCTP_DEBUG_PRINTK("***sctp_transmit_packet*** skb length %d\n",
nskb->len); nskb->len);
...@@ -436,6 +438,11 @@ int sctp_packet_transmit(sctp_packet_t *packet) ...@@ -436,6 +438,11 @@ int sctp_packet_transmit(sctp_packet_t *packet)
out: out:
packet->size = SCTP_IP_OVERHEAD; packet->size = SCTP_IP_OVERHEAD;
return err; return err;
no_route:
kfree_skb(nskb);
IP_INC_STATS_BH(IpOutNoRoutes);
err = -EHOSTUNREACH;
goto out;
} }
/******************************************************************** /********************************************************************
......
...@@ -227,9 +227,12 @@ struct dst_entry *sctp_v4_get_dst(union sctp_addr *daddr, ...@@ -227,9 +227,12 @@ struct dst_entry *sctp_v4_get_dst(union sctp_addr *daddr,
union sctp_addr *saddr) union sctp_addr *saddr)
{ {
struct rtable *rt; struct rtable *rt;
struct flowi fl = { .nl_u = { .ip4_u = { .daddr = struct flowi fl = {
daddr->v4.sin_addr.s_addr, .nl_u = {
} } }; .ip4_u = { .daddr =
daddr->v4.sin_addr.s_addr, }},
.proto = IPPROTO_SCTP,
};
if (saddr) if (saddr)
fl.fl4_src = saddr->v4.sin_addr.s_addr; fl.fl4_src = saddr->v4.sin_addr.s_addr;
......
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