aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Denis-Courmont <remi.denis-courmont@nokia.com>2009-09-22 23:17:11 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-24 18:38:57 -0400
commit18a1166de994685d770425086b2bcc1ba567f7ed (patch)
tree748916e0e5640506b438b7bcafb863153a4c0816
parent582b0b611345fc8d9ab8a0605d2f14c468902719 (diff)
Phonet: error on broadcast sending (unimplemented)
If we ever implement this, then we can stop returning an error. Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/phonet.h1
-rw-r--r--net/phonet/af_phonet.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/phonet.h b/include/linux/phonet.h
index 1ef5a0781831..e5126cff9b2a 100644
--- a/include/linux/phonet.h
+++ b/include/linux/phonet.h
@@ -38,6 +38,7 @@
38#define PNPIPE_IFINDEX 2 38#define PNPIPE_IFINDEX 2
39 39
40#define PNADDR_ANY 0 40#define PNADDR_ANY 0
41#define PNADDR_BROADCAST 0xFC
41#define PNPORT_RESOURCE_ROUTING 0 42#define PNPORT_RESOURCE_ROUTING 0
42 43
43/* Values for PNPIPE_ENCAP option */ 44/* Values for PNPIPE_ENCAP option */
diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c
index a662e62a99cf..f60c0c2aacba 100644
--- a/net/phonet/af_phonet.c
+++ b/net/phonet/af_phonet.c
@@ -168,6 +168,12 @@ static int pn_send(struct sk_buff *skb, struct net_device *dev,
168 goto drop; 168 goto drop;
169 } 169 }
170 170
171 /* Broadcast sending is not implemented */
172 if (pn_addr(dst) == PNADDR_BROADCAST) {
173 err = -EOPNOTSUPP;
174 goto drop;
175 }
176
171 skb_reset_transport_header(skb); 177 skb_reset_transport_header(skb);
172 WARN_ON(skb_headroom(skb) & 1); /* HW assumes word alignment */ 178 WARN_ON(skb_headroom(skb) & 1); /* HW assumes word alignment */
173 skb_push(skb, sizeof(struct phonethdr)); 179 skb_push(skb, sizeof(struct phonethdr));