提交 71229098 编写于 作者: T Tom Rini

eth-raw-os.c: Add cast to bind(2) call

With more recent gcc versions we otherwise get an error like:
note: expected 'const struct sockaddr *' but argument is of type
'struct sockaddr_in *'

and the common solution here is to cast, rather than re-work the code.

Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: NTom Rini <trini@konsulko.com>
Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
上级 af7a5551
......@@ -198,7 +198,8 @@ int sandbox_eth_raw_os_send(void *packet, int length,
addr.sin_family = AF_INET;
addr.sin_port = udph->source;
addr.sin_addr.s_addr = iph->saddr;
retval = bind(priv->local_bind_sd, &addr, sizeof(addr));
retval = bind(priv->local_bind_sd, (struct sockaddr *)&addr,
sizeof(addr));
if (retval < 0)
printf("Failed to bind: %d %s\n", errno,
strerror(errno));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册