> + if (!getaddr(fd, (struct sockaddr *) &ss, &len)) {
> + if (ss.ss_family == AF_INET) {
> + struct sockaddr_in sin;
> +
> + memcpy(&sin, &ss, sizeof sin);
> + ds_put_format(string, IP_FMT":%"PRIu16,
> + IP_ARGS(&sin.sin_addr.s_addr),
> ntohs(sin.sin_port));
I be misunderstanding some basic principle of C here, but why do you
need to memcpy? Can't you simply do struct sockaddr_in *sin = (struct
sockaddr_in *)&ss ?
Looks Good.
Ethan
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev