path: root/src/mtp_layer3.c
diff options
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-01-17 20:12:32 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-01-20 11:37:49 +0100
commit92affdad724c829d76b4eeb01fce97edb85302f5 (patch)
treebecd88babe6f4b68ac1abd1615513d487620e158 /src/mtp_layer3.c
parent101cd0bc83426676ce47477ac3ab9160c66e83b2 (diff)
mtp: Do not send anything in case the there is no link
If there is no usable link in the linkset we should not try to send. This assumes that all incoming packages come from links that are up. We do not check this right now but we will have to check this.
Diffstat (limited to 'src/mtp_layer3.c')
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mtp_layer3.c b/src/mtp_layer3.c
index c53000e..9eb2fab 100644
--- a/src/mtp_layer3.c
+++ b/src/mtp_layer3.c
@@ -534,6 +534,9 @@ static int mtp_int_submit(struct mtp_link_set *link, int pc, int sls, int type,
struct mtp_level_3_hdr *hdr;
struct msgb *msg;
+ if (!link->slc[sls % 16])
+ return -1;
msg = mtp_msg_alloc(link);
if (!msg)
return -1;