| To: | YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@xxxxxxxxxxxxxx> |
|---|---|
| Subject: | Re: [Ipoverib] [PATCH] IPv6: Add correct padding to IPoIB link addr option |
| From: | Krishna Kumar <kumarkr@xxxxxxxxxx> |
| Date: | Wed, 19 Jan 2005 13:19:55 +0530 |
| Cc: | davem@xxxxxxxxxxxxx, ipoverib@xxxxxxxx, netdev@xxxxxxxxxxx, openib-general@xxxxxxxxxx, roland@xxxxxxxxxxx |
| In-reply-to: | <20050119.092018.07351674.yoshfuji@linux-ipv6.org> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
|
Hi Roland,
David, let me tkink about this. Thanks. In article <528y6qej5w.fsf@xxxxxxxxxxx> (at Tue, 18 Jan 2005 09:33:47 -0800), Roland Dreier <roland@xxxxxxxxxxx> says: > +++ linux-bk/net/ipv6/ndisc.c 2005-01-14 21:20:55.736745091 -0800 > @@ -169,12 +169,33 @@ > > #define NDISC_OPT_SPACE(len) (((len)+2+7)&~7) > > -static u8 *ndisc_fill_option(u8 *opt, int type, void *data, int data_len) > +/* > + * Return the padding between the option length and the start of the > + * link addr. Currently only IP-over-InfiniBand needs this, although > + * if RFC 3831 IPv6-over-Fibre Channel is ever implemented it may > + * also need a pad of 2. > + */ > +static int ndisc_addr_option_pad(unsigned short type) > +{ > + switch (type) { > + case ARPHRD_INFINIBAND: return 2; > + default: return 0; > + } > +} > + > +static u8 *ndisc_fill_addr_option(u8 *opt, int type, void *data, int data_len, > + unsigned short addr_type) > { > int space = NDISC_OPT_SPACE(data_len); > + int pad = ndisc_addr_option_pad(addr_type); > > opt[0] = type; > opt[1] = space>>3; > + > + memset(opt + 2, 0, pad); > + opt += pad; > + space -= pad; > + > memcpy(opt+2, data, data_len); > data_len += 2; > opt += data_len; -- Hideaki YOSHIFUJI @ USAGI Project <yoshfuji@xxxxxxxxxxxxxx> GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [PATCH] [IPV6]: kill needless initialization and comparison., YOSHIFUJI Hideaki / 吉藤英明 |
|---|---|
| Next by Date: | Re: [Ipoverib] [PATCH] IPv6: Add correct padding to IPoIB link addr option, Vivek Kashyap |
| Previous by Thread: | Re: [Ipoverib] [PATCH] IPv6: Add correct padding to IPoIB link addr option, YOSHIFUJI Hideaki / 吉藤英明 |
| Next by Thread: | Re: [Ipoverib] [PATCH] IPv6: Add correct padding to IPoIB link addr option, Vivek Kashyap |
| Indexes: | [Date] [Thread] [Top] [All Lists] |