]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
Phonet: error on broadcast sending (unimplemented)
authorRémi Denis-Courmont <remi.denis-courmont@nokia.com>
Wed, 23 Sep 2009 03:17:11 +0000 (03:17 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 24 Sep 2009 22:38:57 +0000 (15:38 -0700)
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>
include/linux/phonet.h
net/phonet/af_phonet.c

index 1ef5a07818315b69a4b7b875b198e6c1b1137d24..e5126cff9b2a4f30e61aca41f5d922998302e621 100644 (file)
@@ -38,6 +38,7 @@
 #define PNPIPE_IFINDEX         2
 
 #define PNADDR_ANY             0
+#define PNADDR_BROADCAST       0xFC
 #define PNPORT_RESOURCE_ROUTING        0
 
 /* Values for PNPIPE_ENCAP option */
index a662e62a99cfa0adcf7589aa457a19bfeb21b48a..f60c0c2aacba5f1a99fe4a2fe159f43a09b78f07 100644 (file)
@@ -168,6 +168,12 @@ static int pn_send(struct sk_buff *skb, struct net_device *dev,
                goto drop;
        }
 
+       /* Broadcast sending is not implemented */
+       if (pn_addr(dst) == PNADDR_BROADCAST) {
+               err = -EOPNOTSUPP;
+               goto drop;
+       }
+
        skb_reset_transport_header(skb);
        WARN_ON(skb_headroom(skb) & 1); /* HW assumes word alignment */
        skb_push(skb, sizeof(struct phonethdr));