diff options
author | Remi Denis-Courmont <remi.denis-courmont@nokia.com> | 2008-10-27 02:07:25 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-27 02:07:25 -0400 |
commit | c3a90c788b743303c4d824780a3a7271693fb64a (patch) | |
tree | b969b0607688b1e39672ab6790383554b8902c7a | |
parent | e214a8cc7a81f20ed7cb4f6373cf15048556bbac (diff) |
Phonet: do not reply to indication reset packets
This fixes a potential error packet loop.
Signed-off-by: Remi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/phonet.h | 1 | ||||
-rw-r--r-- | net/phonet/af_phonet.c | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/phonet.h b/include/linux/phonet.h index c9609f9aedac..4157faa857b6 100644 --- a/include/linux/phonet.h +++ b/include/linux/phonet.h | |||
@@ -72,6 +72,7 @@ struct phonetmsg { | |||
72 | } pn_msg_u; | 72 | } pn_msg_u; |
73 | }; | 73 | }; |
74 | #define PN_COMMON_MESSAGE 0xF0 | 74 | #define PN_COMMON_MESSAGE 0xF0 |
75 | #define PN_COMMGR 0x10 | ||
75 | #define PN_PREFIX 0xE0 /* resource for extended messages */ | 76 | #define PN_PREFIX 0xE0 /* resource for extended messages */ |
76 | #define pn_submsg_id pn_msg_u.base.pn_submsg_id | 77 | #define pn_submsg_id pn_msg_u.base.pn_submsg_id |
77 | #define pn_e_submsg_id pn_msg_u.ext.pn_e_submsg_id | 78 | #define pn_e_submsg_id pn_msg_u.ext.pn_e_submsg_id |
diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c index b9d97effebe3..defeb7a0d502 100644 --- a/net/phonet/af_phonet.c +++ b/net/phonet/af_phonet.c | |||
@@ -261,6 +261,8 @@ static inline int can_respond(struct sk_buff *skb) | |||
261 | return 0; /* we are not the destination */ | 261 | return 0; /* we are not the destination */ |
262 | if (ph->pn_res == PN_PREFIX && !pskb_may_pull(skb, 5)) | 262 | if (ph->pn_res == PN_PREFIX && !pskb_may_pull(skb, 5)) |
263 | return 0; | 263 | return 0; |
264 | if (ph->pn_res == PN_COMMGR) /* indications */ | ||
265 | return 0; | ||
264 | 266 | ||
265 | ph = pn_hdr(skb); /* re-acquires the pointer */ | 267 | ph = pn_hdr(skb); /* re-acquires the pointer */ |
266 | pm = pn_msg(skb); | 268 | pm = pn_msg(skb); |
@@ -309,7 +311,8 @@ static int send_reset_indications(struct sk_buff *rskb) | |||
309 | 311 | ||
310 | return pn_raw_send(data, sizeof(data), rskb->dev, | 312 | return pn_raw_send(data, sizeof(data), rskb->dev, |
311 | pn_object(oph->pn_sdev, 0x00), | 313 | pn_object(oph->pn_sdev, 0x00), |
312 | pn_object(oph->pn_rdev, oph->pn_robj), 0x10); | 314 | pn_object(oph->pn_rdev, oph->pn_robj), |
315 | PN_COMMGR); | ||
313 | } | 316 | } |
314 | 317 | ||
315 | 318 | ||