Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Aug 2012 17:00:28 +0100
From:      "Colin O'Keeffe" <cokeeffe@gmail.com>
To:        freebsd-net@freebsd.org
Subject:   IPv6 Destination Option Header options problem
Message-ID:  <CAE11Qay3khRSmuXwYiOWeCC_4Zu%2BcU-ACSK7gkTzcvxm7xLgCw@mail.gmail.com>
In-Reply-To: <CAE11QawK2UyE3NPvFxfv5OyLDyGOecs=W%2BVO0BH52B6us38sVw@mail.gmail.com>
References:  <CAE11QawK2UyE3NPvFxfv5OyLDyGOecs=W%2BVO0BH52B6us38sVw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

As part of a research task, I'm trying to add additional options to a
ip6_dest header. I've taken the code for the jumbo option header
(ip6_output.c line 1254) and modified that to take one value (a
u_int32). I can send and receive this header, with this value no
problem.

The problem I'm having is adding a second option into the extension
header. Can anyone guide me into what I'm doing wrong?

I've tried the following

u_int32_t myfirstvalue;
u_int32_t mysecondvalue;
.
.
.
 optbuf[2] = IP6OPT_MYOPTA; //defined as 0x15 in ip6.h
 optbuf[3] = 4;
 v = (u_int32_t)htonl(myfirstvalue);
 bcopy(&v, &optbuf[4], sizeof(u_int32_t));


 optbuf5] = IP6OPT_MYOPTB; //defined as 0x16 in ip6.h
 optbuf[6] = 4;
 v = (u_int32_t)htonl(mysecondvalue);
 bcopy(&v, &optbuf[7], sizeof(u_int32_t));

The receiving host detects the IP6OPT_MYOPTA and prints the value out
correctly, but it does not detect the second option or value. I'm
guessing it has something to do with padding and alignment in the
extension header?

thanks



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAE11Qay3khRSmuXwYiOWeCC_4Zu%2BcU-ACSK7gkTzcvxm7xLgCw>