Commit 63007727 authored by Al Viro's avatar Al Viro Committed by David S. Miller

[IPV4]: trivial igmp annotations

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c0cda068
...@@ -140,7 +140,7 @@ struct ip_sf_socklist ...@@ -140,7 +140,7 @@ struct ip_sf_socklist
}; };
#define IP_SFLSIZE(count) (sizeof(struct ip_sf_socklist) + \ #define IP_SFLSIZE(count) (sizeof(struct ip_sf_socklist) + \
(count) * sizeof(__u32)) (count) * sizeof(__be32))
#define IP_SFBLOCK 10 /* allocate this many at once */ #define IP_SFBLOCK 10 /* allocate this many at once */
......
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
time_before(jiffies, (in_dev)->mr_v2_seen))) time_before(jiffies, (in_dev)->mr_v2_seen)))
static void igmpv3_add_delrec(struct in_device *in_dev, struct ip_mc_list *im); static void igmpv3_add_delrec(struct in_device *in_dev, struct ip_mc_list *im);
static void igmpv3_del_delrec(struct in_device *in_dev, __u32 multiaddr); static void igmpv3_del_delrec(struct in_device *in_dev, __be32 multiaddr);
static void igmpv3_clear_delrec(struct in_device *in_dev); static void igmpv3_clear_delrec(struct in_device *in_dev);
static int sf_setstate(struct ip_mc_list *pmc); static int sf_setstate(struct ip_mc_list *pmc);
static void sf_markstate(struct ip_mc_list *pmc); static void sf_markstate(struct ip_mc_list *pmc);
...@@ -439,7 +439,7 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ip_mc_list *pmc, ...@@ -439,7 +439,7 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ip_mc_list *pmc,
if (isquery) if (isquery)
psf->sf_gsresp = 0; psf->sf_gsresp = 0;
if (AVAILABLE(skb) < sizeof(u32) + if (AVAILABLE(skb) < sizeof(__be32) +
first*sizeof(struct igmpv3_grec)) { first*sizeof(struct igmpv3_grec)) {
if (truncate && !first) if (truncate && !first)
break; /* truncate these */ break; /* truncate these */
...@@ -455,7 +455,7 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ip_mc_list *pmc, ...@@ -455,7 +455,7 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ip_mc_list *pmc,
skb = add_grhead(skb, pmc, type, &pgr); skb = add_grhead(skb, pmc, type, &pgr);
first = 0; first = 0;
} }
psrc = (__be32 *)skb_put(skb, sizeof(u32)); psrc = (__be32 *)skb_put(skb, sizeof(__be32));
*psrc = psf->sf_inaddr; *psrc = psf->sf_inaddr;
scount++; stotal++; scount++; stotal++;
if ((type == IGMPV3_ALLOW_NEW_SOURCES || if ((type == IGMPV3_ALLOW_NEW_SOURCES ||
...@@ -630,8 +630,8 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc, ...@@ -630,8 +630,8 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc,
struct igmphdr *ih; struct igmphdr *ih;
struct rtable *rt; struct rtable *rt;
struct net_device *dev = in_dev->dev; struct net_device *dev = in_dev->dev;
u32 group = pmc ? pmc->multiaddr : 0; __be32 group = pmc ? pmc->multiaddr : 0;
u32 dst; __be32 dst;
if (type == IGMPV3_HOST_MEMBERSHIP_REPORT) if (type == IGMPV3_HOST_MEMBERSHIP_REPORT)
return igmpv3_send_report(in_dev, pmc); return igmpv3_send_report(in_dev, pmc);
...@@ -803,7 +803,7 @@ static int igmp_marksources(struct ip_mc_list *pmc, int nsrcs, __be32 *srcs) ...@@ -803,7 +803,7 @@ static int igmp_marksources(struct ip_mc_list *pmc, int nsrcs, __be32 *srcs)
return 1; return 1;
} }
static void igmp_heard_report(struct in_device *in_dev, u32 group) static void igmp_heard_report(struct in_device *in_dev, __be32 group)
{ {
struct ip_mc_list *im; struct ip_mc_list *im;
...@@ -828,7 +828,7 @@ static void igmp_heard_query(struct in_device *in_dev, struct sk_buff *skb, ...@@ -828,7 +828,7 @@ static void igmp_heard_query(struct in_device *in_dev, struct sk_buff *skb,
struct igmphdr *ih = skb->h.igmph; struct igmphdr *ih = skb->h.igmph;
struct igmpv3_query *ih3 = (struct igmpv3_query *)ih; struct igmpv3_query *ih3 = (struct igmpv3_query *)ih;
struct ip_mc_list *im; struct ip_mc_list *im;
u32 group = ih->group; __be32 group = ih->group;
int max_delay; int max_delay;
int mark = 0; int mark = 0;
...@@ -862,7 +862,7 @@ static void igmp_heard_query(struct in_device *in_dev, struct sk_buff *skb, ...@@ -862,7 +862,7 @@ static void igmp_heard_query(struct in_device *in_dev, struct sk_buff *skb,
ih3 = (struct igmpv3_query *) skb->h.raw; ih3 = (struct igmpv3_query *) skb->h.raw;
if (ih3->nsrcs) { if (ih3->nsrcs) {
if (!pskb_may_pull(skb, sizeof(struct igmpv3_query) if (!pskb_may_pull(skb, sizeof(struct igmpv3_query)
+ ntohs(ih3->nsrcs)*sizeof(__u32))) + ntohs(ih3->nsrcs)*sizeof(__be32)))
return; return;
ih3 = (struct igmpv3_query *) skb->h.raw; ih3 = (struct igmpv3_query *) skb->h.raw;
} }
...@@ -985,7 +985,7 @@ int igmp_rcv(struct sk_buff *skb) ...@@ -985,7 +985,7 @@ int igmp_rcv(struct sk_buff *skb)
* Add a filter to a device * Add a filter to a device
*/ */
static void ip_mc_filter_add(struct in_device *in_dev, u32 addr) static void ip_mc_filter_add(struct in_device *in_dev, __be32 addr)
{ {
char buf[MAX_ADDR_LEN]; char buf[MAX_ADDR_LEN];
struct net_device *dev = in_dev->dev; struct net_device *dev = in_dev->dev;
...@@ -1005,7 +1005,7 @@ static void ip_mc_filter_add(struct in_device *in_dev, u32 addr) ...@@ -1005,7 +1005,7 @@ static void ip_mc_filter_add(struct in_device *in_dev, u32 addr)
* Remove a filter from a device * Remove a filter from a device
*/ */
static void ip_mc_filter_del(struct in_device *in_dev, u32 addr) static void ip_mc_filter_del(struct in_device *in_dev, __be32 addr)
{ {
char buf[MAX_ADDR_LEN]; char buf[MAX_ADDR_LEN];
struct net_device *dev = in_dev->dev; struct net_device *dev = in_dev->dev;
...@@ -1055,7 +1055,7 @@ static void igmpv3_add_delrec(struct in_device *in_dev, struct ip_mc_list *im) ...@@ -1055,7 +1055,7 @@ static void igmpv3_add_delrec(struct in_device *in_dev, struct ip_mc_list *im)
spin_unlock_bh(&in_dev->mc_tomb_lock); spin_unlock_bh(&in_dev->mc_tomb_lock);
} }
static void igmpv3_del_delrec(struct in_device *in_dev, __u32 multiaddr) static void igmpv3_del_delrec(struct in_device *in_dev, __be32 multiaddr)
{ {
struct ip_mc_list *pmc, *pmc_prev; struct ip_mc_list *pmc, *pmc_prev;
struct ip_sf_list *psf, *psf_next; struct ip_sf_list *psf, *psf_next;
...@@ -1829,7 +1829,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct ...@@ -1829,7 +1829,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct
{ {
int err; int err;
struct ip_mreqn imr; struct ip_mreqn imr;
u32 addr = mreqs->imr_multiaddr; __be32 addr = mreqs->imr_multiaddr;
struct ip_mc_socklist *pmc; struct ip_mc_socklist *pmc;
struct in_device *in_dev = NULL; struct in_device *in_dev = NULL;
struct inet_sock *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
...@@ -1883,7 +1883,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct ...@@ -1883,7 +1883,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct
rv = !0; rv = !0;
for (i=0; i<psl->sl_count; i++) { for (i=0; i<psl->sl_count; i++) {
rv = memcmp(&psl->sl_addr[i], &mreqs->imr_sourceaddr, rv = memcmp(&psl->sl_addr[i], &mreqs->imr_sourceaddr,
sizeof(__u32)); sizeof(__be32));
if (rv == 0) if (rv == 0)
break; break;
} }
...@@ -1935,7 +1935,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct ...@@ -1935,7 +1935,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct
rv = 1; /* > 0 for insert logic below if sl_count is 0 */ rv = 1; /* > 0 for insert logic below if sl_count is 0 */
for (i=0; i<psl->sl_count; i++) { for (i=0; i<psl->sl_count; i++) {
rv = memcmp(&psl->sl_addr[i], &mreqs->imr_sourceaddr, rv = memcmp(&psl->sl_addr[i], &mreqs->imr_sourceaddr,
sizeof(__u32)); sizeof(__be32));
if (rv == 0) if (rv == 0)
break; break;
} }
...@@ -1960,7 +1960,7 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex) ...@@ -1960,7 +1960,7 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex)
{ {
int err = 0; int err = 0;
struct ip_mreqn imr; struct ip_mreqn imr;
u32 addr = msf->imsf_multiaddr; __be32 addr = msf->imsf_multiaddr;
struct ip_mc_socklist *pmc; struct ip_mc_socklist *pmc;
struct in_device *in_dev; struct in_device *in_dev;
struct inet_sock *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
...@@ -2044,7 +2044,7 @@ int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf, ...@@ -2044,7 +2044,7 @@ int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf,
{ {
int err, len, count, copycount; int err, len, count, copycount;
struct ip_mreqn imr; struct ip_mreqn imr;
u32 addr = msf->imsf_multiaddr; __be32 addr = msf->imsf_multiaddr;
struct ip_mc_socklist *pmc; struct ip_mc_socklist *pmc;
struct in_device *in_dev; struct in_device *in_dev;
struct inet_sock *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
...@@ -2103,7 +2103,7 @@ int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf, ...@@ -2103,7 +2103,7 @@ int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf,
{ {
int err, i, count, copycount; int err, i, count, copycount;
struct sockaddr_in *psin; struct sockaddr_in *psin;
u32 addr; __be32 addr;
struct ip_mc_socklist *pmc; struct ip_mc_socklist *pmc;
struct inet_sock *inet = inet_sk(sk); struct inet_sock *inet = inet_sk(sk);
struct ip_sf_socklist *psl; struct ip_sf_socklist *psl;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment