Hi all,

  I am writing a simple client server program to send and receive
IPv6 Destination options using the API's specified by RFC 2292.
The sendmsg fails returning an error "Invalid Argument".
  However, when I test the program without the ancillary data portion
(ie, msg_control as NULL) the socket works properly.
 Any kind of help would be greatly appreciated.

I have attached a skeleton program of the client below.

thanks,
Venkatesh


/****************************************/

memset(&msg,0,sizeof(struct msghdr));


/* Allocate memory for msg_control structure*/
 msg.msg_control = (struct cmsghdr*) malloc(inet6_option_space(sizeof(optX)));

 /*Initialize the msg_control variable*/
 inet6_option_init(msg.msg_control,&cmsgptr,IPV6_DSTOPTS);

 /*Initialize the Destination Options*/
 optX.ip6_X_opt_type =   IP6_X_OPT_TYPE;
 optX.ip6_X_opt_len  =   IP6_X_OPT_LEN;
 optX.ip6_X_opt_val1 =   0x1234;


 /*Append the options to cmsghdr*/

inet6_option_append(cmsgptr,&optX.ip6_X_opt_type,IP6_X_OPT_MULTX,IP6_X_O
PT_OFFSETY);

 msg.msg_controllen = CMSG_LEN(sizeof(struct ip6_X_opt));

 fgets(line, sizeof(line), stdin);
 msg.msg_iovlen = 1;
 msg.msg_iov = (struct iovec*) malloc(sizeof(structiovec) *msg.m
sg_iovlen);
msg.msg_iov[0].iov_len = strlen(line)+1;
msg.msg_iov[0].iov_base = (void *) line;
bytes = sendmsg(sd,&msg,0);





---------------------------------------------------------------------
The IPv6 Users Mailing List
Unsubscribe by sending "unsubscribe users" to [EMAIL PROTECTED]

Reply via email to