[PATCH 2/2] Phonet: do not reply to indication reset packets

Subsystems: networking [general], phonet protocol, the rest

STALE6498d

2 messages, 2 authors, 2008-10-27 · open the first message on its own page

[PATCH 2/2] Phonet: do not reply to indication reset packets

From: Remi Denis-Courmont <hidden>
Date: 2008-10-24 15:06:00

From: Remi Denis-Courmont <redacted>

This fixes a potential error packet loop.

Signed-off-by: Remi Denis-Courmont <redacted>
---
 include/linux/phonet.h |    1 +
 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 c9609f9..4157faa 100644
--- a/include/linux/phonet.h
+++ b/include/linux/phonet.h
@@ -72,6 +72,7 @@ struct phonetmsg {
 	} pn_msg_u;
 };
 #define PN_COMMON_MESSAGE	0xF0
+#define PN_COMMGR		0x10
 #define PN_PREFIX		0xE0 /* resource for extended messages */
 #define pn_submsg_id		pn_msg_u.base.pn_submsg_id
 #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 b9d97ef..defeb7a 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)
 		return 0; /* we are not the destination */
 	if (ph->pn_res == PN_PREFIX && !pskb_may_pull(skb, 5))
 		return 0;
+	if (ph->pn_res == PN_COMMGR) /* indications */
+		return 0;
 
 	ph = pn_hdr(skb); /* re-acquires the pointer */
 	pm = pn_msg(skb);
@@ -309,7 +311,8 @@ static int send_reset_indications(struct sk_buff *rskb)
 
 	return pn_raw_send(data, sizeof(data), rskb->dev,
 				pn_object(oph->pn_sdev, 0x00),
-				pn_object(oph->pn_rdev, oph->pn_robj), 0x10);
+				pn_object(oph->pn_rdev, oph->pn_robj),
+				PN_COMMGR);
 }
 
 
-- 
1.5.4.3

Re: [PATCH 2/2] Phonet: do not reply to indication reset packets

From: David Miller <davem@davemloft.net>
Date: 2008-10-27 06:07:59

From: Remi Denis-Courmont <redacted>
Date: Fri, 24 Oct 2008 17:55:39 +0300
This fixes a potential error packet loop.

Signed-off-by: Remi Denis-Courmont <redacted>
Also applied, thanks a lot.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help