From: Rémi Denis-Courmont Date: Wed, 23 Sep 2009 03:17:11 +0000 (+0000) Subject: Phonet: error on broadcast sending (unimplemented) X-Git-Tag: v2.6.32-rc1~21^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=18a1166de994685d770425086b2bcc1ba567f7ed;p=profile%2Fivi%2Fkernel-x86-ivi.git 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 Signed-off-by: David S. Miller --- diff --git a/include/linux/phonet.h b/include/linux/phonet.h index 1ef5a07..e5126cf 100644 --- a/include/linux/phonet.h +++ b/include/linux/phonet.h @@ -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 */ diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c index a662e62..f60c0c2 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, 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));